├── release_note.txt ├── script ├── webase-sql.list ├── deploy │ ├── update_shell.sh │ ├── check_container_exist.sh │ └── check_image_exist.sh └── webase.sh ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── src ├── main │ ├── resources │ │ ├── swagger │ │ │ ├── swagger-ui.css.map │ │ │ ├── favicon-16x16.png │ │ │ └── favicon-32x32.png │ │ ├── Arial │ │ │ ├── ARIALN.TTF │ │ │ ├── arial.ttf │ │ │ ├── ariali.ttf │ │ │ ├── ariblk.ttf │ │ │ ├── ARIALNB.TTF │ │ │ ├── ARIALNBI.TTF │ │ │ ├── ARIALNI.TTF │ │ │ ├── arialbd.ttf │ │ │ └── arialbi.ttf │ │ └── templates │ │ │ ├── node │ │ │ ├── front-application-yml.tpl │ │ │ └── node-group-genesis.tpl │ │ │ ├── AlertEmailForTest.html │ │ │ └── AlertEmailTemplate.html │ └── java │ │ └── com │ │ └── webank │ │ └── webase │ │ └── node │ │ └── mgr │ │ ├── precompiled │ │ ├── entity │ │ │ ├── PrecompiledResult.java │ │ │ ├── AddressStatusHandle.java │ │ │ ├── ChainGovernanceHandle.java │ │ │ ├── ContractStatusHandle.java │ │ │ ├── PermissionState.java │ │ │ ├── CrudHandle.java │ │ │ ├── SysConfigParam.java │ │ │ ├── CnsParam.java │ │ │ ├── PermissionParam.java │ │ │ ├── ConsensusHandle.java │ │ │ └── RspCommitteeInfo.java │ │ └── permission │ │ │ └── governvote │ │ │ ├── entity │ │ │ └── GovernParam.java │ │ │ └── GovernVoteMapper.java │ │ ├── contract │ │ ├── entity │ │ │ ├── RspContractPath.java │ │ │ ├── ReqCopyContracts.java │ │ │ ├── ReqAddAddress.java │ │ │ ├── RspSystemProxy.java │ │ │ ├── ReqListContract.java │ │ │ ├── QueryByBinParam.java │ │ │ ├── ContractPathParam.java │ │ │ ├── ReqQueryCns.java │ │ │ ├── QueryContractParam.java │ │ │ ├── ReqQueryCnsList.java │ │ │ ├── TbContractPath.java │ │ │ ├── TransactionInputParam.java │ │ │ ├── ReqRegisterCns.java │ │ │ └── RspContractNoAbi.java │ │ ├── warehouse │ │ │ └── WarehouseStartupRunner.java │ │ ├── scaffold │ │ │ └── entity │ │ │ │ └── RspFile.java │ │ ├── abi │ │ │ └── entity │ │ │ │ ├── RspAllContract.java │ │ │ │ ├── ReqImportAbi.java │ │ │ │ └── AbiInfo.java │ │ └── CnsMapper.java │ │ ├── transaction │ │ └── entity │ │ │ └── ReqSignMessage.java │ │ ├── event │ │ └── entity │ │ │ ├── RspContractInfo.java │ │ │ ├── ReqEventLogList.java │ │ │ └── EventTopicParam.java │ │ ├── configapi │ │ └── entity │ │ │ └── ServerInfo.java │ │ ├── cert │ │ └── entity │ │ │ ├── SdkCertInfo.java │ │ │ ├── CertHandle.java │ │ │ ├── FileContentHandle.java │ │ │ ├── TbCert.java │ │ │ └── CertParam.java │ │ ├── user │ │ └── entity │ │ │ ├── ReqImportPem.java │ │ │ ├── KeyPair.java │ │ │ ├── UpdateUserInputParam.java │ │ │ ├── ReqExport.java │ │ │ ├── ReqImportPrivateKey.java │ │ │ ├── NewUserInputParam.java │ │ │ └── UserParam.java │ │ ├── deploy │ │ └── entity │ │ │ ├── ReqCheckHost.java │ │ │ ├── ReqAddHost.java │ │ │ ├── ReqUpgrade.java │ │ │ ├── DeployNodeInfo.java │ │ │ ├── ReqNodeOption.java │ │ │ └── ReqInitHost.java │ │ ├── front │ │ ├── frontinterface │ │ │ └── entity │ │ │ │ ├── GroupHandleResult.java │ │ │ │ ├── FailInfo.java │ │ │ │ ├── FrontUrlInfo.java │ │ │ │ ├── PeerOfSyncStatus.java │ │ │ │ ├── RspStatBlock.java │ │ │ │ ├── PeerOfConsensusStatus.java │ │ │ │ ├── PostAbiInfo.java │ │ │ │ ├── SyncStatus.java │ │ │ │ └── GenerateGroupInfo.java │ │ └── entity │ │ │ ├── NodeHeartBeat.java │ │ │ ├── TotalTransCountInfo.java │ │ │ ├── FrontInfo.java │ │ │ ├── FrontNodeConfig.java │ │ │ └── FrontParam.java │ │ ├── node │ │ └── entity │ │ │ ├── Node.java │ │ │ ├── ReqUpdate.java │ │ │ ├── RspCity.java │ │ │ ├── NodeInfo.java │ │ │ ├── PeerInfo.java │ │ │ └── NodeParam.java │ │ ├── account │ │ ├── entity │ │ │ ├── ImageToken.java │ │ │ ├── LoginInfo.java │ │ │ ├── PasswordInfo.java │ │ │ ├── AccountInfo.java │ │ │ └── AccountListParam.java │ │ ├── token │ │ │ ├── TbToken.java │ │ │ └── TokenMapper.java │ │ └── role │ │ │ ├── RoleMapper.java │ │ │ └── TbRole.java │ │ ├── base │ │ ├── annotation │ │ │ ├── entity │ │ │ │ └── CurrentAccountInfo.java │ │ │ └── CurrentAccount.java │ │ ├── enums │ │ │ ├── HasPk.java │ │ │ ├── AppType.java │ │ │ ├── EnableStatus.java │ │ │ ├── AlertLevelType.java │ │ │ ├── AlertRuleType.java │ │ │ ├── ContractType.java │ │ │ ├── RoleType.java │ │ │ ├── OperateStatus.java │ │ │ ├── UserType.java │ │ │ ├── ScpTypeEnum.java │ │ │ ├── RequestType.java │ │ │ ├── TransType.java │ │ │ ├── ConsensusType.java │ │ │ ├── SqlSortType.java │ │ │ ├── MonitorUserType.java │ │ │ ├── OptionType.java │ │ │ ├── DeployType.java │ │ │ ├── TransUnusualType.java │ │ │ ├── TableName.java │ │ │ ├── ContractStatus.java │ │ │ ├── ExternalInfoType.java │ │ │ ├── GroupType.java │ │ │ ├── GovernType.java │ │ │ └── RunTypeEnum.java │ │ ├── entity │ │ │ └── BaseQueryParam.java │ │ └── exception │ │ │ └── ParamException.java │ │ ├── monitor │ │ └── entity │ │ │ ├── PageTransInfo.java │ │ │ ├── UserMonitorResult.java │ │ │ ├── UnusualUserInfo.java │ │ │ ├── UnusualContractInfo.java │ │ │ ├── ContractMonitorResult.java │ │ │ └── ChainTransInfo.java │ │ ├── appintegration │ │ ├── entity │ │ │ ├── BasicInfo.java │ │ │ ├── AppRegisterInfo.java │ │ │ ├── UpdatePasswordInfo.java │ │ │ ├── AppAddInfo.java │ │ │ └── AppInfoParam.java │ │ └── contractstore │ │ │ └── entity │ │ │ ├── ContractSource.java │ │ │ ├── ContractStoreParam.java │ │ │ ├── ReqContractSourceSave.java │ │ │ └── ReqContractAddressSave.java │ │ ├── transdaily │ │ └── SeventDaysTrans.java │ │ ├── block │ │ └── entity │ │ │ └── MinMaxBlock.java │ │ ├── method │ │ ├── entity │ │ │ ├── NewMethodInputParam.java │ │ │ ├── Method.java │ │ │ └── TbMethod.java │ │ └── MethodMapper.java │ │ ├── tools │ │ ├── pagetools │ │ │ └── entity │ │ │ │ └── MapHandle.java │ │ ├── NumberUtil.java │ │ └── cmd │ │ │ └── ExecuteResult.java │ │ ├── frontgroupmap │ │ └── entity │ │ │ ├── FrontGroup.java │ │ │ └── MapListParam.java │ │ ├── group │ │ └── entity │ │ │ ├── ReqUpdateDesc.java │ │ │ ├── RspOperateResult.java │ │ │ ├── GroupGeneral.java │ │ │ ├── ReqOperateGroup.java │ │ │ ├── StatisticalGroupTransInfo.java │ │ │ ├── ReqBatchStartGroup.java │ │ │ ├── ReqGroupStatus.java │ │ │ ├── RspGroupStatus.java │ │ │ └── ReqGenerateGroup.java │ │ ├── statistic │ │ └── result │ │ │ ├── PerformanceData.java │ │ │ ├── Data.java │ │ │ └── LineDataList.java │ │ ├── alert │ │ ├── log │ │ │ ├── entity │ │ │ │ ├── ReqLogParam.java │ │ │ │ ├── ReqLogListParam.java │ │ │ │ └── AlertLog.java │ │ │ └── AlertLogMapper.java │ │ ├── rule │ │ │ └── AlertRuleMapper.java │ │ └── mail │ │ │ └── server │ │ │ └── config │ │ │ └── MailServerConfigMapper.java │ │ ├── config │ │ └── properties │ │ │ ├── VersionProperties.java │ │ │ ├── ExecutorProperties.java │ │ │ └── SchedulerProperties.java │ │ ├── table │ │ ├── entity │ │ │ └── TbInfo.java │ │ └── TableMapper.java │ │ └── external │ │ └── entity │ │ └── RspAllExtAccount.java └── test │ └── java │ └── node │ └── mgr │ └── test │ ├── token │ └── TokenTest.java │ ├── base │ └── TestBase.java │ ├── group │ └── GroupServiceTest.java │ └── chaingovernance │ └── ContractStatusServiceTest.java ├── sider.yml ├── .gitignore ├── .travis.yml ├── docker └── build │ └── Dockerfile ├── README.md ├── status.sh └── stop.sh /release_note.txt: -------------------------------------------------------------------------------- 1 | v1.5.5 2 | -------------------------------------------------------------------------------- /script/webase-sql.list: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | source webase-ddl.sql; 4 | source webase-dml.sql; -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeBankBlockchain/WeBASE-Node-Manager/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/main/resources/swagger/swagger-ui.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"swagger-ui.css","sourceRoot":""} -------------------------------------------------------------------------------- /src/main/resources/Arial/ARIALN.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeBankBlockchain/WeBASE-Node-Manager/HEAD/src/main/resources/Arial/ARIALN.TTF -------------------------------------------------------------------------------- /src/main/resources/Arial/arial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeBankBlockchain/WeBASE-Node-Manager/HEAD/src/main/resources/Arial/arial.ttf -------------------------------------------------------------------------------- /src/main/resources/Arial/ariali.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeBankBlockchain/WeBASE-Node-Manager/HEAD/src/main/resources/Arial/ariali.ttf -------------------------------------------------------------------------------- /src/main/resources/Arial/ariblk.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeBankBlockchain/WeBASE-Node-Manager/HEAD/src/main/resources/Arial/ariblk.ttf -------------------------------------------------------------------------------- /src/main/resources/Arial/ARIALNB.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeBankBlockchain/WeBASE-Node-Manager/HEAD/src/main/resources/Arial/ARIALNB.TTF -------------------------------------------------------------------------------- /src/main/resources/Arial/ARIALNBI.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeBankBlockchain/WeBASE-Node-Manager/HEAD/src/main/resources/Arial/ARIALNBI.TTF -------------------------------------------------------------------------------- /src/main/resources/Arial/ARIALNI.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeBankBlockchain/WeBASE-Node-Manager/HEAD/src/main/resources/Arial/ARIALNI.TTF -------------------------------------------------------------------------------- /src/main/resources/Arial/arialbd.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeBankBlockchain/WeBASE-Node-Manager/HEAD/src/main/resources/Arial/arialbd.ttf -------------------------------------------------------------------------------- /src/main/resources/Arial/arialbi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeBankBlockchain/WeBASE-Node-Manager/HEAD/src/main/resources/Arial/arialbi.ttf -------------------------------------------------------------------------------- /src/main/resources/swagger/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeBankBlockchain/WeBASE-Node-Manager/HEAD/src/main/resources/swagger/favicon-16x16.png -------------------------------------------------------------------------------- /src/main/resources/swagger/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeBankBlockchain/WeBASE-Node-Manager/HEAD/src/main/resources/swagger/favicon-32x32.png -------------------------------------------------------------------------------- /sider.yml: -------------------------------------------------------------------------------- 1 | linter: 2 | pmd_java: 3 | dir: src 4 | encoding: Shift_JIS 5 | min_priority: 2 6 | checkstyle: 7 | dir: src 8 | ignore: 9 | - warning 10 | - info -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/precompiled/entity/PrecompiledResult.java: -------------------------------------------------------------------------------- 1 | package com.webank.webase.node.mgr.precompiled.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class PrecompiledResult { 7 | private Integer code; 8 | private String msg; 9 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/entity/RspContractPath.java: -------------------------------------------------------------------------------- 1 | package com.webank.webase.node.mgr.contract.entity; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * 7 | */ 8 | @Data 9 | public class RspContractPath { 10 | private Integer groupId; 11 | private String contractPath; 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/transaction/entity/ReqSignMessage.java: -------------------------------------------------------------------------------- 1 | package com.webank.webase.node.mgr.transaction.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ReqSignMessage { 7 | 8 | private String user; 9 | private String hash; 10 | 11 | private String signUserId; 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/event/entity/RspContractInfo.java: -------------------------------------------------------------------------------- 1 | package com.webank.webase.node.mgr.event.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class RspContractInfo { 9 | private String type; 10 | private String contractAddress; 11 | private String contractName; 12 | } -------------------------------------------------------------------------------- /src/main/resources/templates/node/front-application-yml.tpl: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:h2:file:/data/h2/webasefront;DB_CLOSE_ON_EXIT=FALSE 4 | sdk: 5 | encryptType: [(${encryptType})] 6 | channelPort: [(${channelPort})] 7 | server: 8 | port: [(${frontPort})] 9 | constant: 10 | keyServer: [(${webaseSignAddr})] # webase-sign服务的IP:Port(单个) 11 | nodePath: /data 12 | monitorDisk: /data 13 | 14 | -------------------------------------------------------------------------------- /src/main/resources/templates/AlertEmailForTest.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Test: 测试邮件 6 | 7 | 8 | 这是来自WeBASE-Node-Manager的告警测试邮件,请勿回复。 9 |
10 | This is mail alert from WeBASE-Node-Manager, PLEASE DO NOT REPLY.
11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/resources/templates/AlertEmailTemplate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | WeBASE-Node-Manager Alert Mail(邮件告警) 6 | 7 | 8 | WeBASE-Node-Manager邮件告警(Alert Mail):
9 |
10 |
11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/configapi/entity/ServerInfo.java: -------------------------------------------------------------------------------- 1 | package com.webank.webase.node.mgr.configapi.entity; 2 | 3 | import lombok.Data; 4 | import lombok.NoArgsConstructor; 5 | 6 | @Data 7 | @NoArgsConstructor 8 | public class ServerInfo { 9 | private String ip; 10 | private Integer port; 11 | 12 | public ServerInfo(String ip, Integer port) { 13 | this.ip = ip; 14 | this.port = port; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/cert/entity/SdkCertInfo.java: -------------------------------------------------------------------------------- 1 | package com.webank.webase.node.mgr.cert.entity; 2 | 3 | import lombok.Data; 4 | import lombok.NoArgsConstructor; 5 | 6 | @Data 7 | @NoArgsConstructor 8 | public class SdkCertInfo { 9 | private String name; 10 | private String content; 11 | 12 | public SdkCertInfo(String name, String content) { 13 | this.name = name; 14 | this.content = content; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/precompiled/entity/AddressStatusHandle.java: -------------------------------------------------------------------------------- 1 | package com.webank.webase.node.mgr.precompiled.entity; 2 | 3 | import java.util.List; 4 | import javax.validation.constraints.NotNull; 5 | import lombok.Data; 6 | 7 | @Data 8 | public class AddressStatusHandle { 9 | @NotNull 10 | private Integer groupId; 11 | /** 12 | * account address or contract address 13 | */ 14 | @NotNull 15 | private List addressList; 16 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/event/entity/ReqEventLogList.java: -------------------------------------------------------------------------------- 1 | package com.webank.webase.node.mgr.event.entity; 2 | 3 | import java.util.List; 4 | import lombok.Data; 5 | 6 | /** 7 | * sync get event logs of exactly block 8 | */ 9 | @Data 10 | public class ReqEventLogList { 11 | private Integer groupId; 12 | private List contractAbi; 13 | private Integer fromBlock; 14 | private Integer toBlock; 15 | private String contractAddress; 16 | private EventTopicParam topics; 17 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/user/entity/ReqImportPem.java: -------------------------------------------------------------------------------- 1 | package com.webank.webase.node.mgr.user.entity; 2 | 3 | import lombok.Data; 4 | import lombok.EqualsAndHashCode; 5 | import lombok.NoArgsConstructor; 6 | import lombok.ToString; 7 | 8 | import javax.validation.constraints.NotBlank; 9 | 10 | /** 11 | * import pem private key 12 | */ 13 | @Data 14 | @NoArgsConstructor 15 | @ToString(callSuper = true) 16 | @EqualsAndHashCode(callSuper = true) 17 | public class ReqImportPem extends NewUserInputParam { 18 | @NotBlank 19 | private String pemContent; 20 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | #!gradle/wrapper/gradle-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | /out/ 20 | 21 | ### NetBeans ### 22 | /nbproject/private/ 23 | /nbbuild/ 24 | /dist/ 25 | /log/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | /NODES_ROOT/* 29 | /NODES_ROOT_TMP/* 30 | *.srl 31 | gmcert.cnf 32 | gmsm2.param 33 | /output/ 34 | generatorConfig.xml 35 | mbg.properties 36 | GenerateToolTest.java 37 | -------------------------------------------------------------------------------- /script/deploy/update_shell.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | curl -s https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/v2.7.0/tools/build_chain.sh > build_chain.sh 4 | curl -s https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/v2.7.0/tools/gen_agency_cert.sh > gen_agency_cert.sh 5 | curl -s https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/v2.7.0/tools/gen_node_cert.sh > gen_node_cert.sh 6 | 7 | # delete pwd 8 | row=$(grep -i -n output_dir build_chain.sh |grep -i "pwd"| awk -F ":" '{print $1}') 9 | regex="$row"'s#$(pwd)/##g' 10 | sed -i -e ${regex} build_chain.sh 11 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/precompiled/entity/ChainGovernanceHandle.java: -------------------------------------------------------------------------------- 1 | package com.webank.webase.node.mgr.precompiled.entity; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | import javax.validation.constraints.NotNull; 5 | import lombok.Data; 6 | 7 | @Data 8 | public class ChainGovernanceHandle { 9 | @NotNull 10 | private Integer groupId; 11 | @NotBlank 12 | private String fromAddress; 13 | private String address; 14 | private Integer weight; 15 | private Integer threshold; 16 | // use to replace fromAddress when request front 17 | private String signUserId; 18 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/precompiled/entity/ContractStatusHandle.java: -------------------------------------------------------------------------------- 1 | package com.webank.webase.node.mgr.precompiled.entity; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class ContractStatusHandle { 8 | private int groupId; 9 | @NotBlank 10 | private String contractAddress; 11 | // 4 types: freeze, unfreeze, getStatus 12 | // deprecated: grantManager, listManager 13 | private String handleType; 14 | @NotBlank 15 | private String fromAddress; 16 | private String signUserId; 17 | private String grantAddress; 18 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/warehouse/WarehouseStartupRunner.java: -------------------------------------------------------------------------------- 1 | package com.webank.webase.node.mgr.contract.warehouse; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.boot.CommandLineRunner; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Component 8 | public class WarehouseStartupRunner implements CommandLineRunner { 9 | 10 | @Autowired 11 | PresetDataService presetDataService; 12 | 13 | @Override 14 | public void run(String... args) throws Exception { 15 | presetDataService.initPresetData(); 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | branches: 4 | only: 5 | - master 6 | - dev 7 | 8 | language: java 9 | 10 | matrix: 11 | # fast_finish: true 12 | include: 13 | - language: java 14 | jdk: openjdk8 15 | os: linux 16 | dist: xenial 17 | sudo: required 18 | 19 | 20 | before_cache: 21 | - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock 22 | - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ 23 | cache: 24 | directories: 25 | - $HOME/.gradle/caches/ 26 | - $HOME/.gradle/wrapper/ 27 | before_install: 28 | - gradle wrapper 29 | 30 | install: skip 31 | 32 | script: 33 | - chmod +x ./gradlew 34 | - ./gradlew build -x test 35 | -------------------------------------------------------------------------------- /src/test/java/node/mgr/test/token/TokenTest.java: -------------------------------------------------------------------------------- 1 | package node.mgr.test.token; 2 | 3 | import com.webank.webase.node.mgr.account.token.TokenService; 4 | import node.mgr.test.base.TestBase; 5 | import org.junit.Test; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | 8 | public class TokenTest extends TestBase { 9 | @Autowired 10 | private TokenService tokenService; 11 | 12 | 13 | @Test 14 | public void createToken() { 15 | String transHash = tokenService.createToken("111",1); 16 | System.out.println(transHash); 17 | String transHash1 = tokenService.createToken("111",1); 18 | System.out.println(transHash1); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /script/webase.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | 4 | echo -e "\n init start...." 5 | 6 | IP=${1} 7 | PORT=${2} 8 | 9 | if [[ ! $IP || ! $PORT ]] ; then 10 | echo "Usage: sh ${0} ip port" 11 | echo "eg: sh ${0} 127.0.0.1 8501" 12 | exit 1 13 | fi 14 | 15 | #dbUser 16 | DBUSER="defaultAccount" 17 | #dbPass 18 | PASSWD="defaultPassword" 19 | #dbName 20 | DBNAME="webasenodemanager" 21 | 22 | 23 | #connect to database then execute init 24 | cat webase-sql.list | mysql --user=$DBUSER --password=$PASSWD --host=$IP --database=$DBNAME --port=$PORT --default-character-set=utf8; 25 | 26 | if [ "$?" == "0" ]; then 27 | echo -e "init success... \n" 28 | else 29 | echo -e "init fail... \n" 30 | fi 31 | 32 | exit 33 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/event/entity/EventTopicParam.java: -------------------------------------------------------------------------------- 1 | package com.webank.webase.node.mgr.event.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @AllArgsConstructor 9 | @NoArgsConstructor 10 | public class EventTopicParam { 11 | 12 | private String eventName; 13 | private IndexedParamType indexed1; 14 | private IndexedParamType indexed2; 15 | private IndexedParamType indexed3; 16 | 17 | @Data 18 | @AllArgsConstructor 19 | @NoArgsConstructor 20 | public static class IndexedParamType { 21 | private String type; 22 | // indexed value 23 | private String value; 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/entity/ReqCopyContracts.java: -------------------------------------------------------------------------------- 1 | package com.webank.webase.node.mgr.contract.entity; 2 | 3 | import java.util.List; 4 | import javax.validation.constraints.NotNull; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | /** 10 | * @author marsli 11 | */ 12 | @Data 13 | @NoArgsConstructor 14 | public class ReqCopyContracts { 15 | private String account; 16 | @NotNull 17 | private Integer groupId; 18 | private String contractPath; 19 | private List contractItems; 20 | 21 | @Data 22 | @NoArgsConstructor 23 | @AllArgsConstructor 24 | public static class RepCopyContractItem { 25 | private String contractName; 26 | private String contractSource; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/entity/ReqAddAddress.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.contract.entity; 17 | 18 | public class ReqAddAddress { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/resources/templates/node/node-group-genesis.tpl: -------------------------------------------------------------------------------- 1 | [consensus] 2 | ; consensus algorithm now support PBFT(consensus_type=pbft), Raft(consensus_type=raft) 3 | ; and rpbft(consensus_type=rpbft) 4 | consensus_type=pbft 5 | ; the max number of transactions of a block 6 | max_trans_num=1000 7 | ; rpbft related configuration 8 | ; the sealers num of each consensus epoch 9 | epoch_sealer_num=[(${sealerCount})] 10 | ; the number of generated blocks each epoch 11 | epoch_block_num=1000 12 | ; the node id of consensusers 13 | [# th:each="nodeId,iter : ${nodeIdList}"]node.[(${iter.index})]=[(${nodeId})] 14 | [/] 15 | 16 | [state] 17 | type=storage 18 | [tx] 19 | ; transaction gas limit 20 | gas_limit=300000000 21 | [group] 22 | id=[(${groupId})] 23 | timestamp=[(${timestamp})] 24 | [evm] 25 | enable_free_storage=false 26 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/deploy/entity/ReqCheckHost.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.deploy.entity; 16 | 17 | import java.util.List; 18 | import lombok.Data; 19 | 20 | @Data 21 | public class ReqCheckHost { 22 | List hostIdList; 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/front/frontinterface/entity/GroupHandleResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.front.frontinterface.entity; 15 | 16 | import lombok.Data; 17 | 18 | @Data 19 | public class GroupHandleResult { 20 | private String code; 21 | private String message; 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/node/entity/Node.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.node.entity; 17 | 18 | import lombok.Data; 19 | 20 | /** 21 | * receive node info entity. 22 | */ 23 | @Data 24 | public class Node { 25 | private String nodeId; 26 | private String nodeType; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/account/entity/ImageToken.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.account.entity; 15 | 16 | import lombok.Data; 17 | 18 | /** 19 | * image token of verify code 20 | */ 21 | @Data 22 | public class ImageToken { 23 | 24 | private String base64Image; 25 | private String token; 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/annotation/entity/CurrentAccountInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.base.annotation.entity; 15 | 16 | import lombok.Data; 17 | 18 | /** 19 | * Entity class of account info. 20 | */ 21 | @Data 22 | public class CurrentAccountInfo { 23 | String account; 24 | Integer roleId; 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/front/entity/NodeHeartBeat.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.front.entity; 17 | 18 | import java.math.BigInteger; 19 | import lombok.Data; 20 | 21 | @Data 22 | public class NodeHeartBeat { 23 | private BigInteger blockNumber; 24 | private BigInteger pbftView; 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/monitor/entity/PageTransInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.monitor.entity; 17 | 18 | import java.time.LocalDateTime; 19 | import lombok.Data; 20 | 21 | @Data 22 | public class PageTransInfo { 23 | 24 | private int transCount; 25 | private LocalDateTime time; 26 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/front/entity/TotalTransCountInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.front.entity; 17 | 18 | import java.math.BigInteger; 19 | import lombok.Data; 20 | 21 | @Data 22 | public class TotalTransCountInfo { 23 | private BigInteger txSum; 24 | private BigInteger blockNumber; 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/account/entity/LoginInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.account.entity; 17 | 18 | import lombok.Data; 19 | 20 | /** 21 | * login param from web request 22 | */ 23 | @Data 24 | public class LoginInfo { 25 | 26 | private String account; 27 | private String accountPwd; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/front/frontinterface/entity/FailInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.front.frontinterface.entity; 15 | 16 | import java.time.Instant; 17 | import lombok.Data; 18 | 19 | @Data 20 | public class FailInfo { 21 | 22 | private Instant latestTime; 23 | private int failCount; 24 | private String failUrl; 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/precompiled/entity/PermissionState.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.precompiled.entity; 17 | 18 | import lombok.Data; 19 | 20 | @Data 21 | public class PermissionState { 22 | private int deployAndCreate; 23 | private int cns; 24 | private int sysConfig; 25 | private int node; 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/appintegration/entity/BasicInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.appintegration.entity; 15 | 16 | import lombok.Data; 17 | 18 | @Data 19 | public class BasicInfo { 20 | private Integer encryptType; 21 | private Integer sslCryptoType; 22 | private String fiscoBcosVersion; 23 | private String webaseVersion; 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/monitor/entity/UserMonitorResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.monitor.entity; 15 | 16 | import lombok.Data; 17 | 18 | /** 19 | * user monitor result info. 20 | */ 21 | @Data 22 | public class UserMonitorResult implements Cloneable { 23 | 24 | private String userName; 25 | private Integer userType; 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/HasPk.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.base.enums; 17 | 18 | public enum HasPk { 19 | HAS(1), NONE(2); 20 | 21 | private int value; 22 | 23 | private HasPk(Integer value) { 24 | this.value = value; 25 | } 26 | 27 | public int getValue() { 28 | return this.value; 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/cert/entity/CertHandle.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.cert.entity; 17 | 18 | import lombok.Data; 19 | 20 | import javax.validation.constraints.NotBlank; 21 | 22 | /** 23 | * param for web request 24 | */ 25 | @Data 26 | public class CertHandle { 27 | private String content; 28 | private String fingerPrint; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/account/token/TbToken.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.account.token; 17 | 18 | import lombok.Data; 19 | 20 | import java.time.LocalDateTime; 21 | 22 | @Data 23 | public class TbToken { 24 | private String token; 25 | private String value; 26 | private LocalDateTime expireTime; 27 | private LocalDateTime createTime; 28 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/AppType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.base.enums; 17 | 18 | public enum AppType { 19 | TEMPLATE(1), NEW(2); 20 | 21 | private int value; 22 | 23 | private AppType(Integer type) { 24 | this.value = type; 25 | } 26 | 27 | public int getValue() { 28 | return this.value; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/front/frontinterface/entity/FrontUrlInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.front.frontinterface.entity; 18 | 19 | import lombok.Data; 20 | 21 | /** 22 | * vo of front's frontId and built url to request front 23 | */ 24 | @Data 25 | public class FrontUrlInfo { 26 | private Integer frontId; 27 | private String url; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/node/entity/ReqUpdate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2020 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.node.entity; 16 | 17 | import javax.validation.constraints.NotBlank; 18 | import lombok.Data; 19 | 20 | @Data 21 | public class ReqUpdate { 22 | @NotBlank 23 | private String nodeId; 24 | private String nodeIp; 25 | private String city; 26 | private String agency; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/monitor/entity/UnusualUserInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.monitor.entity; 17 | 18 | import java.time.LocalDateTime; 19 | import lombok.Data; 20 | 21 | @Data 22 | public class UnusualUserInfo { 23 | 24 | private String userName; 25 | private int transCount; 26 | private String hashs; 27 | private LocalDateTime time; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/entity/RspSystemProxy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.contract.entity; 17 | 18 | import lombok.Data; 19 | 20 | /** 21 | * deploy interface parameter. 22 | */ 23 | @Data 24 | public class RspSystemProxy { 25 | private String name; 26 | private String address; 27 | private String cache; 28 | private Integer blockNumber; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/EnableStatus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.base.enums; 17 | 18 | public enum EnableStatus { 19 | ON(1), OFF(0); 20 | 21 | private int value; 22 | 23 | private EnableStatus(Integer onOrOff) { 24 | this.value = onOrOff; 25 | } 26 | 27 | public int getValue() { 28 | return this.value; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/AlertLevelType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.base.enums; 17 | 18 | public enum AlertLevelType { 19 | HIGH(1), MIDDLE(2), LOW(3); 20 | 21 | private int value; 22 | 23 | AlertLevelType(Integer type) { 24 | this.value = type; 25 | } 26 | 27 | public int getValue() { 28 | return this.value; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/node/entity/RspCity.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2020 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.node.entity; 16 | 17 | import lombok.Data; 18 | 19 | /** 20 | * response for city in china map 21 | */ 22 | @Data 23 | public class RspCity { 24 | 25 | /** 26 | * city id 27 | */ 28 | private String city; 29 | /** 30 | * node count 31 | */ 32 | private Integer count; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/transdaily/SeventDaysTrans.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.transdaily; 17 | 18 | import java.time.LocalDate; 19 | import lombok.Data; 20 | 21 | /** 22 | * Entity class of Trading within seven days. 23 | */ 24 | @Data 25 | public class SeventDaysTrans { 26 | 27 | private LocalDate day; 28 | private int groupId; 29 | private int transCount; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/deploy/entity/ReqAddHost.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.deploy.entity; 16 | 17 | import javax.validation.constraints.NotBlank; 18 | import lombok.Data; 19 | 20 | @Data 21 | public class ReqAddHost { 22 | @NotBlank 23 | private String sshIp; 24 | /** 25 | * host's default directory 26 | */ 27 | @NotBlank 28 | private String rootDir; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/precompiled/entity/CrudHandle.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.precompiled.entity; 17 | 18 | import javax.validation.constraints.NotBlank; 19 | import lombok.Data; 20 | 21 | 22 | @Data 23 | public class CrudHandle { 24 | private int groupId; 25 | @NotBlank 26 | private String fromAddress; 27 | private String signUserId; 28 | private String sql; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/block/entity/MinMaxBlock.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.block.entity; 17 | 18 | import java.math.BigInteger; 19 | import lombok.Data; 20 | 21 | /** 22 | * result of min max block number. 23 | */ 24 | @Data 25 | public class MinMaxBlock { 26 | 27 | private Integer groupId; 28 | private BigInteger maxBlockNumber; 29 | private BigInteger minBLockNumber; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/entity/ReqListContract.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.contract.entity; 16 | 17 | import java.util.List; 18 | import lombok.Data; 19 | 20 | @Data 21 | public class ReqListContract { 22 | private Integer groupId; 23 | private String account; 24 | /** 25 | * list contract by multi path 26 | */ 27 | private List contractPathList; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/account/entity/PasswordInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.account.entity; 17 | 18 | import javax.validation.constraints.NotBlank; 19 | import lombok.Data; 20 | 21 | /** 22 | * entity to update password. 23 | */ 24 | @Data 25 | public class PasswordInfo { 26 | @NotBlank 27 | private String oldAccountPwd; 28 | @NotBlank 29 | private String newAccountPwd; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/AlertRuleType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.base.enums; 18 | 19 | public enum AlertRuleType { 20 | NODE_ALERT(1), AUDIT_ALERT(2), CERT_ALERT(3); 21 | 22 | private int value; 23 | 24 | AlertRuleType(Integer type) { 25 | this.value = type; 26 | } 27 | 28 | public int getValue() { 29 | return this.value; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/ContractType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.base.enums; 17 | 18 | public enum ContractType { 19 | GENERALCONTRACT(0), SYSTEMCONTRACT(1), APPIMPORT(2); 20 | 21 | private int value; 22 | 23 | private ContractType(Integer type) { 24 | this.value = type; 25 | } 26 | 27 | public int getValue() { 28 | return this.value; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/RoleType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.base.enums; 17 | 18 | public enum RoleType { 19 | ADMIN(100000), VISITOR(100001), DEVELOPER(100002); 20 | 21 | private Integer value; 22 | 23 | private RoleType(Integer value) { 24 | this.value = value; 25 | } 26 | 27 | public Integer getValue() { 28 | return this.value; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/precompiled/entity/SysConfigParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.precompiled.entity; 17 | 18 | import lombok.Data; 19 | 20 | @Data 21 | public class SysConfigParam { 22 | 23 | // private Long id; 24 | private int groupId; 25 | private String fromAddress; 26 | private String signUserId; 27 | private String configKey; 28 | private String configValue; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/user/entity/KeyPair.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.user.entity; 17 | 18 | import lombok.Data; 19 | 20 | @Data 21 | public class KeyPair { 22 | 23 | private String privateKey; 24 | private String publicKey; 25 | private String address; 26 | /** 27 | * for pull user from front 28 | */ 29 | private String userName; 30 | private Integer userId; 31 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/OperateStatus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.base.enums; 18 | 19 | /** 20 | * result code of operate group 21 | */ 22 | public enum OperateStatus { 23 | SUCCESS(0), FAIL(1); 24 | 25 | private int value; 26 | 27 | OperateStatus(Integer result) { 28 | this.value = result; 29 | } 30 | 31 | public int getValue() { 32 | return this.value; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/UserType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.base.enums; 17 | 18 | /** 19 | * user type. 20 | */ 21 | public enum UserType { 22 | GENERALUSER(1), SYSTEMUSER(2); 23 | 24 | private int value; 25 | 26 | private UserType(Integer type) { 27 | this.value = type; 28 | } 29 | 30 | public int getValue() { 31 | return this.value; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/entity/QueryByBinParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.contract.entity; 17 | 18 | import javax.validation.constraints.NotBlank; 19 | import javax.validation.constraints.NotNull; 20 | import lombok.Data; 21 | 22 | @Data 23 | public class QueryByBinParam { 24 | @NotNull 25 | private Integer groupId; 26 | @NotBlank 27 | private String partOfBytecodeBin; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/method/entity/NewMethodInputParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.method.entity; 15 | 16 | 17 | import java.util.List; 18 | import javax.validation.constraints.NotNull; 19 | import lombok.Data; 20 | 21 | /** 22 | * entity of newMethod input. 23 | */ 24 | @Data 25 | public class NewMethodInputParam { 26 | @NotNull 27 | private Integer groupId; 28 | @NotNull 29 | List methodList; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/ScpTypeEnum.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.base.enums; 17 | 18 | import lombok.AllArgsConstructor; 19 | import lombok.Getter; 20 | import lombok.ToString; 21 | 22 | /** 23 | * 24 | */ 25 | 26 | @Getter 27 | @ToString 28 | @AllArgsConstructor 29 | public enum ScpTypeEnum { 30 | UP("up"), 31 | DOWNLOAD ( "down"), 32 | ; 33 | 34 | private String value; 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/monitor/entity/UnusualContractInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.monitor.entity; 17 | 18 | import java.time.LocalDateTime; 19 | import lombok.Data; 20 | 21 | @Data 22 | public class UnusualContractInfo { 23 | 24 | private String contractName; 25 | private String contractAddress; 26 | private int transCount; 27 | private String hashs; 28 | private LocalDateTime time; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/entity/ContractPathParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.contract.entity; 16 | 17 | import lombok.AllArgsConstructor; 18 | import lombok.Data; 19 | import lombok.NoArgsConstructor; 20 | 21 | @Data 22 | @NoArgsConstructor 23 | @AllArgsConstructor 24 | public class ContractPathParam { 25 | private Integer groupId; 26 | private String contractPath; 27 | private String account; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/RequestType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.base.enums; 16 | 17 | /** 18 | * HTTP request types 19 | */ 20 | public enum RequestType { 21 | GET(0), POST(1), PUT(2), DELETE(3); 22 | 23 | private int value; 24 | 25 | private RequestType(Integer type) { 26 | this.value = type; 27 | } 28 | 29 | public int getValue() { 30 | return this.value; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/deploy/entity/ReqUpgrade.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.deploy.entity; 16 | 17 | import javax.validation.constraints.NotBlank; 18 | import javax.validation.constraints.Positive; 19 | 20 | import lombok.Data; 21 | 22 | @Data 23 | public class ReqUpgrade { 24 | 25 | @Positive 26 | private int newTagId; 27 | 28 | 29 | @NotBlank 30 | String chainName = "default_chain"; 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/method/entity/Method.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.method.entity; 17 | 18 | import javax.validation.constraints.NotBlank; 19 | import lombok.Data; 20 | 21 | /** 22 | * method input entity. 23 | */ 24 | @Data 25 | public class Method { 26 | @NotBlank 27 | private String methodId; 28 | @NotBlank 29 | private String abiInfo; 30 | @NotBlank 31 | private String methodType; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/TransType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.base.enums; 15 | 16 | /** 17 | * type of transaction. 18 | * 19 | * 0:contract deploy, 1:function call 20 | */ 21 | public enum TransType { 22 | DEPLOY(0), CALL(1); 23 | 24 | private int value; 25 | 26 | TransType(Integer type) { 27 | this.value = type; 28 | } 29 | 30 | public int getValue() { 31 | return this.value; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/entity/ReqQueryCns.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.contract.entity; 17 | 18 | import javax.validation.constraints.NotBlank; 19 | import javax.validation.constraints.NotNull; 20 | import lombok.Data; 21 | 22 | /** 23 | * ReqQueryCns. 24 | */ 25 | @Data 26 | public class ReqQueryCns { 27 | @NotNull 28 | private Integer groupId; 29 | @NotBlank 30 | private String contractAddress; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/monitor/entity/ContractMonitorResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.monitor.entity; 15 | 16 | import lombok.Data; 17 | 18 | /** 19 | * contract monitor result info. 20 | */ 21 | @Data 22 | public class ContractMonitorResult { 23 | private String contractName; 24 | private String contractAddress; 25 | private String interfaceName; 26 | private Integer transType; 27 | private Integer transUnusualType; 28 | } 29 | -------------------------------------------------------------------------------- /docker/build/Dockerfile: -------------------------------------------------------------------------------- 1 | #FROM openjdk:8-jdk-alpine as prod 2 | FROM ubuntu:18.04 as prod 3 | 4 | #RUN apk --no-cache add bash curl wget 5 | RUN apt-get update \ 6 | && apt-get -y install openjdk-8-jre \ 7 | && apt-get -y install mysql-client \ 8 | && rm -rf /var/lib/apt/lists/* 9 | 10 | COPY script /dist/script 11 | COPY gradle /dist/gradle 12 | COPY lib /dist/lib 13 | COPY conf_template /dist/conf 14 | COPY apps /dist/apps 15 | 16 | WORKDIR /dist 17 | EXPOSE 5001 18 | 19 | ENV CLASSPATH "/dist/conf/:/dist/apps/*:/dist/lib/*" 20 | 21 | ENV JAVA_OPTS " -server -Dfile.encoding=UTF-8 -Xmx512m -Xms512m -Xmn256m -Xss512k -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/log/heap_error.log -XX:+UseG1GC -XX:MaxGCPauseMillis=200 " 22 | ENV APP_MAIN "com.webank.webase.node.mgr.Application" 23 | 24 | # start commond 25 | ENTRYPOINT java ${JAVA_OPTS} -Djdk.tls.namedGroups="secp256k1", -Duser.timezone="Asia/Shanghai" -Djava.security.egd=file:/dev/./urandom, -Djava.library.path=/dist/conf -cp ${CLASSPATH} ${APP_MAIN} 26 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/appintegration/entity/AppRegisterInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.appintegration.entity; 15 | 16 | import javax.validation.constraints.NotBlank; 17 | import javax.validation.constraints.NotNull; 18 | import lombok.Data; 19 | 20 | @Data 21 | public class AppRegisterInfo { 22 | @NotBlank 23 | private String appIp; 24 | @NotNull 25 | private Integer appPort; 26 | @NotBlank 27 | private String appLink; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/scaffold/entity/RspFile.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2020 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.contract.scaffold.entity; 16 | 17 | import lombok.AllArgsConstructor; 18 | import lombok.Data; 19 | import lombok.NoArgsConstructor; 20 | 21 | /** 22 | * @author marsli 23 | */ 24 | @Data 25 | @NoArgsConstructor 26 | @AllArgsConstructor 27 | public class RspFile { 28 | private String fileName; 29 | private String fileStreamBase64; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/ConsensusType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.base.enums; 16 | 17 | /** 18 | * 共识类型,用于判断front_group_map的类型 19 | * 优先使用共识类型,其次观察类型 20 | */ 21 | public enum ConsensusType { 22 | SEALER(1), OBSERVER(2); 23 | 24 | private int value; 25 | 26 | ConsensusType(int type) { 27 | this.value = type; 28 | } 29 | 30 | public int getValue() { 31 | return this.value; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/SqlSortType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.base.enums; 17 | 18 | /** 19 | * Enumeration of mysql sql sort type. 20 | */ 21 | public enum SqlSortType { 22 | DESC("DESC"), ASC("ASC"); 23 | 24 | private String value; 25 | 26 | private SqlSortType(String value) { 27 | this.value = value; 28 | } 29 | 30 | public String getValue() { 31 | return this.value; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/front/frontinterface/entity/PeerOfSyncStatus.java: -------------------------------------------------------------------------------- 1 | ///** 2 | // * Copyright 2014-2021 the original author or authors. 3 | // * 4 | // * Licensed under the Apache License, Version 2.0 (the "License"); 5 | // * you may not use this file except in compliance with the License. 6 | // * You may obtain a copy of the License at 7 | // * 8 | // * http://www.apache.org/licenses/LICENSE-2.0 9 | // * 10 | // * Unless required by applicable law or agreed to in writing, software 11 | // * distributed under the License is distributed on an "AS IS" BASIS, 12 | // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // * See the License for the specific language governing permissions and 14 | // * limitations under the License. 15 | // */ 16 | //package com.webank.webase.node.mgr.frontinterface.entity; 17 | // 18 | //import java.math.BigInteger; 19 | //import lombok.Data; 20 | // 21 | //@Data 22 | //public class PeerOfSyncStatus { 23 | // private BigInteger blockNumber; 24 | // private String genesisHash; 25 | // private String latestHash; 26 | // private String nodeId; 27 | //} 28 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/tools/pagetools/entity/MapHandle.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.tools.pagetools.entity; 17 | 18 | import lombok.Data; 19 | 20 | /** 21 | * data unit to handle map2PagedList tool 22 | */ 23 | @Data 24 | public class MapHandle{ 25 | private String key; 26 | private Object data; 27 | 28 | public MapHandle(String key, Object data) { 29 | this.key = key; 30 | this.data = data; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/MonitorUserType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.base.enums; 15 | 16 | /** 17 | * monitor result type of user. 18 | * 19 | * 0:normal, 1:abnormal. 20 | */ 21 | public enum MonitorUserType { 22 | NORMAL(0), ABNORMAL(1); 23 | 24 | private int value; 25 | 26 | MonitorUserType(Integer type) { 27 | this.value = type; 28 | } 29 | 30 | public int getValue() { 31 | return this.value; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/OptionType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.base.enums; 17 | 18 | import lombok.AllArgsConstructor; 19 | import lombok.Getter; 20 | import lombok.ToString; 21 | 22 | @Getter 23 | @ToString 24 | @AllArgsConstructor 25 | public enum OptionType { 26 | DEPLOY_CHAIN("Deploy chain."), 27 | MODIFY_CHAIN("Add nodes, delete node, upgrade chain."), 28 | ; 29 | 30 | private String description; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/front/entity/FrontInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.front.entity; 15 | 16 | import javax.validation.constraints.NotBlank; 17 | import javax.validation.constraints.NotNull; 18 | import lombok.Data; 19 | 20 | @Data 21 | public class FrontInfo { 22 | @NotBlank 23 | private String frontIp; 24 | @NotNull 25 | private Integer frontPort; 26 | /** 27 | * deprecated in v1.5.1 28 | */ 29 | private String agency; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/front/entity/FrontNodeConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.front.entity; 15 | 16 | import lombok.Data; 17 | 18 | @Data 19 | public class FrontNodeConfig { 20 | private String orgName; 21 | private String p2pip; 22 | private String listenip; 23 | private Integer rpcport; 24 | private Integer p2pport; 25 | private Integer channelPort; 26 | private String groupDataPath; 27 | private boolean enableStatistic; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/node/entity/NodeInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.node.entity; 17 | 18 | import lombok.Data; 19 | 20 | @Data 21 | public class NodeInfo { 22 | 23 | private String systemproxyaddress; 24 | private String p2pip; 25 | private String orgName; 26 | private String listenip; 27 | private Integer rpcport; 28 | private Integer p2pport; 29 | private Integer channelPort; 30 | private String datadir; 31 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/user/entity/UpdateUserInputParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.user.entity; 15 | 16 | import javax.validation.constraints.NotBlank; 17 | import javax.validation.constraints.NotNull; 18 | import lombok.Data; 19 | import lombok.NoArgsConstructor; 20 | 21 | @Data 22 | @NoArgsConstructor 23 | public class UpdateUserInputParam { 24 | 25 | @NotNull 26 | public Integer userId; 27 | @NotBlank 28 | public String description; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/DeployType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.base.enums; 16 | 17 | /** 18 | * related with constant-deployType in application.yml 19 | */ 20 | public enum DeployType { 21 | MANUAL(0), VISUAL_DEPLOY(1); 22 | 23 | private int value; 24 | 25 | private DeployType(Integer type) { 26 | this.value = type; 27 | } 28 | 29 | public int getValue() { 30 | return this.value; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 节点管理服务 2 | [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://webasedoc.readthedocs.io/zh_CN/latest/docs/WeBASE/CONTRIBUTING.html) 3 | [![CodeFactor](https://www.codefactor.io/repository/github/webankblockchain/webase-node-manager/badge)](https://www.codefactor.io/repository/github/webankblockchain/webase-node-manager) 4 | [![Code Lines](https://tokei.rs/b1/github/WeBankBlockchain/WeBASE-Node-Manager?category=code)](https://github.com/WeBankBlockchain/WeBASE-Node-Manager) 5 | [![license](http://img.shields.io/badge/license-Apache%20v2-blue.svg)](http://www.apache.org/licenses/) 6 | [![GitHub (pre-)release](https://img.shields.io/github/release/WeBankBlockchain/WeBASE-Node-Manager/all.svg)](https://github.com/WeBankBlockchain/WeBASE-Node-Manager/releases) 7 | 8 | ## 简介 9 | WeBASE-Node-Manager处理前端页面所有web请求,管理各个节点的状态,管理链上所有智能合约,对区块链的数据进行统计、分析,对异常交易的审计,私钥管理等。 详细介绍请查看[WeBASE-Node-Manager在线文档](https://webasedoc.readthedocs.io/zh_CN/latest/docs/WeBASE-Node-Manager/index.html) 10 | 11 | ## 贡献说明 12 | 请阅读我们的贡献文档,了解如何贡献代码,并提交你的贡献。 13 | 14 | 希望在您的参与下,WeBASE会越来越好! 15 | 16 | ## 社区 17 | 联系我们:webase@webank.com 18 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/appintegration/entity/UpdatePasswordInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.appintegration.entity; 15 | 16 | import javax.validation.constraints.NotBlank; 17 | import lombok.Data; 18 | 19 | /** 20 | * entity to update password. 21 | */ 22 | @Data 23 | public class UpdatePasswordInfo { 24 | @NotBlank 25 | private String account; 26 | @NotBlank 27 | private String oldAccountPwd; 28 | @NotBlank 29 | private String newAccountPwd; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/frontgroupmap/entity/FrontGroup.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.frontgroupmap.entity; 17 | 18 | import lombok.Data; 19 | 20 | @Data 21 | public class FrontGroup { 22 | private Integer mapId; 23 | private Integer groupId; 24 | private String groupName; 25 | private Integer frontId; 26 | private String frontIp; 27 | private Integer frontPort; 28 | private Integer status; 29 | private Integer type; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/group/entity/ReqUpdateDesc.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2020 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.group.entity; 16 | 17 | import javax.validation.constraints.NotNull; 18 | import lombok.AllArgsConstructor; 19 | import lombok.Data; 20 | import lombok.NoArgsConstructor; 21 | 22 | @Data 23 | @NoArgsConstructor 24 | @AllArgsConstructor 25 | public class ReqUpdateDesc { 26 | @NotNull 27 | private Integer groupId; 28 | @NotNull 29 | private String description; 30 | } 31 | -------------------------------------------------------------------------------- /script/deploy/check_container_exist.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | FOUND=0 4 | NOT_FOUND=1 5 | PARAM_ERROR=2 6 | 7 | containerName="" 8 | 9 | ####### 参数解析 ####### 10 | cmdname=$(basename "$0") 11 | 12 | # usage help doc. 13 | usage() { 14 | cat << USAGE >&2 15 | Usage: 16 | $cmdname [-c containerName] 17 | 18 | -c chainPath + nodeDir, ex: webasedefault_chainnode0 19 | USAGE 20 | exit ${PARAM_ERROR} 21 | } 22 | 23 | 24 | while getopts c:h OPT;do 25 | case ${OPT} in 26 | c) 27 | containerName="$OPTARG" 28 | ;; 29 | h) 30 | usage 31 | exit ${PARAM_ERROR} 32 | ;; 33 | \?) 34 | usage 35 | exit ${PARAM_ERROR} 36 | ;; 37 | esac 38 | done 39 | 40 | 41 | # use shell script for ansible not support | pipe to grep 42 | function grepContainer() { 43 | docker ps | grep "${containerName}" 44 | if [ $? -ne 0 ] ;then 45 | echo "grep ${containerName} not found" 46 | exit ${NOT_FOUND} 47 | else 48 | echo "Found ${containerName}" 49 | exit ${FOUND} 50 | fi 51 | } 52 | grepContainer 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/precompiled/entity/CnsParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.precompiled.entity; 17 | 18 | import lombok.Data; 19 | 20 | @Data 21 | public class CnsParam { 22 | 23 | private int groupId; 24 | private String fromAddress; 25 | private String signUserId; 26 | private String contractNameAndVersion; 27 | private String version; 28 | // register 29 | private String contractAddress; 30 | private String abi; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/precompiled/entity/PermissionParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.precompiled.entity; 17 | 18 | 19 | import lombok.Data; 20 | 21 | @Data 22 | public class PermissionParam { 23 | 24 | private int groupId; 25 | private String permissionType; 26 | private String fromAddress; 27 | private String signUserId; 28 | private String address; 29 | private String tableName; 30 | private PermissionState permissionState; 31 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/front/frontinterface/entity/RspStatBlock.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.front.frontinterface.entity; 16 | 17 | import java.math.BigInteger; 18 | import lombok.AllArgsConstructor; 19 | import lombok.Data; 20 | import lombok.NoArgsConstructor; 21 | 22 | @Data 23 | @AllArgsConstructor 24 | @NoArgsConstructor 25 | public class RspStatBlock { 26 | private BigInteger blockNumber; 27 | private Long timestamp; 28 | private int txCount; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/appintegration/entity/AppAddInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.appintegration.entity; 15 | 16 | import javax.validation.constraints.NotBlank; 17 | import lombok.Data; 18 | 19 | @Data 20 | public class AppAddInfo { 21 | private Integer id; 22 | @NotBlank 23 | private String appName; 24 | @NotBlank 25 | private String appDocLink; 26 | @NotBlank 27 | private String appDesc; 28 | private String appIcon; 29 | private String appDetail; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/group/entity/RspOperateResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.group.entity; 18 | 19 | import lombok.AllArgsConstructor; 20 | import lombok.Data; 21 | 22 | /** 23 | * entity of batch operate group 24 | * etc: batch start, batch generate, batch query group status 25 | */ 26 | @Data 27 | @AllArgsConstructor 28 | public class RspOperateResult { 29 | private Integer frontId; 30 | // 0-success, others-fail 31 | private Integer code; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/monitor/entity/ChainTransInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.monitor.entity; 17 | 18 | import java.math.BigInteger; 19 | import lombok.AllArgsConstructor; 20 | import lombok.Data; 21 | import lombok.NoArgsConstructor; 22 | 23 | @Data 24 | @NoArgsConstructor 25 | @AllArgsConstructor 26 | public class ChainTransInfo { 27 | private String from; 28 | private String to; 29 | private String input; 30 | private BigInteger blockNumber; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/group/entity/GroupGeneral.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.group.entity; 17 | 18 | import java.math.BigInteger; 19 | import lombok.Data; 20 | 21 | @Data 22 | public class GroupGeneral { 23 | 24 | private Integer groupId; 25 | private int orgCount; 26 | private int nodeCount; 27 | private int contractCount; 28 | private BigInteger transactionCount = BigInteger.ZERO; 29 | private BigInteger latestBlock = BigInteger.ZERO; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/account/role/RoleMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.account.role; 17 | 18 | import java.util.List; 19 | import org.apache.ibatis.annotations.Param; 20 | 21 | /** 22 | * mapper about tb_role. 23 | */ 24 | public interface RoleMapper { 25 | 26 | TbRole queryRoleById(@Param("roleId") Integer roleId); 27 | 28 | Integer countOfRole(@Param("param") RoleListParam param); 29 | 30 | List listOfRole(@Param("param") RoleListParam param); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/TransUnusualType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.base.enums; 15 | 16 | /** 17 | *unusual type of transaction. 18 | * 19 | * 0:normal, 1:abnormal contract, 2:abnormal function. 20 | */ 21 | public enum TransUnusualType { 22 | NORMAL(0), CONTRACT(1), FUNCTION(2); 23 | 24 | private int value; 25 | 26 | TransUnusualType(Integer type) { 27 | this.value = type; 28 | } 29 | 30 | public int getValue() { 31 | return this.value; 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/front/entity/FrontParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.front.entity; 15 | 16 | import lombok.AllArgsConstructor; 17 | import lombok.Data; 18 | import lombok.NoArgsConstructor; 19 | 20 | @Data 21 | @NoArgsConstructor 22 | @AllArgsConstructor 23 | public class FrontParam { 24 | private Integer frontId; 25 | private String nodeId; 26 | private Integer groupId; 27 | private String frontIp; 28 | private Integer frontPort; 29 | private Integer frontStatus; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/entity/QueryContractParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.contract.entity; 15 | 16 | import lombok.Data; 17 | 18 | @Data 19 | public class QueryContractParam { 20 | 21 | private Integer groupId; 22 | private String contractName; 23 | @Deprecated 24 | private String account; 25 | private String contractAddress; 26 | private Integer contractStatus; 27 | private Integer pageNumber; 28 | private Integer pageSize; 29 | private String contractPath; 30 | 31 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/account/entity/AccountInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.account.entity; 17 | 18 | import javax.validation.constraints.NotBlank; 19 | import javax.validation.constraints.NotNull; 20 | import lombok.Data; 21 | 22 | /** 23 | * param to add an Daccount 24 | */ 25 | @Data 26 | public class AccountInfo { 27 | @NotBlank 28 | private String account; 29 | private String accountPwd; 30 | @NotNull 31 | private Integer roleId; 32 | private String email; 33 | } 34 | -------------------------------------------------------------------------------- /src/test/java/node/mgr/test/base/TestBase.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package node.mgr.test.base; 18 | 19 | import com.webank.webase.node.mgr.Application; 20 | import org.junit.runner.RunWith; 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | import org.springframework.test.context.junit4.SpringRunner; 23 | import org.springframework.test.context.web.WebAppConfiguration; 24 | 25 | @RunWith(SpringRunner.class) 26 | @SpringBootTest(classes = Application.class) 27 | @WebAppConfiguration 28 | public class TestBase { 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/statistic/result/PerformanceData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.statistic.result; 17 | 18 | /** 19 | * Performance data handle(DTO) of monitor and performance module 20 | * performance response to web 21 | */ 22 | @lombok.Data 23 | public class PerformanceData { 24 | private String metricType; 25 | private Data data; 26 | 27 | public PerformanceData(String metricType, Data data) { 28 | this.metricType = metricType; 29 | this.data = data; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/node/mgr/test/group/GroupServiceTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package node.mgr.test.group; 18 | 19 | import com.webank.webase.node.mgr.group.GroupService; 20 | import node.mgr.test.base.TestBase; 21 | import org.junit.Test; 22 | import org.springframework.beans.factory.annotation.Autowired; 23 | 24 | public class GroupServiceTest extends TestBase { 25 | 26 | @Autowired 27 | private GroupService groupService; 28 | 29 | @Test 30 | public void testCheckGroupGenesisSame() { 31 | groupService.resetGroupList(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/TableName.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.base.enums; 17 | 18 | /** 19 | * table name. 20 | */ 21 | public enum TableName { 22 | BLOCK("tb_block_"),TRANS("tb_trans_hash_"),MONITOR("tb_user_transaction_monitor_"); 23 | String value; 24 | TableName(String value){ 25 | this.value = value; 26 | } 27 | 28 | public String getValue() { 29 | return value; 30 | } 31 | public String getTableName(int i){ 32 | return value+i; 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/account/role/TbRole.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.account.role; 17 | 18 | import java.time.LocalDateTime; 19 | import lombok.Data; 20 | 21 | /** 22 | * Entity class of table tb_role. 23 | */ 24 | @Data 25 | public class TbRole { 26 | 27 | private Integer roleId; 28 | private String roleName; 29 | private String roleNameZh; 30 | private Integer roleStatus; 31 | private String description; 32 | private LocalDateTime createTime; 33 | private LocalDateTime modifyTime; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/group/entity/ReqOperateGroup.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.group.entity; 18 | 19 | import lombok.AllArgsConstructor; 20 | import lombok.Data; 21 | import lombok.NoArgsConstructor; 22 | 23 | import javax.validation.constraints.NotBlank; 24 | import javax.validation.constraints.NotNull; 25 | 26 | @Data 27 | @NoArgsConstructor 28 | @AllArgsConstructor 29 | public class ReqOperateGroup { 30 | @NotNull 31 | private Integer generateGroupId; 32 | @NotBlank 33 | private String type; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/group/entity/StatisticalGroupTransInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.group.entity; 17 | 18 | import java.math.BigInteger; 19 | import java.time.LocalDate; 20 | import lombok.Data; 21 | 22 | /** 23 | * The latest statistics trans on all groups. 24 | */ 25 | @Data 26 | public class StatisticalGroupTransInfo { 27 | private Integer groupId; 28 | private LocalDate maxDay; 29 | private BigInteger blockNumber = BigInteger.ZERO; 30 | private BigInteger transCount = BigInteger.ZERO; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/node/entity/PeerInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.node.entity; 15 | 16 | import com.fasterxml.jackson.annotation.JsonProperty; 17 | import java.util.List; 18 | import lombok.Data; 19 | import lombok.NoArgsConstructor; 20 | 21 | @Data 22 | @NoArgsConstructor 23 | public class PeerInfo { 24 | 25 | private String IPAndPort; 26 | @JsonProperty("NodeID") 27 | private String nodeId; 28 | private List Topic; 29 | 30 | public PeerInfo(String nodeId) { 31 | this.nodeId = nodeId; 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/annotation/CurrentAccount.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.base.annotation; 15 | 16 | import java.lang.annotation.Documented; 17 | import java.lang.annotation.ElementType; 18 | import java.lang.annotation.Retention; 19 | import java.lang.annotation.RetentionPolicy; 20 | import java.lang.annotation.Target; 21 | 22 | /** 23 | * 在Controller的方法参数使用此注解,该方法在映射时会注入当前登录的Account对象 24 | */ 25 | @Target(ElementType.PARAMETER) 26 | @Retention(RetentionPolicy.RUNTIME) 27 | @Documented 28 | public @interface CurrentAccount { 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/method/MethodMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.method; 15 | 16 | 17 | import com.webank.webase.node.mgr.method.entity.TbMethod; 18 | import org.apache.ibatis.annotations.Param; 19 | import org.springframework.stereotype.Repository; 20 | 21 | @Repository 22 | public interface MethodMapper { 23 | 24 | void add(TbMethod tbMethod); 25 | 26 | void removeByGroupId(@Param("groupId") int groupId); 27 | 28 | TbMethod getMethodById(@Param("methodId") String methodId, @Param("groupId") Integer groupId); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/user/entity/ReqExport.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2020 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.user.entity; 16 | 17 | import javax.validation.constraints.NotBlank; 18 | import javax.validation.constraints.NotNull; 19 | import lombok.Data; 20 | import lombok.NoArgsConstructor; 21 | 22 | @Data 23 | @NoArgsConstructor 24 | public class ReqExport { 25 | @NotBlank 26 | private String signUserId; 27 | /** 28 | * password encoded in base64 29 | */ 30 | private String p12Password; 31 | @NotNull 32 | private Integer groupId; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/entity/ReqQueryCnsList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.contract.entity; 17 | 18 | import javax.validation.constraints.NotNull; 19 | import lombok.Data; 20 | 21 | /** 22 | * ReqQueryCns. 23 | */ 24 | @Data 25 | public class ReqQueryCnsList { 26 | @NotNull 27 | private Integer groupId; 28 | @NotNull 29 | private Integer pageNumber; 30 | @NotNull 31 | private Integer pageSize; 32 | private String contractAddress; 33 | private String cnsName; 34 | private String version; 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/front/frontinterface/entity/PeerOfConsensusStatus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.front.frontinterface.entity; 17 | 18 | import java.math.BigInteger; 19 | import lombok.AllArgsConstructor; 20 | import lombok.Data; 21 | import lombok.NoArgsConstructor; 22 | 23 | /** 24 | * store ConsensusStatus.ConsensusInfo, convert ViewInfo to BigInteger 25 | */ 26 | @Data 27 | @AllArgsConstructor 28 | @NoArgsConstructor 29 | public class PeerOfConsensusStatus { 30 | private String nodeId; 31 | private BigInteger view; 32 | } 33 | -------------------------------------------------------------------------------- /script/deploy/check_image_exist.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | FOUND=0 4 | NOT_FOUND=1 5 | PARAM_ERROR=2 6 | 7 | ## default one host, one node+front 8 | imageFullName="fiscoorg/fisco-webase:v2.7.0" 9 | 10 | ####### 参数解析 ####### 11 | cmdname=$(basename "$0") 12 | 13 | # usage help doc. 14 | usage() { 15 | cat << USAGE >&2 16 | Usage: 17 | $cmdname [-i imageName] 18 | 19 | -i ImageRepo + / + imageName + tagId, ex: fiscoorg/fisco-webase:v2.7.0 20 | USAGE 21 | exit ${PARAM_ERROR} 22 | } 23 | 24 | 25 | while getopts i:h OPT;do 26 | case ${OPT} in 27 | i) 28 | imageFullName="$OPTARG" 29 | ;; 30 | h) 31 | usage 32 | exit ${PARAM_ERROR} 33 | ;; 34 | \?) 35 | usage 36 | exit ${PARAM_ERROR} 37 | ;; 38 | esac 39 | done 40 | 41 | 42 | # use shell script for ansible not support | pipe to grep 43 | function grepImage() { 44 | docker images -a "${imageFullName}" | grep -v 'IMAGE ID' 45 | if [ $? -ne 0 ] ;then 46 | echo "grep ${imageFullName} not found" 47 | exit $NOT_FOUND 48 | else 49 | echo "Found ${imageFullName}" 50 | exit $FOUND 51 | fi 52 | } 53 | grepImage 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/cert/entity/FileContentHandle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.cert.entity; 17 | import lombok.Data; 18 | 19 | import java.io.InputStream; 20 | 21 | /** 22 | * handle contract file's content from zip file 23 | */ 24 | @Data 25 | public class FileContentHandle { 26 | private String fileName; 27 | private InputStream inputStream; 28 | 29 | public FileContentHandle(String fileName, InputStream inputStream) { 30 | this.fileName = fileName; 31 | this.inputStream = inputStream; 32 | } 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/front/frontinterface/entity/PostAbiInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.front.frontinterface.entity; 15 | 16 | import java.util.List; 17 | import lombok.Data; 18 | import org.fisco.bcos.sdk.abi.wrapper.ABIDefinition; 19 | 20 | 21 | /** 22 | * abiMeta interface parameter to request front's sendAbi api 23 | */ 24 | @Data 25 | public class PostAbiInfo { 26 | 27 | private Integer groupId; 28 | private String contractName; 29 | private String address; 30 | private List abiInfo; 31 | private String contractBin; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/method/entity/TbMethod.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.method.entity; 15 | 16 | import java.time.LocalDateTime; 17 | import lombok.Data; 18 | 19 | /** 20 | * Entity class of table tb_method. 21 | */ 22 | @Data 23 | public class TbMethod { 24 | private String methodId; 25 | private Integer groupId; 26 | private String abiInfo; 27 | private String methodType; 28 | // general contract and precompiled contract 29 | private Integer contractType; 30 | private LocalDateTime createTime; 31 | private LocalDateTime modifyTime; 32 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/precompiled/permission/governvote/entity/GovernParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.precompiled.permission.governvote.entity; 16 | 17 | import com.webank.webase.node.mgr.base.entity.BaseQueryParam; 18 | import lombok.Data; 19 | import lombok.EqualsAndHashCode; 20 | import lombok.NoArgsConstructor; 21 | import lombok.ToString; 22 | 23 | @Data 24 | @NoArgsConstructor 25 | @ToString(callSuper = true) 26 | @EqualsAndHashCode(callSuper = true) 27 | public class GovernParam extends BaseQueryParam { 28 | private Integer groupId; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/entity/BaseQueryParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.base.entity; 17 | 18 | import lombok.AllArgsConstructor; 19 | import lombok.Data; 20 | import lombok.NoArgsConstructor; 21 | 22 | @Data 23 | @NoArgsConstructor 24 | @AllArgsConstructor 25 | public class BaseQueryParam { 26 | private Integer start; 27 | private Integer pageSize; 28 | private String flagSortedByTime; 29 | public BaseQueryParam(Integer start,Integer pageSize){ 30 | this.start = start; 31 | this.pageSize = pageSize; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /status.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | APP_MAIN=com.webank.webase.node.mgr.Application 4 | CURRENT_DIR=$(pwd)/ 5 | CONF_DIR=${CURRENT_DIR}conf 6 | 7 | SERVER_PORT=$(cat $CONF_DIR/application.yml| grep "port" | awk '{print $2}'| sed 's/\r//') 8 | if [ ${SERVER_PORT}"" = "" ];then 9 | echo "$CONF_DIR/application.yml server port has not been configured" 10 | exit -1 11 | fi 12 | 13 | processPid=0 14 | checkProcess(){ 15 | server_pid=$(ps aux | grep java | grep $CURRENT_DIR | grep $APP_MAIN | awk '{print $2}') 16 | if [ -n "$server_pid" ]; then 17 | processPid=$server_pid 18 | else 19 | processPid=0 20 | fi 21 | } 22 | 23 | status(){ 24 | checkProcess 25 | echo "===============================================================================================" 26 | if [ $processPid -ne 0 ]; then 27 | echo "Server $APP_MAIN Port $SERVER_PORT is running PID($processPid)" 28 | echo "===============================================================================================" 29 | else 30 | echo "Server $APP_MAIN Port $SERVER_PORT is not running" 31 | echo "===============================================================================================" 32 | fi 33 | } 34 | 35 | status 36 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/entity/TbContractPath.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.contract.entity; 16 | 17 | import java.time.LocalDateTime; 18 | import lombok.Data; 19 | import lombok.NoArgsConstructor; 20 | 21 | /** 22 | * Entity class of table tb_contract_path. 23 | */ 24 | @Data 25 | @NoArgsConstructor 26 | public class TbContractPath { 27 | private Integer id; 28 | private Integer groupId; 29 | private String contractPath; 30 | private String account; 31 | private LocalDateTime createTime; 32 | private LocalDateTime modifyTime; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/ContractStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.base.enums; 17 | 18 | /** 19 | * Enumeration of contract status in node manager 20 | * different from contract address's status to freeze in precompiled 21 | */ 22 | public enum ContractStatus { 23 | 24 | NOTDEPLOYED(1), DEPLOYED(2), DEPLOYMENTFAILED(3); 25 | 26 | private int value; 27 | 28 | private ContractStatus(Integer dataStatus) { 29 | this.value = dataStatus; 30 | } 31 | 32 | public int getValue() { 33 | return this.value; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/precompiled/entity/ConsensusHandle.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.precompiled.entity; 17 | 18 | import javax.validation.constraints.NotBlank; 19 | import javax.validation.constraints.NotNull; 20 | import lombok.Data; 21 | 22 | 23 | @Data 24 | public class ConsensusHandle { 25 | private int groupId; 26 | /** 27 | * sealer, observer, remove 28 | */ 29 | private String nodeType; 30 | @NotBlank 31 | private String fromAddress; 32 | private String signUserId; 33 | @NotBlank 34 | private String nodeId; 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/alert/log/entity/ReqLogParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.alert.log.entity; 18 | 19 | import lombok.Data; 20 | import lombok.NoArgsConstructor; 21 | 22 | /** 23 | * handle PUT request from web to update log's status 24 | */ 25 | @Data 26 | @NoArgsConstructor 27 | public class ReqLogParam { 28 | private Integer logId; 29 | private Integer alertType; 30 | private Integer alertLevel; 31 | private String alertContent; 32 | private String description; 33 | /** 34 | * 0-未处理,1-已处理 35 | */ 36 | private Integer status; 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/group/entity/ReqBatchStartGroup.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.group.entity; 18 | 19 | import java.util.List; 20 | import javax.validation.constraints.NotEmpty; 21 | import javax.validation.constraints.NotNull; 22 | import lombok.AllArgsConstructor; 23 | import lombok.Data; 24 | import lombok.NoArgsConstructor; 25 | 26 | /** 27 | * @author marsli 28 | */ 29 | @Data 30 | @NoArgsConstructor 31 | @AllArgsConstructor 32 | public class ReqBatchStartGroup { 33 | @NotNull 34 | private Integer generateGroupId; 35 | @NotEmpty 36 | private List nodeList; 37 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/front/frontinterface/entity/SyncStatus.java: -------------------------------------------------------------------------------- 1 | ///** 2 | // * Copyright 2014-2021 the original author or authors. 3 | // * 4 | // * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | // * in compliance with the License. You may obtain a copy of the License at 6 | // * 7 | // * http://www.apache.org/licenses/LICENSE-2.0 8 | // * 9 | // * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | // * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | // * or implied. See the License for the specific language governing permissions and limitations under 12 | // * the License. 13 | // */ 14 | //package com.webank.webase.node.mgr.frontinterface.entity; 15 | // 16 | //import java.math.BigInteger; 17 | //import java.util.List; 18 | //import lombok.Data; 19 | // 20 | //@Data 21 | //public class SyncStatus { 22 | // 23 | // private BigInteger blockNumber; 24 | // private String genesisHash; 25 | // private Boolean isSyncing; 26 | // private String latestHash; 27 | // private String nodeId; 28 | // private Integer protocolId; 29 | // private String txPoolSize; 30 | // private List peers; 31 | //} -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/precompiled/entity/RspCommitteeInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.precompiled.entity; 16 | 17 | import java.math.BigDecimal; 18 | import lombok.Data; 19 | import lombok.EqualsAndHashCode; 20 | import lombok.NoArgsConstructor; 21 | import lombok.ToString; 22 | import org.fisco.bcos.sdk.contract.precompiled.permission.PermissionInfo; 23 | 24 | @Data 25 | @NoArgsConstructor 26 | @ToString(callSuper = true) 27 | @EqualsAndHashCode(callSuper = true) 28 | public class RspCommitteeInfo extends PermissionInfo { 29 | private Integer weight; 30 | private BigDecimal weightRate; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/appintegration/entity/AppInfoParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.appintegration.entity; 17 | 18 | import com.webank.webase.node.mgr.base.entity.BaseQueryParam; 19 | import lombok.Data; 20 | import lombok.EqualsAndHashCode; 21 | import lombok.NoArgsConstructor; 22 | import lombok.ToString; 23 | 24 | @Data 25 | @NoArgsConstructor 26 | @ToString(callSuper = true) 27 | @EqualsAndHashCode(callSuper = true) 28 | public class AppInfoParam extends BaseQueryParam { 29 | private Integer id; 30 | private Integer appType; 31 | private String appName; 32 | private String appKey; 33 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/ExternalInfoType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2020 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.base.enums; 16 | 17 | public enum ExternalInfoType { 18 | /** 19 | * return all external data 20 | */ 21 | ALL(1), 22 | /** 23 | * return normal data(user/contract in webase) 24 | */ 25 | NORMAL(2), 26 | /** 27 | * return data not in webase 28 | */ 29 | ABNORMAL(3); 30 | 31 | private int value; 32 | 33 | ExternalInfoType(Integer value) { 34 | this.value = value; 35 | } 36 | 37 | public int getValue() { 38 | return this.value; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/exception/ParamException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.base.exception; 17 | 18 | 19 | import com.webank.webase.node.mgr.base.code.RetCode; 20 | 21 | /** 22 | * param Exception 23 | */ 24 | public class ParamException extends RuntimeException { 25 | 26 | private static final long serialVersionUID = 1L; 27 | private RetCode retCode; 28 | 29 | 30 | public ParamException(int code, String msg) { 31 | super(msg); 32 | this.retCode = new RetCode(code, msg); 33 | } 34 | 35 | public RetCode getRetCode() { 36 | return retCode; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/appintegration/contractstore/entity/ContractSource.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.appintegration.contractstore.entity; 15 | 16 | import javax.validation.constraints.NotBlank; 17 | import lombok.Data; 18 | import org.hibernate.validator.constraints.Length; 19 | 20 | /** 21 | * param to save contract source 22 | */ 23 | @Data 24 | public class ContractSource { 25 | @NotBlank 26 | @Length(max=120) 27 | private String contractName; 28 | @NotBlank 29 | private String contractSource; 30 | @NotBlank 31 | private String contractAbi; 32 | @NotBlank 33 | private String bytecodeBin; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/abi/entity/RspAllContract.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.contract.abi.entity; 16 | 17 | import com.webank.webase.node.mgr.contract.entity.TbContract; 18 | import lombok.AllArgsConstructor; 19 | import lombok.Data; 20 | import lombok.EqualsAndHashCode; 21 | import lombok.NoArgsConstructor; 22 | import lombok.ToString; 23 | 24 | /** 25 | * entity to save tb_abi left join tb_contract 26 | */ 27 | @Data 28 | @NoArgsConstructor 29 | @ToString(callSuper = true) 30 | @EqualsAndHashCode(callSuper = true) 31 | public class RspAllContract extends TbContract { 32 | private Integer abiId; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/node/entity/NodeParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.node.entity; 17 | 18 | import com.webank.webase.node.mgr.base.entity.BaseQueryParam; 19 | import lombok.Data; 20 | import lombok.EqualsAndHashCode; 21 | import lombok.NoArgsConstructor; 22 | import lombok.ToString; 23 | 24 | @Data 25 | @NoArgsConstructor 26 | @ToString(callSuper = true) 27 | @EqualsAndHashCode(callSuper = true) 28 | public class NodeParam extends BaseQueryParam { 29 | private Integer groupId; 30 | private String nodeId; 31 | private Integer p2pPort; 32 | private String nodeName; 33 | private String nodeIp; 34 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/statistic/result/Data.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.statistic.result; 17 | 18 | /** 19 | * DATA ENTITY of node monitor and host monitor (performance) module 20 | * related with LineDataList and PerformanceData 21 | * LineDataList => Data => PerformanceData 22 | */ 23 | @lombok.Data 24 | public class Data { 25 | private LineDataList lineDataList; 26 | private LineDataList contrastDataList; 27 | 28 | public Data(LineDataList lineDataList, LineDataList contrastDataList) { 29 | this.lineDataList = lineDataList; 30 | this.contrastDataList = contrastDataList; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/account/token/TokenMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.account.token; 17 | 18 | import org.apache.ibatis.annotations.Param; 19 | import org.springframework.stereotype.Repository; 20 | 21 | import java.time.LocalDateTime; 22 | 23 | /** 24 | * token mapper. 25 | */ 26 | @Repository 27 | public interface TokenMapper { 28 | void add(TbToken tbToken); 29 | 30 | void delete(@Param("token") String token, @Param("value") String value); 31 | 32 | void update(@Param("token") String token, @Param("expireTime") LocalDateTime expireTime); 33 | 34 | TbToken query(@Param("token") String token); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/config/properties/VersionProperties.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.config.properties; 16 | 17 | import lombok.Data; 18 | import org.springframework.beans.factory.annotation.Value; 19 | import org.springframework.stereotype.Component; 20 | 21 | /** 22 | * load 'version' in .yml 23 | */ 24 | @Data 25 | @Component 26 | public class VersionProperties { 27 | 28 | // inclusive (can be equal) 29 | public static final Integer WEBASE_LOWEST_VERSION_INT = 132; 30 | public static final Integer NODE_LOWEST_SUPPORT_VERSION_INT = 241; 31 | 32 | @Value("${version}") 33 | private String version; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/group/entity/ReqGroupStatus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.group.entity; 18 | 19 | import lombok.AllArgsConstructor; 20 | import lombok.Data; 21 | import lombok.NoArgsConstructor; 22 | 23 | import javax.validation.constraints.NotNull; 24 | import java.util.List; 25 | 26 | /** 27 | * get front's(node's) group status 28 | * different node might get different group status of the same group 29 | */ 30 | @Data 31 | @NoArgsConstructor 32 | @AllArgsConstructor 33 | public class ReqGroupStatus { 34 | @NotNull 35 | private List nodeIdList; 36 | @NotNull 37 | private List groupIdList; 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/GroupType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.base.enums; 18 | 19 | import lombok.AllArgsConstructor; 20 | import lombok.Getter; 21 | import lombok.ToString; 22 | 23 | /** 24 | * Enumeration of group type. 25 | * @author marsli 26 | */ 27 | @Getter 28 | @ToString 29 | @AllArgsConstructor 30 | public enum GroupType { 31 | /** 32 | * sync from node 33 | */ 34 | SYNC(1,"sync"), 35 | /** 36 | * manual generated 37 | */ 38 | MANUAL(2,"manual"), 39 | 40 | /** 41 | * deploy 42 | */ 43 | DEPLOY(3,"deploy"); 44 | 45 | private int value; 46 | private String description; 47 | 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/group/entity/RspGroupStatus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.group.entity; 18 | 19 | import lombok.AllArgsConstructor; 20 | import lombok.Data; 21 | import lombok.NoArgsConstructor; 22 | 23 | import java.util.Map; 24 | 25 | /** 26 | * entity of > 27 | */ 28 | @Data 29 | @NoArgsConstructor 30 | @AllArgsConstructor 31 | public class RspGroupStatus { 32 | private String nodeId; 33 | /** 34 | * 35 | * status: "INEXISTENT"、"STOPPING"、"RUNNING"、"STOPPED"、"DELETED" 36 | * request fail: "FAIL" 37 | */ 38 | private Map groupStatusMap; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/deploy/entity/DeployNodeInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.deploy.entity; 16 | 17 | import javax.validation.constraints.NotBlank; 18 | import javax.validation.constraints.Positive; 19 | import lombok.Data; 20 | 21 | /** 22 | * after adding host, get node port & front port & hostId list 23 | */ 24 | @Data 25 | public class DeployNodeInfo { 26 | 27 | private int hostId; 28 | @NotBlank 29 | private String ip; 30 | @Positive 31 | private int frontPort; 32 | @Positive 33 | private int channelPort; 34 | @Positive 35 | private int p2pPort; 36 | @Positive 37 | private int rpcPort; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/front/frontinterface/entity/GenerateGroupInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.front.frontinterface.entity; 15 | 16 | import java.math.BigInteger; 17 | import java.util.List; 18 | import javax.validation.constraints.NotEmpty; 19 | import javax.validation.constraints.NotNull; 20 | import lombok.AllArgsConstructor; 21 | import lombok.Data; 22 | import lombok.NoArgsConstructor; 23 | 24 | @Data 25 | @NoArgsConstructor 26 | @AllArgsConstructor 27 | public class GenerateGroupInfo { 28 | @NotNull 29 | private Integer generateGroupId; 30 | @NotNull 31 | private BigInteger timestamp; 32 | @NotEmpty 33 | private List nodeList; 34 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/appintegration/contractstore/entity/ContractStoreParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.appintegration.contractstore.entity; 17 | 18 | import com.webank.webase.node.mgr.base.entity.BaseQueryParam; 19 | import lombok.Data; 20 | import lombok.EqualsAndHashCode; 21 | import lombok.NoArgsConstructor; 22 | import lombok.ToString; 23 | 24 | @Data 25 | @NoArgsConstructor 26 | @ToString(callSuper = true) 27 | @EqualsAndHashCode(callSuper = true) 28 | public class ContractStoreParam extends BaseQueryParam { 29 | private Integer id; 30 | private String appKey; 31 | private String contractName; 32 | private String contractVersion; 33 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/cert/entity/TbCert.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.cert.entity; 17 | 18 | import lombok.Data; 19 | 20 | import java.util.Date; 21 | 22 | /** 23 | * entity of cert 24 | */ 25 | @Data 26 | public class TbCert { 27 | // Primary Key 28 | private String fingerPrint; 29 | private String certName; 30 | private String content; 31 | private String certType; 32 | // node id=public key, 节点证书&sdk证书才有 33 | private String publicKey; 34 | private String address; 35 | // 父证书地址 36 | private String father; 37 | private Date validityFrom; 38 | private Date validityTo; 39 | private Date createTime; 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/user/entity/ReqImportPrivateKey.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.user.entity; 18 | 19 | import javax.validation.constraints.NotBlank; 20 | import lombok.Data; 21 | import lombok.EqualsAndHashCode; 22 | import lombok.NoArgsConstructor; 23 | import lombok.ToString; 24 | 25 | @Data 26 | @NoArgsConstructor 27 | @ToString(callSuper = true) 28 | @EqualsAndHashCode(callSuper = true) 29 | public class ReqImportPrivateKey extends NewUserInputParam { 30 | 31 | /** 32 | * encoded in base64 33 | */ 34 | @NotBlank 35 | private String privateKey; 36 | /** 37 | * used to bind private key 38 | */ 39 | private Integer userId; 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/deploy/entity/ReqNodeOption.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.deploy.entity; 15 | 16 | import javax.validation.constraints.NotBlank; 17 | 18 | import lombok.Data; 19 | 20 | /** 21 | * 22 | */ 23 | @Data 24 | public class ReqNodeOption { 25 | 26 | /** 27 | * nodeId. 28 | */ 29 | @NotBlank 30 | private String nodeId; 31 | 32 | /** 33 | * Whether delete node when trying to delete the last node on a host. 34 | */ 35 | // private boolean deleteHost; 36 | 37 | /** 38 | * Whether delete agency when trying to delete the last node on a host. 39 | * 40 | */ 41 | // private boolean deleteAgency; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/statistic/result/LineDataList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.statistic.result; 17 | 18 | import java.math.BigDecimal; 19 | import java.util.List; 20 | import lombok.Data; 21 | 22 | /** 23 | * DATA UNIT of monitor data 24 | * LineDataList => Data => PerformanceData 25 | * containing list of result number which comes from monitor result 26 | */ 27 | @Data 28 | public class LineDataList { 29 | List timestampList; 30 | List valueList; 31 | 32 | public LineDataList(List timestampList, List valueList) { 33 | this.timestampList = timestampList; 34 | this.valueList = valueList; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/table/entity/TbInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.table.entity; 15 | 16 | import lombok.Data; 17 | import lombok.NoArgsConstructor; 18 | 19 | /** 20 | * database info. 21 | */ 22 | @Data 23 | @NoArgsConstructor 24 | public class TbInfo { 25 | 26 | private String dbIp; 27 | private Integer dbPort; 28 | private String dbUser; 29 | private String dbPwd; 30 | 31 | /** 32 | * init TbInfo. 33 | */ 34 | public TbInfo(String dbIp, Integer dbPort, String dbUser, String dbPwd) { 35 | super(); 36 | this.dbIp = dbIp; 37 | this.dbPort = dbPort; 38 | this.dbUser = dbUser; 39 | this.dbPwd = dbPwd; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/tools/NumberUtil.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.tools; 16 | 17 | /** 18 | * get percentage in deploy 19 | */ 20 | public class NumberUtil { 21 | 22 | public static final int PERCENTAGE_FAILED = -1; 23 | public static final int PERCENTAGE_FINISH = 100; 24 | public static final int PERCENTAGE_IN_PROGRESS = 0; 25 | 26 | /** 27 | * 28 | * @param obtained 29 | * @param total 30 | * @return 31 | */ 32 | public static int percentage(int obtained, int total) { 33 | if (total == 0){ 34 | return 0; 35 | } 36 | return (int)((float)obtained) * 100 / total; 37 | } 38 | 39 | 40 | } 41 | 42 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/CnsMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.contract; 16 | 17 | import com.webank.webase.node.mgr.contract.entity.QueryCnsParam; 18 | import com.webank.webase.node.mgr.contract.entity.TbCns; 19 | import java.util.List; 20 | import org.apache.ibatis.annotations.Param; 21 | import org.springframework.stereotype.Repository; 22 | 23 | @Repository 24 | public interface CnsMapper { 25 | 26 | Integer add(TbCns TbCns); 27 | 28 | TbCns getCnsByAddress(QueryCnsParam param); 29 | 30 | int countOfCns(QueryCnsParam param); 31 | 32 | List getList(QueryCnsParam param); 33 | 34 | void deleteByGroupId(@Param("groupId") int groupId); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/appintegration/contractstore/entity/ReqContractSourceSave.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.appintegration.contractstore.entity; 15 | 16 | import java.util.List; 17 | import javax.validation.constraints.NotBlank; 18 | import javax.validation.constraints.NotEmpty; 19 | import lombok.Data; 20 | import org.hibernate.validator.constraints.Length; 21 | 22 | /** 23 | * param to save contract source 24 | */ 25 | @Data 26 | public class ReqContractSourceSave { 27 | @NotEmpty 28 | private List contractList; 29 | @NotBlank 30 | @Length(max=120) 31 | private String contractVersion; 32 | @NotBlank 33 | @Length(max=50) 34 | private String account; 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/cert/entity/CertParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.cert.entity; 17 | 18 | import com.webank.webase.node.mgr.base.entity.BaseQueryParam; 19 | import lombok.Data; 20 | import lombok.EqualsAndHashCode; 21 | import lombok.NoArgsConstructor; 22 | import lombok.ToString; 23 | 24 | import java.sql.Date; 25 | 26 | /** 27 | * db param of cert 28 | */ 29 | @Data 30 | @NoArgsConstructor 31 | @ToString(callSuper = true) 32 | @EqualsAndHashCode(callSuper = true) 33 | public class CertParam extends BaseQueryParam { 34 | private String fingerPrint; 35 | private String certType; 36 | private String father; 37 | private String certName; 38 | private Date validityFrom; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/external/entity/RspAllExtAccount.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.external.entity; 16 | 17 | import com.webank.webase.node.mgr.user.entity.TbUser; 18 | import lombok.AllArgsConstructor; 19 | import lombok.Data; 20 | import lombok.EqualsAndHashCode; 21 | import lombok.NoArgsConstructor; 22 | import lombok.ToString; 23 | 24 | /** 25 | * entity to save tb_external_account left join tb_user 26 | */ 27 | @Data 28 | @NoArgsConstructor 29 | @ToString(callSuper = true) 30 | @EqualsAndHashCode(callSuper = true) 31 | public class RspAllExtAccount extends TbUser { 32 | private Integer extAccountId; 33 | private String userName; 34 | private Integer transCount; 35 | private String hashs; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/GovernType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.base.enums; 16 | 17 | public enum GovernType { 18 | 19 | GRANT_COMMITTEE(1), 20 | REVOKE_COMMITTEE(2), 21 | UPDATE_COMMITTEE_WEIGHT(3), 22 | UPDATE_THRESHOLD(4); 23 | 24 | private int value; 25 | 26 | GovernType(Integer value) { 27 | this.value = value; 28 | } 29 | 30 | public int getValue() { 31 | return this.value; 32 | } 33 | 34 | public static GovernType getById(int value) { 35 | for (GovernType status : GovernType.values()) { 36 | if (status.value == value) { 37 | return status; 38 | } 39 | } 40 | return null; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/config/properties/ExecutorProperties.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.config.properties; 17 | 18 | import lombok.Data; 19 | import org.springframework.boot.context.properties.ConfigurationProperties; 20 | import org.springframework.stereotype.Component; 21 | 22 | /** 23 | * executor of node-mgr async 24 | */ 25 | @Data 26 | @Component 27 | @ConfigurationProperties(prefix = ExecutorProperties.EXECUTOR_PREFIX) 28 | public class ExecutorProperties { 29 | public static final String EXECUTOR_PREFIX = "executor"; 30 | 31 | private Integer corePoolSize = 3; 32 | private Integer maxPoolSize = 5; 33 | private Integer queueSize = 50; 34 | private String threadNamePrefix = "node-mgr-async-"; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/entity/TransactionInputParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.contract.entity; 17 | 18 | import com.webank.webase.node.mgr.front.entity.TransactionParam; 19 | import lombok.Data; 20 | import lombok.EqualsAndHashCode; 21 | import lombok.NoArgsConstructor; 22 | import lombok.ToString; 23 | 24 | /** 25 | * param of send transaction from web 26 | * support send by contract api and abi api 27 | */ 28 | @Data 29 | @NoArgsConstructor 30 | @ToString(callSuper = true) 31 | @EqualsAndHashCode(callSuper = true) 32 | public class TransactionInputParam extends TransactionParam { 33 | 34 | private Integer contractId; 35 | /** 36 | * user address, identify signUserId 37 | */ 38 | private String user; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/alert/rule/AlertRuleMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.alert.rule; 18 | 19 | import com.webank.webase.node.mgr.alert.rule.entity.TbAlertRule; 20 | import org.apache.ibatis.annotations.Param; 21 | import org.springframework.stereotype.Repository; 22 | 23 | import java.util.List; 24 | 25 | @Repository 26 | public interface AlertRuleMapper { 27 | 28 | void add(TbAlertRule tbAlertRule); 29 | 30 | void deleteByRuleId(@Param("ruleId") int ruleId); 31 | 32 | void update(TbAlertRule tbAlertRule); 33 | 34 | TbAlertRule queryByRuleId(@Param("ruleId") int ruleId); 35 | 36 | List listOfAlertRules(); 37 | 38 | // // 带分页的db查询 只有三个,不设多个 39 | // List getPageOfAlertRules(); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/entity/ReqRegisterCns.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.contract.entity; 17 | 18 | import javax.validation.constraints.NotBlank; 19 | import javax.validation.constraints.NotNull; 20 | import lombok.Data; 21 | 22 | /** 23 | * cns register entity. 24 | */ 25 | @Data 26 | public class ReqRegisterCns { 27 | @NotNull 28 | private Integer groupId; 29 | private String contractPath; 30 | @NotBlank 31 | private String contractName; 32 | @NotBlank 33 | private String cnsName; 34 | @NotBlank 35 | private String version; 36 | @NotBlank 37 | private String contractAddress; 38 | @NotBlank 39 | private String contractAbi; 40 | @NotBlank 41 | private String userAddress; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/deploy/entity/ReqInitHost.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.deploy.entity; 16 | 17 | import java.util.List; 18 | import javax.validation.constraints.PositiveOrZero; 19 | import lombok.Data; 20 | 21 | @Data 22 | public class ReqInitHost { 23 | // String chainName, String imageTag, List hostIdList, boolean pullFromCdn 24 | private String chainName; 25 | private String imageTag; 26 | /** 27 | * manually load, pull from dockerhub, pull from cdn&load 28 | */ 29 | @PositiveOrZero 30 | private int dockerImageType; 31 | /** 32 | * force download new image tar and delete old one 33 | * @default: false 34 | */ 35 | // private Boolean force; 36 | private List hostIdList; 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/group/entity/ReqGenerateGroup.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.group.entity; 18 | 19 | import java.math.BigInteger; 20 | import java.util.List; 21 | import javax.validation.constraints.NotEmpty; 22 | import javax.validation.constraints.NotNull; 23 | import lombok.AllArgsConstructor; 24 | import lombok.Data; 25 | import lombok.NoArgsConstructor; 26 | 27 | /** 28 | * @author marsli 29 | */ 30 | @Data 31 | @NoArgsConstructor 32 | @AllArgsConstructor 33 | public class ReqGenerateGroup { 34 | @NotNull 35 | private Integer generateGroupId; 36 | @NotNull 37 | private BigInteger timestamp; 38 | /** 39 | * group.genesis sealers 40 | */ 41 | @NotEmpty 42 | private List nodeList; 43 | private String description; 44 | } -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/alert/log/entity/ReqLogListParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.alert.log.entity; 18 | 19 | import com.webank.webase.node.mgr.base.entity.BaseQueryParam; 20 | import lombok.Data; 21 | import lombok.EqualsAndHashCode; 22 | import lombok.NoArgsConstructor; 23 | import lombok.ToString; 24 | 25 | /** 26 | * Handle GET request from web to get paged list of logs 27 | */ 28 | @Data 29 | @NoArgsConstructor 30 | @ToString(callSuper = true) 31 | @EqualsAndHashCode(callSuper = true) 32 | public class ReqLogListParam extends BaseQueryParam { 33 | 34 | public ReqLogListParam(Integer start, Integer pageSize, 35 | String flagSortedByTime) { 36 | super(start, pageSize, flagSortedByTime); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/entity/RspContractNoAbi.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.contract.entity; 16 | 17 | import java.time.LocalDateTime; 18 | import lombok.Data; 19 | 20 | @Data 21 | public class RspContractNoAbi { 22 | private Integer contractId; 23 | private String contractPath; 24 | private String contractName; 25 | private String account; 26 | private Integer contractStatus; 27 | private Integer groupId; 28 | private Integer contractType; 29 | private String contractAddress; 30 | private LocalDateTime deployTime; 31 | private String description; 32 | private LocalDateTime createTime; 33 | private LocalDateTime modifyTime; 34 | private String deployAddress; 35 | private String deployUserName; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/precompiled/permission/governvote/GovernVoteMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.precompiled.permission.governvote; 16 | 17 | import com.webank.webase.node.mgr.precompiled.permission.governvote.entity.GovernParam; 18 | import com.webank.webase.node.mgr.precompiled.permission.governvote.entity.TbGovernVote; 19 | import java.util.List; 20 | import org.apache.ibatis.annotations.Param; 21 | 22 | public interface GovernVoteMapper { 23 | 24 | Integer add(TbGovernVote tbGovernVote); 25 | 26 | List getList(GovernParam param); 27 | 28 | Integer getCount(GovernParam param); 29 | 30 | TbGovernVote getById(@Param("id") int id); 31 | 32 | void deleteById(int id); 33 | 34 | void deleteByGroupId(int groupId); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/config/properties/SchedulerProperties.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.config.properties; 18 | 19 | import lombok.Data; 20 | import org.springframework.boot.context.properties.ConfigurationProperties; 21 | import org.springframework.stereotype.Component; 22 | 23 | /** 24 | * scheduler properties 25 | */ 26 | @Data 27 | @Component 28 | @ConfigurationProperties(prefix = SchedulerProperties.SCHEDULER_PREFIX) 29 | public class SchedulerProperties { 30 | public static final String SCHEDULER_PREFIX = "scheduler"; 31 | 32 | private Integer poolSize = 5; 33 | private String threadNamePrefix = "node-mgr-task-"; 34 | private Integer awaitTerminationSeconds = 60; 35 | private Boolean waitForTasksToCompleteOnShutdown = true; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/abi/entity/ReqImportAbi.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.contract.abi.entity; 18 | 19 | import lombok.Data; 20 | import lombok.NoArgsConstructor; 21 | 22 | import javax.validation.constraints.NotBlank; 23 | import javax.validation.constraints.NotNull; 24 | import java.util.List; 25 | 26 | /** 27 | * entity to import/update abi info 28 | */ 29 | @Data 30 | @NoArgsConstructor 31 | public class ReqImportAbi { 32 | private Integer abiId; 33 | @NotBlank 34 | private String account; 35 | @NotNull 36 | private Integer groupId; 37 | @NotBlank 38 | private String contractName; 39 | @NotBlank 40 | private String contractAddress; 41 | @NotNull 42 | private List contractAbi; 43 | // private String deployAddress; 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/tools/cmd/ExecuteResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.tools.cmd; 17 | 18 | import lombok.AllArgsConstructor; 19 | import lombok.Data; 20 | import lombok.NoArgsConstructor; 21 | import lombok.ToString; 22 | 23 | /** 24 | * result entity of java run command 25 | */ 26 | @Data 27 | @ToString 28 | @NoArgsConstructor 29 | @AllArgsConstructor 30 | public class ExecuteResult { 31 | private int exitCode; 32 | private String executeOut; 33 | 34 | public static ExecuteResult build (int exitCode,String msg){ 35 | return new ExecuteResult(exitCode,msg); 36 | } 37 | 38 | public boolean success(){ 39 | return exitCode == 0; 40 | } 41 | public boolean failed(){ 42 | return !success(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/user/entity/NewUserInputParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.user.entity; 17 | 18 | 19 | import com.webank.webase.node.mgr.base.enums.UserType; 20 | import javax.validation.constraints.NotBlank; 21 | import javax.validation.constraints.NotNull; 22 | import lombok.Data; 23 | import lombok.NoArgsConstructor; 24 | import org.hibernate.validator.constraints.Length; 25 | 26 | /** 27 | * new user data. 28 | */ 29 | @Data 30 | @NoArgsConstructor 31 | public class NewUserInputParam { 32 | @NotBlank 33 | @Length(max=64) 34 | private String userName; 35 | private String account; 36 | @NotNull 37 | private Integer groupId; 38 | private String description; 39 | private Integer userType = UserType.GENERALUSER.getValue(); 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/alert/mail/server/config/MailServerConfigMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.alert.mail.server.config; 18 | 19 | import com.webank.webase.node.mgr.alert.mail.server.config.entity.TbMailServerConfig; 20 | import org.apache.ibatis.annotations.Param; 21 | import org.springframework.stereotype.Repository; 22 | 23 | import java.util.List; 24 | 25 | @Repository 26 | public interface MailServerConfigMapper { 27 | 28 | void add(TbMailServerConfig tbMailServerConfig); 29 | 30 | void deleteByServerId(@Param("serverId") int serverId); 31 | 32 | void update(TbMailServerConfig tbMailServerConfig); 33 | 34 | TbMailServerConfig queryByServerId(@Param("serverId") int serverId); 35 | 36 | List listOfMailServerConfig(); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/table/TableMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.table; 17 | 18 | import java.util.List; 19 | import org.apache.ibatis.annotations.Param; 20 | import org.springframework.stereotype.Repository; 21 | 22 | @Repository 23 | public interface TableMapper { 24 | 25 | List queryTables(@Param("dbName") String dbName, @Param("tableName") String tableName); 26 | 27 | int dropTable(@Param("dbName") String dbName, @Param("tableName") String tableName); 28 | 29 | int deleteByTableName(@Param("tableName") String tableName); 30 | 31 | int createTbBlock(@Param("tableName") String tableName); 32 | 33 | int createTransHash(@Param("tableName") String tableName); 34 | 35 | int createUserTransactionMonitor(@Param("tableName") String tableName); 36 | } -------------------------------------------------------------------------------- /src/test/java/node/mgr/test/chaingovernance/ContractStatusServiceTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | *

7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | *

9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package node.mgr.test.chaingovernance; 16 | 17 | import com.webank.webase.node.mgr.precompiled.permission.governvote.GovernVoteService; 18 | import com.webank.webase.node.mgr.precompiled.permission.governvote.entity.GovernParam; 19 | import node.mgr.test.base.TestBase; 20 | import org.junit.Test; 21 | import org.springframework.beans.factory.annotation.Autowired; 22 | 23 | public class ContractStatusServiceTest extends TestBase { 24 | 25 | @Autowired 26 | private GovernVoteService governVoteService; 27 | 28 | @Test 29 | public void testListVote() { 30 | GovernParam param = new GovernParam(); 31 | param.setGroupId(1); 32 | System.out.println(governVoteService.getVoteList(param)); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/alert/log/AlertLogMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.alert.log; 18 | 19 | import com.webank.webase.node.mgr.alert.log.entity.AlertLog; 20 | import com.webank.webase.node.mgr.alert.log.entity.ReqLogListParam; 21 | import org.apache.ibatis.annotations.Param; 22 | import org.springframework.stereotype.Repository; 23 | 24 | import java.util.List; 25 | 26 | @Repository 27 | public interface AlertLogMapper { 28 | 29 | List listOfAlertLog(@Param("param") ReqLogListParam param); 30 | 31 | Integer countOfLog(); 32 | 33 | AlertLog queryByLogId(@Param("logId") int logId); 34 | 35 | void add(AlertLog alertLog); 36 | 37 | void update(AlertLog alertLog); 38 | 39 | void deleteByLogId(@Param("logId") int logId); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | APP_MAIN=com.webank.webase.node.mgr.Application 4 | CURRENT_DIR=$(pwd)/ 5 | CONF_DIR=${CURRENT_DIR}conf 6 | 7 | SERVER_PORT=$(cat $CONF_DIR/application.yml| grep "port" | awk '{print $2}'| sed 's/\r//') 8 | if [ ${SERVER_PORT}"" = "" ];then 9 | echo "$CONF_DIR/application.yml server port has not been configured" 10 | exit -1 11 | fi 12 | 13 | processPid=0 14 | checkProcess(){ 15 | server_pid=$(ps aux | grep java | grep $CURRENT_DIR | grep $APP_MAIN | awk '{print $2}') 16 | if [ -n "$server_pid" ]; then 17 | processPid=$server_pid 18 | else 19 | processPid=0 20 | fi 21 | } 22 | 23 | stop(){ 24 | checkProcess 25 | echo "===============================================================================================" 26 | if [ $processPid -ne 0 ]; then 27 | echo -n "Stopping Server $APP_MAIN Port $SERVER_PORT PID($processPid)..." 28 | kill -9 $processPid 29 | if [ $? -eq 0 ]; then 30 | echo "[Success]" 31 | echo "===============================================================================================" 32 | else 33 | echo "[Failed]" 34 | echo "===============================================================================================" 35 | fi 36 | else 37 | echo "Server $APP_MAIN Port $SERVER_PORT is not running" 38 | echo "===============================================================================================" 39 | fi 40 | } 41 | 42 | stop -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/appintegration/contractstore/entity/ReqContractAddressSave.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.appintegration.contractstore.entity; 15 | 16 | import javax.validation.constraints.NotBlank; 17 | import javax.validation.constraints.NotNull; 18 | import lombok.Data; 19 | import org.hibernate.validator.constraints.Length; 20 | 21 | /** 22 | * param to save contract address 23 | */ 24 | @Data 25 | public class ReqContractAddressSave { 26 | @NotNull 27 | private Integer groupId; 28 | @NotBlank 29 | @Length(max=120) 30 | private String contractName; 31 | @NotBlank 32 | @Length(max=120) 33 | private String contractPath; 34 | @NotBlank 35 | @Length(max=120) 36 | private String contractVersion; 37 | @NotBlank 38 | private String contractAddress; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/base/enums/RunTypeEnum.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | package com.webank.webase.node.mgr.base.enums; 16 | 17 | import lombok.AllArgsConstructor; 18 | import lombok.Getter; 19 | import lombok.ToString; 20 | 21 | @Getter 22 | @ToString 23 | @AllArgsConstructor 24 | public enum RunTypeEnum { 25 | COMMAND((byte) 0, "Run with a command."), 26 | DOCKER((byte) 1, "Run with docker."), 27 | ; 28 | 29 | private byte id; 30 | private String description; 31 | 32 | /** 33 | * @param id 34 | * @return 35 | */ 36 | public static RunTypeEnum getById(byte id) { 37 | for (RunTypeEnum value : RunTypeEnum.values()) { 38 | if (value.id == id) { 39 | return value; 40 | } 41 | } 42 | return null; 43 | } 44 | 45 | 46 | } 47 | 48 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/frontgroupmap/entity/MapListParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.frontgroupmap.entity; 15 | 16 | import lombok.Data; 17 | import lombok.NoArgsConstructor; 18 | 19 | @Data 20 | @NoArgsConstructor 21 | public class MapListParam { 22 | private Integer mapId; 23 | private Integer frontId; 24 | private Integer groupId; 25 | private Integer status; 26 | private Integer type; 27 | 28 | public MapListParam(Integer frontId, Integer groupId) { 29 | this.frontId = frontId; 30 | this.groupId = groupId; 31 | } 32 | 33 | public MapListParam(Integer frontId, Integer groupId, Integer status, Integer type) { 34 | this.frontId = frontId; 35 | this.groupId = groupId; 36 | this.status = status; 37 | this.type = type; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/account/entity/AccountListParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.webank.webase.node.mgr.account.entity; 17 | 18 | import com.webank.webase.node.mgr.base.entity.BaseQueryParam; 19 | import lombok.Data; 20 | import lombok.EqualsAndHashCode; 21 | import lombok.NoArgsConstructor; 22 | import lombok.ToString; 23 | 24 | /** 25 | * param of query account list. 26 | */ 27 | @Data 28 | @NoArgsConstructor 29 | @ToString(callSuper = true) 30 | @EqualsAndHashCode(callSuper = true) 31 | public class AccountListParam extends BaseQueryParam { 32 | 33 | private String account; 34 | 35 | public AccountListParam(Integer start, Integer pageSize, String account, 36 | String flagSortedByTime) { 37 | super(start, pageSize, flagSortedByTime); 38 | this.account = account; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/alert/log/entity/AlertLog.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.alert.log.entity; 18 | 19 | import lombok.Data; 20 | import lombok.NoArgsConstructor; 21 | 22 | import java.time.LocalDateTime; 23 | 24 | /** 25 | * Entity for table tb_alert_log in db 26 | */ 27 | @Data 28 | @NoArgsConstructor 29 | public class AlertLog { 30 | private Integer logId; 31 | /** 32 | * 1-节点, 2-审计, 3-证书 33 | */ 34 | private Integer alertType; 35 | /** 36 | * 1-high, 2-middle, 3-low 37 | */ 38 | private Integer alertLevel; 39 | private String alertContent; 40 | private String description; 41 | /** 42 | * 0-未处理,1-已处理 43 | */ 44 | private Integer status; 45 | private LocalDateTime createTime; 46 | private LocalDateTime modifyTime; 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/contract/abi/entity/AbiInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.webank.webase.node.mgr.contract.abi.entity; 18 | 19 | import lombok.Data; 20 | import lombok.NoArgsConstructor; 21 | 22 | import java.time.LocalDateTime; 23 | 24 | /** 25 | * entity for table tb_abi to store raw contract abi 26 | */ 27 | @Data 28 | @NoArgsConstructor 29 | public class AbiInfo { 30 | private Integer abiId; 31 | private Integer groupId; 32 | private String account; 33 | private String contractName; 34 | private String contractAddress; 35 | private String contractAbi; 36 | /** 37 | * runtime bin 38 | */ 39 | private String contractBin; 40 | /** 41 | * 1-normal, 2-invalid 42 | */ 43 | // private Integer contractStatus; 44 | private LocalDateTime createTime; 45 | private LocalDateTime modifyTime; 46 | 47 | } 48 | 49 | -------------------------------------------------------------------------------- /src/main/java/com/webank/webase/node/mgr/user/entity/UserParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.webank.webase.node.mgr.user.entity; 15 | 16 | import com.webank.webase.node.mgr.base.entity.BaseQueryParam; 17 | import lombok.Data; 18 | import lombok.EqualsAndHashCode; 19 | import lombok.NoArgsConstructor; 20 | import lombok.ToString; 21 | 22 | @Data 23 | @NoArgsConstructor 24 | @ToString(callSuper = true) 25 | @EqualsAndHashCode(callSuper = true) 26 | public class UserParam extends BaseQueryParam { 27 | 28 | private Integer groupId; 29 | private Integer orgId; 30 | private Integer userId; 31 | private String userName; 32 | private String account; 33 | private String commParam; 34 | private Integer hasPk; 35 | private String address; 36 | /** 37 | * used in external list all, 0-all,1-normal,3-abnormal 38 | */ 39 | private Integer type; 40 | } --------------------------------------------------------------------------------