From 795c52dce50d258967f1e6a3e16e7178648fc9d0 Mon Sep 17 00:00:00 2001 From: leej1012 Date: Thu, 30 May 2024 15:27:22 +0800 Subject: [PATCH] Update node info --- .../ontio/controller/AddressController.java | 4 +- .../ontio/controller/NodesController.java | 22 ++- .../ontio/mapper/NodeInfoOffChainMapper.java | 1 + .../ontio/model/dao/NodeInfoOffChain.java | 3 + .../ontio/model/dto/NodeInfoOffChainDto.java | 4 +- .../ontio/model/dto/NodeManagementDto.java | 44 ++++++ .../ontio/model/dto/PromisePosInfo.java | 25 +++ .../github/ontio/service/INodesService.java | 5 +- .../ontio/service/impl/NodesServiceImpl.java | 143 ++++++++++++------ .../github/ontio/util/OntologySDKService.java | 36 +++++ .../V1.83__tbl_node_info_on_chain.sql | 3 +- .../mapper/NodeInfoOffChainMapper.xml | 59 ++++---- 12 files changed, 262 insertions(+), 87 deletions(-) create mode 100644 back-end-projects/Explorer/src/main/java/com/github/ontio/model/dto/NodeManagementDto.java create mode 100644 back-end-projects/Explorer/src/main/java/com/github/ontio/model/dto/PromisePosInfo.java diff --git a/back-end-projects/Explorer/src/main/java/com/github/ontio/controller/AddressController.java b/back-end-projects/Explorer/src/main/java/com/github/ontio/controller/AddressController.java index 33992a84..8b00d7c1 100644 --- a/back-end-projects/Explorer/src/main/java/com/github/ontio/controller/AddressController.java +++ b/back-end-projects/Explorer/src/main/java/com/github/ontio/controller/AddressController.java @@ -212,7 +212,7 @@ public void exportAddressTransferTxs( @RequestLimit(count = 30) @ApiOperation(value = "get address staking info") @GetMapping(value = "/{address}/staking-info") - public ResponseBean getAddressStakingInfo(@PathVariable @Length(min = 34, max = 42, message = "Incorrect address format") String address, + public ResponseBean getAddressStakingInfo(@PathVariable @Length(min = 34, max = 34, message = "Incorrect address format") String address, @RequestParam(required = false) String channel) { return addressService.getAddressStakingInfo(address, channel); } @@ -220,7 +220,7 @@ public ResponseBean getAddressStakingInfo(@PathVariable @Length(min = 34, max = @RequestLimit(count = 30) @ApiOperation(value = "get address staking info when round start") @GetMapping(value = "/{address}/staking-info/round-start") - public ResponseBean getAddressStakingInfoWhenRoundStart(@PathVariable @Length(min = 34, max = 42, message = "Incorrect address format") String address) { + public ResponseBean getAddressStakingInfoWhenRoundStart(@PathVariable @Length(min = 34, max = 34, message = "Incorrect address format") String address) { return addressService.getAddressStakingInfoWhenRoundStart(address); } } diff --git a/back-end-projects/Explorer/src/main/java/com/github/ontio/controller/NodesController.java b/back-end-projects/Explorer/src/main/java/com/github/ontio/controller/NodesController.java index 8235d19b..d47d7de2 100644 --- a/back-end-projects/Explorer/src/main/java/com/github/ontio/controller/NodesController.java +++ b/back-end-projects/Explorer/src/main/java/com/github/ontio/controller/NodesController.java @@ -1,6 +1,7 @@ package com.github.ontio.controller; import com.alibaba.fastjson.JSONObject; +import com.github.ontio.aop.RequestLimit; import com.github.ontio.model.common.PageResponseBean; import com.github.ontio.model.common.ResponseBean; import com.github.ontio.model.dao.*; @@ -156,13 +157,6 @@ public ResponseBean getOffChainInfoByPublicKey(@RequestParam("public_key") @Leng return new ResponseBean(ErrorInfo.SUCCESS.code(), ErrorInfo.SUCCESS.desc(), nodeInfoList); } - // @ApiOperation(value = "insert or update node register information by public key") -// @PostMapping(value = "/off-chain-info") - public ResponseBean updateOffChainInfoByPublicKey(@RequestBody UpdateOffChainNodeInfoDto updateOffChainNodeInfoDto) throws Exception { - ResponseBean responseBean = nodesService.updateOffChainInfoByPublicKey(updateOffChainNodeInfoDto); - return responseBean; - } - @ApiOperation(value = "Get reward per 10000 ONT stake unit") @GetMapping(value = "/bonus-histories") public ResponseBean getBonusHistories() { @@ -378,4 +372,18 @@ public ResponseBean getNodes(@RequestBody NodesInfoDto dto) { return new ResponseBean(ErrorInfo.SUCCESS.code(), ErrorInfo.SUCCESS.desc(), response); } + @RequestLimit(count = 60) + @ApiOperation(value = "get address register node info") + @GetMapping(value = "/register-node-list") + public ResponseBean getAddressRegisterNodeList(@RequestParam @Length(min = 34, max = 34, message = "Incorrect address format") String address) { + return nodesService.getAddressRegisterNodeList(address); + } + + @RequestLimit(count = 60) + @ApiOperation(value = "get node on chain config") + @GetMapping(value = "/node-on-chain-config") + public ResponseBean getNodeOnChainConfig(@RequestParam @Length(min = 34, max = 34, message = "Incorrect address format") String address, + @RequestParam("public_key") @Length(min = 56, max = 128, message = "invalid public key") String publicKey) { + return nodesService.getNodeOnChainConfig(address,publicKey); + } } diff --git a/back-end-projects/Explorer/src/main/java/com/github/ontio/mapper/NodeInfoOffChainMapper.java b/back-end-projects/Explorer/src/main/java/com/github/ontio/mapper/NodeInfoOffChainMapper.java index efd36717..f299d238 100644 --- a/back-end-projects/Explorer/src/main/java/com/github/ontio/mapper/NodeInfoOffChainMapper.java +++ b/back-end-projects/Explorer/src/main/java/com/github/ontio/mapper/NodeInfoOffChainMapper.java @@ -19,4 +19,5 @@ public interface NodeInfoOffChainMapper extends Mapper { List selectAllStakingNodeInfo(); + List selectAllRegisterNodeInfo(String address); } \ No newline at end of file diff --git a/back-end-projects/Explorer/src/main/java/com/github/ontio/model/dao/NodeInfoOffChain.java b/back-end-projects/Explorer/src/main/java/com/github/ontio/model/dao/NodeInfoOffChain.java index 3f238836..9bd77439 100644 --- a/back-end-projects/Explorer/src/main/java/com/github/ontio/model/dao/NodeInfoOffChain.java +++ b/back-end-projects/Explorer/src/main/java/com/github/ontio/model/dao/NodeInfoOffChain.java @@ -85,6 +85,9 @@ public class NodeInfoOffChain { @Transient private String progress; + @Transient + private Long initPos; + @Transient private Long totalPos; diff --git a/back-end-projects/Explorer/src/main/java/com/github/ontio/model/dto/NodeInfoOffChainDto.java b/back-end-projects/Explorer/src/main/java/com/github/ontio/model/dto/NodeInfoOffChainDto.java index 08057db2..b91c63c4 100644 --- a/back-end-projects/Explorer/src/main/java/com/github/ontio/model/dto/NodeInfoOffChainDto.java +++ b/back-end-projects/Explorer/src/main/java/com/github/ontio/model/dto/NodeInfoOffChainDto.java @@ -14,7 +14,7 @@ public class NodeInfoOffChainDto extends NodeInfoOffChain { @Builder - public NodeInfoOffChainDto(String publicKey, String name, String address, String ontId, Integer nodeType, String introduction, String logoUrl, String region, BigDecimal longitude, BigDecimal latitude, String ip, String website, String socialMedia, String telegram, String twitter, String facebook, String openMail, String contactMail, Boolean openFlag, Integer verification, Integer contactInfoVerified, Integer feeSharingRatio, Integer ontologyHarbinger, Integer oldNode, Integer badActor, Integer risky, Integer status, String progress, Long totalPos, Long maxAuthorize, String userApy) { - super(publicKey, name, address, ontId, nodeType, introduction, logoUrl, region, longitude, latitude, ip, website, socialMedia, telegram, twitter, facebook, openMail, contactMail, openFlag, verification, contactInfoVerified, feeSharingRatio, ontologyHarbinger, oldNode, badActor, risky, status, progress, totalPos, maxAuthorize, userApy); + public NodeInfoOffChainDto(String publicKey, String name, String address, String ontId, Integer nodeType, String introduction, String logoUrl, String region, BigDecimal longitude, BigDecimal latitude, String ip, String website, String socialMedia, String telegram, String twitter, String facebook, String openMail, String contactMail, Boolean openFlag, Integer verification, Integer contactInfoVerified, Integer feeSharingRatio, Integer ontologyHarbinger, Integer oldNode, Integer badActor, Integer risky, Integer status, String progress, Long initPos, Long totalPos, Long maxAuthorize, String userApy) { + super(publicKey, name, address, ontId, nodeType, introduction, logoUrl, region, longitude, latitude, ip, website, socialMedia, telegram, twitter, facebook, openMail, contactMail, openFlag, verification, contactInfoVerified, feeSharingRatio, ontologyHarbinger, oldNode, badActor, risky, status, progress, initPos, totalPos, maxAuthorize, userApy); } } diff --git a/back-end-projects/Explorer/src/main/java/com/github/ontio/model/dto/NodeManagementDto.java b/back-end-projects/Explorer/src/main/java/com/github/ontio/model/dto/NodeManagementDto.java new file mode 100644 index 00000000..54658c01 --- /dev/null +++ b/back-end-projects/Explorer/src/main/java/com/github/ontio/model/dto/NodeManagementDto.java @@ -0,0 +1,44 @@ +package com.github.ontio.model.dto; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +/** + * @author lijie + * @version 1.0 + * @date 2024/5/30 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class NodeManagementDto { + + private String nodeApr = "0.00%"; + + private String userApr = "0.00%"; + + private String feeSharingRatioNodeT = "0%"; + + private String feeSharingRatioNodeT1 = "0%"; + + private String feeSharingRatioNodeT2 = "0%"; + + private String feeSharingRatioUserT = "0%"; + + private String feeSharingRatioUserT1 = "0%"; + + private String feeSharingRatioUserT2 = "0%"; + + private String promiseStake = "0"; + + private String nodeStake = "0"; + + private String userStake = "0"; + + private String totalStake = "0"; + + private String cap = "0"; + + private String withdrawableAmount; + + private String lockedAmount; +} diff --git a/back-end-projects/Explorer/src/main/java/com/github/ontio/model/dto/PromisePosInfo.java b/back-end-projects/Explorer/src/main/java/com/github/ontio/model/dto/PromisePosInfo.java new file mode 100644 index 00000000..c7c5f6f8 --- /dev/null +++ b/back-end-projects/Explorer/src/main/java/com/github/ontio/model/dto/PromisePosInfo.java @@ -0,0 +1,25 @@ +package com.github.ontio.model.dto; + +import com.github.ontio.common.Helper; +import com.github.ontio.io.BinaryReader; +import com.github.ontio.io.BinaryWriter; +import com.github.ontio.io.Serializable; + +import java.io.IOException; +import java.math.BigInteger; + +public class PromisePosInfo implements Serializable { + public String peerPubkey; + public BigInteger promisePos; + + public PromisePosInfo() { + } + + public void deserialize(BinaryReader reader) throws IOException { + this.peerPubkey = reader.readVarString(); + this.promisePos = Helper.BigIntFromNeoBytes(reader.readVarBytes()); + } + + public void serialize(BinaryWriter writer) throws IOException { + } +} \ No newline at end of file diff --git a/back-end-projects/Explorer/src/main/java/com/github/ontio/service/INodesService.java b/back-end-projects/Explorer/src/main/java/com/github/ontio/service/INodesService.java index d673464e..ee19168b 100644 --- a/back-end-projects/Explorer/src/main/java/com/github/ontio/service/INodesService.java +++ b/back-end-projects/Explorer/src/main/java/com/github/ontio/service/INodesService.java @@ -43,8 +43,6 @@ public interface INodesService { NodeInfoOffChain getCurrentOffChainInfoPublic(String publicKey, Integer openFlag); - ResponseBean updateOffChainInfoByPublicKey(UpdateOffChainNodeInfoDto nodeInfoOffChainDto) throws Exception; - List getCurrentOffChainInfo(); NodeInfoOnChain getCurrentOnChainInfo(String publicKey); @@ -100,4 +98,7 @@ public interface INodesService { PageResponseBean getNodesByFilter(NodesInfoDto nodesInfo); + ResponseBean getAddressRegisterNodeList(String address); + + ResponseBean getNodeOnChainConfig(String address, String publicKey); } diff --git a/back-end-projects/Explorer/src/main/java/com/github/ontio/service/impl/NodesServiceImpl.java b/back-end-projects/Explorer/src/main/java/com/github/ontio/service/impl/NodesServiceImpl.java index 717cc8ac..8cc76586 100644 --- a/back-end-projects/Explorer/src/main/java/com/github/ontio/service/impl/NodesServiceImpl.java +++ b/back-end-projects/Explorer/src/main/java/com/github/ontio/service/impl/NodesServiceImpl.java @@ -19,30 +19,14 @@ package com.github.ontio.service.impl; import com.alibaba.fastjson.JSONObject; -import com.github.ontio.common.Helper; import com.github.ontio.config.ParamsConfig; +import com.github.ontio.core.governance.PeerPoolItem; import com.github.ontio.exception.ExplorerException; import com.github.ontio.mapper.*; +import com.github.ontio.model.common.PageResponseBean; import com.github.ontio.model.common.ResponseBean; import com.github.ontio.model.dao.*; import com.github.ontio.model.dto.*; -import com.github.ontio.mapper.CommonMapper; -import com.github.ontio.mapper.NetNodeInfoMapper; -import com.github.ontio.mapper.NodeBonusMapper; -import com.github.ontio.mapper.NodeInfoOffChainMapper; -import com.github.ontio.mapper.NodeInfoOnChainMapper; -import com.github.ontio.mapper.NodeOverviewMapper; -import com.github.ontio.mapper.NodeRankChangeMapper; -import com.github.ontio.mapper.NodeRankHistoryMapper; -import com.github.ontio.model.common.PageResponseBean; -import com.github.ontio.model.dao.NetNodeInfo; -import com.github.ontio.model.dao.NodeBonus; -import com.github.ontio.model.dao.NodeInfoOffChain; -import com.github.ontio.model.dao.NodeInfoOnChain; -import com.github.ontio.model.dao.NodeInfoOnChainWithBonus; -import com.github.ontio.model.dao.NodeInfoOnChainWithRankChange; -import com.github.ontio.model.dao.NodeRankChange; -import com.github.ontio.model.dao.NodeRankHistory; import com.github.ontio.sdk.exception.SDKException; import com.github.ontio.service.INodesService; import com.github.ontio.util.ConstantParam; @@ -283,35 +267,6 @@ public NodeInfoOffChain getCurrentOffChainInfoPublic(String publicKey, Integer o } } - @Override - public ResponseBean updateOffChainInfoByPublicKey(UpdateOffChainNodeInfoDto updateOffChainNodeInfoDto) throws Exception { - String nodeInfo = updateOffChainNodeInfoDto.getNodeInfo(); - String stakePublicKey = updateOffChainNodeInfoDto.getPublicKey(); - String signature = updateOffChainNodeInfoDto.getSignature(); - - byte[] nodeInfoBytes = Helper.hexToBytes(nodeInfo); - initSDK(); - boolean verify = sdk.verifySignatureByPublicKey(stakePublicKey, nodeInfoBytes, signature); - if (!verify) { - return new ResponseBean(ErrorInfo.VERIFY_SIGN_FAILED.code(), ErrorInfo.VERIFY_SIGN_FAILED.desc(), ""); - } - String nodeInfoStr = new String(nodeInfoBytes, "UTF-8"); - NodeInfoOffChain nodeInfoOffChain = JSONObject.parseObject(nodeInfoStr, NodeInfoOffChain.class); - nodeInfoOffChain.setVerification(ConstantParam.NODE_NOT_VERIFIED); - nodeInfoOffChain.setOntId(""); - nodeInfoOffChain.setNodeType(ConstantParam.CANDIDATE_NODE); - String nodePublicKey = nodeInfoOffChain.getPublicKey(); - NodeInfoOffChainDto nodeInfoOffChainDto = nodeInfoOffChainMapper.selectByPublicKey(nodePublicKey, null); - if (null == nodeInfoOffChainDto) { - // insert - nodeInfoOffChainMapper.insertSelective(nodeInfoOffChain); - } else { - // update - nodeInfoOffChainMapper.updateByPrimaryKeySelective(nodeInfoOffChain); - } - return new ResponseBean(ErrorInfo.SUCCESS.code(), ErrorInfo.SUCCESS.desc(), ErrorInfo.SUCCESS.desc()); - } - @Override public List getNodeBonusHistories() { try { @@ -1043,4 +998,98 @@ public PageResponseBean getNodesByFilter(NodesInfoDto dto) { return new PageResponseBean(respDtoList.subList(start, Math.min(start + pageSize, respSize)), respSize); } } + + @Override + public ResponseBean getAddressRegisterNodeList(String address) { + List registerNodeList = nodeInfoOffChainMapper.selectAllRegisterNodeInfo(address); + if (!CollectionUtils.isEmpty(registerNodeList)) { + try { + initSDK(); + Map peerPoolMap = sdk.getPeerPoolMap(); + for (NodeInfoOffChain registerNodeInfo : registerNodeList) { + String publicKey = registerNodeInfo.getPublicKey(); + long initPos = 0; + long totalPos = 0; + // status:1-在线;2-正在退出;3-已退出 + int status = 3; + if (peerPoolMap.containsKey(publicKey)) { + PeerPoolItem item = (PeerPoolItem) peerPoolMap.get(publicKey); + initPos = item.initPos; + totalPos = item.totalPos; + if (item.status == 1 || item.status == 2) { + status = 1; + } else { + status = 2; + } + } else { + String authorizeInfo = sdk.getAuthorizeInfo(publicKey, address); + if (StringUtils.hasLength(authorizeInfo)) { + JSONObject jsonObject = JSONObject.parseObject(authorizeInfo); + initPos = jsonObject.getLong("withdrawUnfreezePos"); + } + } + registerNodeInfo.setStatus(status); + registerNodeInfo.setInitPos(initPos); + registerNodeInfo.setTotalPos(totalPos); + } + } catch (Exception e) { + log.error("getAddressRegisterNodeInfo error:{},{}", address, e.getMessage()); + } + } + return new ResponseBean(ErrorInfo.SUCCESS.code(), ErrorInfo.SUCCESS.desc(), registerNodeList); + } + + @Override + public ResponseBean getNodeOnChainConfig(String address, String publicKey) { + NodeManagementDto nodeManagementDto = new NodeManagementDto(); + NodeInspire nodeInspire = nodeInspireMapper.selectByPrimaryKey(publicKey); + if (nodeInspire != null) { + String nodeApr = Optional.ofNullable(nodeInspire.getNodeApy()).orElse("0.00%"); + String userApr = Optional.ofNullable(nodeInspire.getUserApy()).orElse("0.00%"); + nodeManagementDto.setNodeApr(nodeApr); + nodeManagementDto.setUserApr(userApr); + } + try { + initSDK(); + String peerPoolInfoStr = sdk.getPeerPoolInfo(publicKey); + if (StringUtils.hasLength(peerPoolInfoStr)) { + JSONObject peerPoolInfo = JSONObject.parseObject(peerPoolInfoStr); + Long initPos = peerPoolInfo.getLong("initPos"); + Long totalPos = peerPoolInfo.getLong("totalPos"); + long allStake = initPos + totalPos; + nodeManagementDto.setNodeStake(initPos.toString()); + nodeManagementDto.setUserStake(totalPos.toString()); + nodeManagementDto.setTotalStake(String.valueOf(allStake)); + } + + long promisePos = sdk.getPromisePos(publicKey); + nodeManagementDto.setPromiseStake(String.valueOf(promisePos)); + + String attributesStr = sdk.getAttributes(publicKey); + if (StringUtils.hasLength(attributesStr)) { + JSONObject attributes = JSONObject.parseObject(attributesStr); + nodeManagementDto.setCap(attributes.getLong("maxAuthorize").toString()); + nodeManagementDto.setFeeSharingRatioNodeT(attributes.getLong("tPeerCost") + "%"); + nodeManagementDto.setFeeSharingRatioNodeT1(attributes.getLong("t1PeerCost") + "%"); + nodeManagementDto.setFeeSharingRatioNodeT2(attributes.getLong("t2PeerCost") + "%"); + nodeManagementDto.setFeeSharingRatioUserT(attributes.getLong("tStakeCost") + "%"); + nodeManagementDto.setFeeSharingRatioUserT1(attributes.getLong("t1StakeCost") + "%"); + nodeManagementDto.setFeeSharingRatioUserT2(attributes.getLong("t2StakeCost") + "%"); + } + + String authorizeInfoStr = sdk.getAuthorizeInfo(publicKey, address); + if (StringUtils.hasLength(authorizeInfoStr)) { + JSONObject authorizeInfo = JSONObject.parseObject(authorizeInfoStr); + Long withdrawPos = authorizeInfo.getLong("withdrawPos"); + Long withdrawFreezePos = authorizeInfo.getLong("withdrawFreezePos"); + Long withdrawUnfreezePos = authorizeInfo.getLong("withdrawUnfreezePos"); + long lockedAmount = withdrawPos + withdrawFreezePos; + nodeManagementDto.setWithdrawableAmount(withdrawUnfreezePos.toString()); + nodeManagementDto.setLockedAmount(String.valueOf(lockedAmount)); + } + } catch (Exception e) { + log.error("getNodeOnChainConfig error:{},{},{}", address, publicKey, e.getMessage()); + } + return new ResponseBean(ErrorInfo.SUCCESS.code(), ErrorInfo.SUCCESS.desc(), nodeManagementDto); + } } diff --git a/back-end-projects/Explorer/src/main/java/com/github/ontio/util/OntologySDKService.java b/back-end-projects/Explorer/src/main/java/com/github/ontio/util/OntologySDKService.java index 0e214c20..18b49cf3 100644 --- a/back-end-projects/Explorer/src/main/java/com/github/ontio/util/OntologySDKService.java +++ b/back-end-projects/Explorer/src/main/java/com/github/ontio/util/OntologySDKService.java @@ -39,6 +39,7 @@ import com.github.ontio.io.BinaryReader; import com.github.ontio.io.BinaryWriter; import com.github.ontio.io.Serializable; +import com.github.ontio.model.dto.PromisePosInfo; import com.github.ontio.network.exception.ConnectorException; import com.github.ontio.sdk.exception.SDKException; import com.github.ontio.smartcontract.nativevm.abi.NativeBuildParams; @@ -630,6 +631,41 @@ public String getAuthorizeInfo(String publicKey, String address) throws SDKExcep return ontSdk.nativevm().governance().getAuthorizeInfo(publicKey, addr); } + public Map getPeerPoolMap() throws Exception { + OntSdk ontSdk = getOntSdk(); + return ontSdk.nativevm().governance().getPeerPoolMap(); + } + + public String getPeerPoolInfo(String publicKey) throws Exception { + OntSdk ontSdk = getOntSdk(); + return ontSdk.nativevm().governance().getPeerInfo(publicKey); + } + + public String getAttributes(String publicKey) throws Exception { + OntSdk ontSdk = getOntSdk(); + return ontSdk.nativevm().governance().getPeerAttributes(publicKey); + } + + public long getPromisePos(String publicKey) { + OntSdk ontSdk = getOntSdk(); + byte[] publicKeyPrefix = Helper.hexToBytes(publicKey); + byte[] promisePos = "promisePos".getBytes(); + byte[] key = new byte[promisePos.length + publicKeyPrefix.length]; + System.arraycopy(promisePos, 0, key, 0, promisePos.length); + System.arraycopy(publicKeyPrefix, 0, key, promisePos.length, publicKeyPrefix.length); + + try { + String res = ontSdk.getConnect().getStorage(Helper.reverse(contractAddress), Helper.toHexString(key)); + if (res != null && !res.equals("")) { + PromisePosInfo promisePosInfo = Serializable.from(Helper.hexToBytes(res), PromisePosInfo.class); + return promisePosInfo.promisePos.longValue(); + } + } catch (Exception e) { + log.error("getPromisePos error", e); + } + return 0; + } + public int getPreConsensusCount() { try { Configuration preConfiguration = getPreConfiguration(); diff --git a/back-end-projects/Explorer/src/main/resources/db/migration/V1.83__tbl_node_info_on_chain.sql b/back-end-projects/Explorer/src/main/resources/db/migration/V1.83__tbl_node_info_on_chain.sql index 9a459519..c8362314 100644 --- a/back-end-projects/Explorer/src/main/resources/db/migration/V1.83__tbl_node_info_on_chain.sql +++ b/back-end-projects/Explorer/src/main/resources/db/migration/V1.83__tbl_node_info_on_chain.sql @@ -1 +1,2 @@ -ALTER TABLE tbl_node_info_on_chain ADD INDEX idx_public_key (public_key); \ No newline at end of file +ALTER TABLE tbl_node_info_on_chain ADD INDEX idx_public_key (public_key); +ALTER TABLE tbl_node_info_off_chain ADD INDEX idx_address (address); \ No newline at end of file diff --git a/back-end-projects/Explorer/src/main/resources/mapper/NodeInfoOffChainMapper.xml b/back-end-projects/Explorer/src/main/resources/mapper/NodeInfoOffChainMapper.xml index 7780080f..b58f158a 100644 --- a/back-end-projects/Explorer/src/main/resources/mapper/NodeInfoOffChainMapper.xml +++ b/back-end-projects/Explorer/src/main/resources/mapper/NodeInfoOffChainMapper.xml @@ -34,32 +34,32 @@ - public_key, - name, - address, - ont_id, - node_type, - introduction, - logo_url, - region, - longitude, - latitude, - ip, - website, - social_media, - telegram, - twitter, - facebook, - open_mail, - contact_mail, - open_flag, - verification, - fee_sharing_ratio AS feeSharingRatio, - ontology_harbinger AS ontologyHarbinger, - contact_info_verified AS contactInfoVerified, - old_node AS oldNode, - risky, - bad_actor AS badActor + public_key, + name, + address, + ont_id, + node_type, + introduction, + logo_url, + region, + longitude, + latitude, + ip, + website, + social_media, + telegram, + twitter, + facebook, + open_mail, + contact_mail, + open_flag, + verification, + fee_sharing_ratio AS feeSharingRatio, + ontology_harbinger AS ontologyHarbinger, + contact_info_verified AS contactInfoVerified, + old_node AS oldNode, + risky, + bad_actor AS badActor + + \ No newline at end of file