diff --git a/conf.py b/conf.py index 05d18ed2..6aa218d8 100644 --- a/conf.py +++ b/conf.py @@ -110,7 +110,7 @@ # The short X.Y version. version = '1.5' # The full version, including alpha/beta/rc tags. -release = 'v1.5.2' +release = 'v1.5.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/WeBASE-APP-SDK/appintegration.md b/docs/WeBASE-APP-SDK/appintegration.md deleted file mode 100644 index d8d3e367..00000000 --- a/docs/WeBASE-APP-SDK/appintegration.md +++ /dev/null @@ -1,172 +0,0 @@ -# 接入说明 - -应用管理是WeBASE管理台提供的一种第三方应用接入功能。其他应用可以通过WeBASE通用API来开发自己的运维管理台。接入的步骤如下: - -1. 通过WeBASE管理平台获得注册信息,并通过API向WeBASE注册服务。 -2. 通过WeBASE提供的基础能力API和WeBASE连通。 - - -## 应用集成SDK - -### SDK简介 -WeBASE-APP-SDK是应用集成SDK,提供调用WeBASE-Node-Manager的接口,方便WeBASE管理台接入第三方应用。 -​ 从`v1.5.1`开始,提供应用集成SDK,方便应用接入。接口API可以查看[WeBASE通用API](./api.html)。调用之前需要添加依赖和初始化应用信息。 - -- `v1.5.1`及其以上版本,应用配置AppConfig的属性`isTransferEncrypt`需和WeBASE-Node-Manager的配置文件`/conf/application.yml`下的配置`constant.isTransferEncrypt`相同,默认为`true`。 -- 如果`v1.5.0`需要使用SDK,应用配置AppConfig的属性`isTransferEncrypt`需设置为`false`。`v1.5.1`及其以上版本新增的接口调用不了。 - -### 添加依赖 - -- 添加 SDK 的依赖,以Gradle为例 - -```java -repositories { - maven { url "http://maven.aliyun.com/nexus/content/groups/public/" } - maven { url "https://oss.sonatype.org/content/repositories/snapshots" } -} -dependencies { - implementation 'com.webank:webase-app-sdk:1.5.1-SNAPSHOT' - implementation 'org.bouncycastle:bcprov-jdk15on:1.67' - implementation 'org.apache.commons:commons-lang3:3.8.1' - implementation 'com.squareup.okhttp3:okhttp:4.8.1' - implementation 'com.fasterxml.jackson.core:jackson-databind:2.11.0' - implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.0' - implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.0' - implementation 'com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.0' - implementation 'org.projectlombok:lombok:1.18.12' - implementation 'org.apache.logging.log4j:log4j-api:2.13.3' - implementation 'org.apache.logging.log4j:log4j-core:2.13.3' - implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.13.3' -} -``` - -### 配置说明 - -- 应用配置 - -``` -public class AppConfig { - // 节点管理服务地址 - private String nodeManagerUrl; - // 应用Key - private String appKey; - // 应用密码 - private String appSecret; - // 是否加密传输 - private boolean isTransferEncrypt; -} -``` - -- Http请求配置 - -``` -public class HttpConfig { - // 连接超时(默认30s) - private int connectTimeout; - // 读取超时(默认30s) - private int readTimeout; - // 写超时(默认30s) - private int writeTimeout; -} -``` - -### 调用示例 - -完整示例请查看[SDK示例](https://github.com/WeBankFinTech/WeBASE-APP-SDK/blob/main/src/test/java/com/webank/webase/app/sdk/ClientTest.java)。 - -```java -public class ClientTest { - - // WeBASE-Node-Manager的url - private static String url = "http://localhost:5001"; - private static String appKey = "RUPCNAsd"; - private static String appSecret = "65KiXNxUpPywVwQxM7SFsMHsKmCbpGrQ"; - private static boolean isTransferEncrypt = true; - - private static AppClient appClient = null; - - public static void main(String[] args) { - try { - initClient(); - appRegister(); - } catch (Exception e) { - e.printStackTrace(); - } - System.exit(0); - } - - public static void initClient() { - // 未设置httpConfig时,默认http连接均为30s - HttpConfig httpConfig = new HttpConfig(30, 30, 30); - appClient = new AppClient(url, appKey, appSecret, isTransferEncrypt, httpConfig); - System.out.println("testInitClient:" + JacksonUtil.objToString(appClient)); - } - - public static void appRegister() throws Exception { - try { - ReqAppRegister req = new ReqAppRegister(); - req.setAppIp("127.0.0.1"); - req.setAppPort(5001); - req.setAppLink("https://127.0.0.1:5001/"); - appClient.appRegister(req); - System.out.println("appRegister end."); - } catch (Exception e) { - e.printStackTrace(); - } - } -} -``` - -## 签名 -使用SDK时,SDK会自动填充。 - -### 签名说明 - -第三方应用从WeBASE管理平台获取注册信息**WeBASE的IP和端口、为应用分配的`appKey`(应用Key)和`appSecret`(应用密码,应用自己保存,不要暴露)**,向WeBASE发送请求时,需要使用应用分配的`appSecret`对请求进行签名。WeBASE收到请求后,根据`appKey`查询应用对应的`appSecret`,使用相同规则对请求进行签名验证。只有在验证通过后,WeBASE才会对请求进行相应的处理。 - -* 每个URL请求需带以下三个参数: - -| 参数名 | 类型 | 描述 | 参数值 | 备注 | -| --------- | ------ | -------------------- | ------------- | --------------------------------------------- | -| timestamp | long | 请求的时间戳(毫秒) | 1614928857832 | 当前时间戳,有效期默认5分钟 | -| appKey | String | 应用Key | fdsf78aW | 从WeBASE管理平台获取 | -| signature | String | 签名串 | 15B8F38... | 从WeBASE管理平台获取appSecret对appKey做的签名 | - -### 签名规则 - -使用MD5对`timestamp`、`appKey`加密并转大写得到签名值`signature` - -``` -public static String md5Encrypt(long timestamp, String appKey, String appSecret) { - try { - String dataStr = timestamp + appKey + appSecret; - MessageDigest m = MessageDigest.getInstance("MD5"); - m.update(dataStr.getBytes("UTF8")); - byte s[] = m.digest(); - String result = ""; - for (int i = 0; i < s.length; i++) { - result += Integer.toHexString((0x000000FF & s[i]) | 0xFFFFFF00).substring(6); - } - return result.toUpperCase(); - } catch (Exception e) { - e.printStackTrace(); - } - return ""; - } -``` - -### 示例 - -* 参数值: - -| 参数 | 参数值 | -| --------- | ---------------------------------- | -| timestamp | `1614928857832` | -| appKey | `fdsf78aW` | -| appSecret | `oMdarsqFOsSKThhvXagTpNdoOcIJxUwQ` | - -* 签名后的 `signature` 为 - -```Bash -EEFD7CD030E6B311AA85B053A90E8A31 -``` \ No newline at end of file diff --git a/docs/WeBASE-APP-SDK/appintegrationlist.md b/docs/WeBASE-APP-SDK/appintegrationlist.md deleted file mode 100644 index b228e123..00000000 --- a/docs/WeBASE-APP-SDK/appintegrationlist.md +++ /dev/null @@ -1,30 +0,0 @@ -# 管理实例 - -## 基于区块链的实体身份标识及可信数据交换解决方案 - -WeIdentity + WeBASE集成模式 - -git地址:https://github.com/WeBankFinTech/WeIdentity-Build-Tools - -文档地址:https://weidentity.readthedocs.io/zh_CN/latest/docs/deploy-via-web.html - - -## 基于FISCO BCOS 从0-1的供应链支付结算案例 - -FISCO BCOS Supply Chain Payment Settlement Demo created by Shanghai JiuYu Software Systems Co,Ltd. - -由上海久誉软件系统有限公司研发的针对基于 FISCO BCOS 的供应链支付结算案例。 - -git地址:https://github.com/jiuyu-software/supply-chain-demo - -文档地址:https://github.com/jiuyu-software/supply-chain-demo/blob/master/README.md - - -## 基于 FISCO BCOS实现的电子存证平台案例 - -由杭州亦笔科技有限公司开发的针对基于 FISCO BCOS 的区块链电子存证平台案例。 - -git地址:https://github.com/YibiOpen/evidence-chain-demo - -文档地址:https://github.com/YibiOpen/evidence-chain-demo/blob/master/README.md - diff --git a/docs/WeBASE-APP-SDK/desc.md b/docs/WeBASE-APP-SDK/desc.md deleted file mode 100644 index 71982b8b..00000000 --- a/docs/WeBASE-APP-SDK/desc.md +++ /dev/null @@ -1,59 +0,0 @@ -# 功能介绍 - - - -应用管理是WeBASE管理台提供的一种第三方应用接入功能。WeBASE作为底层运维平台,已经有了底层运维基础能力。各个应用可以利用这些基础能力来开发自己的运维管理台。这些可以利用的基础能力主要包括四个方面:1、链信息和链运维(权限,配置等);2、合约;3、链的私钥账号;4、管理账号(登录态)。 - -![](../../images/WeBASE-Console-Suit/app_intergrate.png) - -这样的主要好处是: - -1. 各应用的进程管理还是自我管理,避免WeBASE过于笨重 -2. WeBASE提供的是规范,方便其他应用参考打通应用与WeBASE的联系 -3. 如果有扩展,WeBASE也方便提供API来实现 -4. 不破坏各应用自身的完整性 - - -管理台新增了应用管理菜单。新增应用有两种方式,一种是选择已有应用模板——目前仅支持WeID;另外一种是自定应用: - -![](../../images/WeBASE-Console-Suit/app_new.png) - -新增应用后,会生成应用相关的注册信息,为应用分配的`appKey`(应用Key)和`appSecret`(应用密码,应用自己保存,不要暴露),WeBASE的`IP`为内网IP,访问不了的话需对应修改: - -![](../../images/WeBASE-Console-Suit/app_register_info.png) - -第三方应用未向WeBASE进行注册时,WeBASE管理台不可以通过应用链接跳转到应用服务: - -![](../../images/WeBASE-Console-Suit/app_link_unable.png) - -第三方应用接入时,使用注册信息向WeBASE进行注册,调用相关OPEN API。第三方应用接入请参考【[应用接入说明](./appintegration.html)】。以下以 [WeIdentity](https://weidentity.readthedocs.io/zh_CN/latest/docs/weidentity-installation-by-web.html) 可视化页面接入为例: - -选择 WeID + WeBASE集成模式,从WeBASE复制注册信息: - -![](../../images/WeBASE-Console-Suit/app_weid_home.png) - -点击下一步时,WeID会向WeBASE进行注册并调用相关API,从WeBASE获取群组、节点、证书等相关信息: - -![](../../images/WeBASE-Console-Suit/app_weid_node.png) - -可以选择自动创建公私钥,或选择从WeBASE同步公私钥用户: - -![](../../images/WeBASE-Console-Suit/app_weid_user.png) - -![](../../images/WeBASE-Console-Suit/app_weid_userlist.png) - -部署WeID之后,WeID会将合约相关信息通过API导入WeBASE: - -![](../../images/WeBASE-Console-Suit/app_weid_deploy.png) - -![](../../images/WeBASE-Console-Suit/app_weid_deployed.png) - -![](../../images/WeBASE-Console-Suit/app_weid_contract.png) - -第三方应用向WeBASE进行注册后,在WeBASE管理台可以通过应用链接跳转到应用服务: - -注册后WeBASE将和应用间保持心跳。如果应用状态变成不能访问,则应用链接会置灰,变成不可跳转。 - -![](../../images/WeBASE-Console-Suit/app_link_enable.png) - - diff --git a/docs/WeBASE-APP-SDK/index.md b/docs/WeBASE-APP-SDK/index.md deleted file mode 100644 index a7da8ca0..00000000 --- a/docs/WeBASE-APP-SDK/index.md +++ /dev/null @@ -1,11 +0,0 @@ -# WeBASE应用管理 - -```eval_rst -.. toctree:: - :maxdepth: 1 - - desc.md - appintegration.md - appintegrationlist.md - api.md -``` \ No newline at end of file diff --git a/docs/WeBASE-Front/install.md b/docs/WeBASE-Front/install.md index a7cd02ff..2ea9ec5b 100644 --- a/docs/WeBASE-Front/install.md +++ b/docs/WeBASE-Front/install.md @@ -4,18 +4,25 @@ | 依赖软件 | 支持版本 | | :-: | :-: | -| Java | Java 1.8或以上版本 | -| FISCO-BCOS | v2.0.0及以上版本 | +| Java | JDK8或以上版本 | +| FISCO-BCOS | V2.0.x版本 | **备注:** Java推荐使用[OracleJDK](https://www.oracle.com/technetwork/java/javase/downloads/index.html),可参考[JDK配置指引](./appendix.html#jdk)(CentOS的yum仓库的OpenJDK缺少JCE(Java Cryptography Extension),导致Web3SDK无法正常连接区块链节点) -#### 国密支持 +### 国密支持 WeBASE-Front v1.2.2+已支持 [国密版FISCO-BCOS](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/manual/guomi_crypto.html) + +开启国密国密SSL: - 在v1.5.0后,sdk将自动根据链的加密类型切换国密或非国密,自动根据链的SSL类型切换国密SSL +国密编译: +- 编译国密版智能合约在v1.3.1版本后,通过引入solcJ:0.4.25-rc1.jar,自动切换支持国密版智能合约的编译/部署/调用;(可自行替换jar包版本为solcJ-0.5.2来使用0.5进行后台接口的合约编译) +- 该部分仅影响后台的`/contract`合约编译接口,不影响前端合约IDE的合约编译 + + -#### solidity v0.6.10支持 +### solidity v0.6.10支持 WeBASE-Front v1.4.2已支持solidity `v0.5.1`和`v0.6.10` @@ -64,7 +71,7 @@ dist目录提供了一份配置模板conf_template: ``` 根据配置模板生成一份实际配置conf。初次部署可直接拷贝。 -例如:cp -r conf_template conf +例如:cp conf_template conf -r ``` (2)进入conf目录: @@ -80,7 +87,7 @@ cd conf (3)修改配置(根据实际情况修改): -如果在企业部署中使用WeBASE-Front,必须配置下文中的`keyServer`,用于连接WeBASE-Sign服务 +*如果在企业部署中使用WeBASE-Front,必须配置下文中的`keyServer`* ``` vi application.yml @@ -101,11 +108,11 @@ sdk: certPath: conf // sdk证书的目录,默认为conf constant: keyServer: 127.0.0.1:5004 // 密钥服务的IP和端口(WeBASE-Node-Manager服务或者WeBASE-Sign服务,不同服务支持的接口不同),如果作为独立控制台使用可以不配置 - aesKey: EfdsW23D23d3df43 // aes加密key(16位) 如启用,各互联的子系统的加密key需保持一致 transMaxWait: 30 // 交易最大等待时间 monitorDisk: / // 要监控的磁盘目录,配置节点所在目录(如:/data) monitorEnabled: true // 是否监控数据,默认true - nodePath: /fisco/nodes/127.0.0.1/node0 //配置所连节点的绝对路径,用于监控节点配置与日志 + aesKey: EfdsW23D23d3df43 // aes加密key(16位) 如启用,各互联的子系统的加密key需保持一致 + nodePath: /fisco/nodes/127.0.0.1/node0 //配置连接节点的绝对路径 ... ``` @@ -140,7 +147,6 @@ http://{deployIP}:{frontPort}/WeBASE-Front 在dist目录查看: ``` -前置服务全量日志:tail -f log/WeBASE-Front.log -前置服务错误日志:tail -f log/WeBASE-Front.log +前置服务日志:tail -f log/WeBASE-Front.log web3连接日志:tail -f log/web3sdk.log ``` \ No newline at end of file diff --git a/docs/WeBASE-Front/interface.md b/docs/WeBASE-Front/interface.md index 92f2565f..6225c52f 100644 --- a/docs/WeBASE-Front/interface.md +++ b/docs/WeBASE-Front/interface.md @@ -1663,7 +1663,9 @@ http://localhost:5002/WeBASE-Front/1/web3/blockNumber #### 响应参数 **1)数据格式** ``` -232 +{ + 8346 +} ``` @@ -1694,7 +1696,7 @@ HTTP GET **2)数据格式** ``` -http://localhost:5002/WeBASE-Front/1/web3/blockByNumber/2 +http://localhost:5002/WeBASE-Front/1/web3/blockByNumber/100 ``` #### 响应参数 @@ -1702,64 +1704,66 @@ http://localhost:5002/WeBASE-Front/1/web3/blockByNumber/2 **1)数据格式** ``` { - "number": 2, - "hash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "parentHash": "0x489ee0c00527879f7e2470bde7b62e9ea30fadb242bcbd9ba582d0dee4958e2f", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "transactionsRoot": "0xade02313d3200f38dfc18cdc368241cf4c1cb7e72011edf847ec216efa43a99e", - "receiptsRoot": "0xb7c4b856c9335bd345c0b022057567a2223218e7a7dab822981467b29ac1e326", - "dbHash": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "stateRoot": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "sealer": "0x2", - "sealerList": [ - "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f", - "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7", - "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39", - "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d" - ], - "extraData": [], - "gasLimit": "0", - "gasUsed": "0", - "timestamp": "1619424150450", - "signatureList": [ - { - "index": "0x1", - "signature": "0xa05b5d220e41051fa80f212884d9cdda3a8973a4ac2d2dc74e42db32b459e5f595a61e30266f0e8bf7edb065ff107c6af5e6349f9ae518146dc686406ebbade165bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7" - }, - { - "index": "0x3", - "signature": "0x48bb622e24b18f4eb601137d44b5d86e2c287be3aa849dce1768e87e75308ba69391e62f90d76bf84b9b6eb1509d11409f9b784bc7b052458a4596b81961fac8fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d" - }, - { - "index": "0x2", - "signature": "0x3a3cc8c20c5cdbb6431ec1f749d94662670e87442debef119a4e6469ccb16a60a152d32754ab833efa513839b076c2aa1ceb7e536db3734b740e9192b10ee38695efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39" - } - ], - "transactions": [ - { - "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "blockNumber": 2, - "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d", - "gas": "0x419ce0", - "hash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429", - "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029", - "nonce": "0x3460c30bd3e4e88a31d6d033b3a172859bf003258e9606fd63fb0d91f91f4e6", - "to": "0x0000000000000000000000000000000000000000", - "transactionIndex": "0x0", - "value": "0x0", - "gasPrice": "0x51f4d5c00", - "blockLimit": "0x1f5", - "chainId": "0x1", - "groupId": "0x1", - "extraData": "0x", - "signature": { - "r": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462b", - "s": "0xd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124", - "v": "0xc7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7", - "signature": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462bd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124c7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7" - } + "code": 0, + "message": "success", + "data": { + "number": 100, + "hash": "0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade", + "parentHash": "0xc784a2af86e6726fcdc63b57ed1b91a40efc7d8b1b7285154d399ea78bd18754", + "nonce": 0, + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000040000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000800000000000000000000000000", + "transactionsRoot": "0x27055bac669a67e8aaa1455ad9fd70b75dd86dc905c6bd0d111ed67ab182d1dc", + "stateRoot": "0xa05ad5db11b8be6aed3b591f2f64fdbb241506cbe9ef591f3a4b946ca777f838", + "receiptsRoot": "0xc1d4b43ed68d7263ddf50861feec26440e933a0b152917e938194f5079b48ce4", + "author": "0x0000000000000000000000000000000000000000", + "miner": "0x0000000000000000000000000000000000000000", + "mixHash": null, + "difficulty": 1, + "totalDifficulty": 101, + "extraData": "0xd98097312e332e302b2b302d524c696e75782f672b2b2f496e74", + "size": 71, + "gasLimit": 2000000000, + "gasUsed": 121038, + "timestamp": 1526437108478, + "transactions": [ + { + "hash": "0xb2c733b742045e61c0fd6e7e2bafece04d56262a4887de9f78dad2c5dd2f944b", + "nonce": 9.1623055443573E+74, + "blockHash": "0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade", + "blockNumber": 100, + "transactionIndex": 0, + "from": "0x59bd3815f73b197d6ef327f2a45089f50aba942a", + "to": "0x986278eb8e8b4ef98bdfc055c02d65865fc87ad2", + "value": 0, + "gasPrice": 30000000, + "gas": 30000000, + "input": "0x48f85bce000000000000000000000000000000000000000000000000000000000000001caf3fbec3675eabb85c0b25e2992d6f0a5e1546dad85c20733fdb27cfa4ca782a5fdfb621b416f3494c7d8ca436c12309884550d402ea79f03ef8ddfdd494f7a4", + "creates": null, + "publicKey": null, + "raw": null, + "r": null, + "s": null, + "v": 0, + "valueRaw": "0x0", + "gasPriceRaw": "0x1c9c380", + "gasRaw": "0x1c9c380", + "blockNumberRaw": "0x64", + "transactionIndexRaw": "0x0", + "nonceRaw": "0x2069170146129593df177e2c37f1b7fe74e2d0fda53dcbbca34a243d46e367a" + } + ], + "uncles": [], + "sealFields": null, + "gasUsedRaw": "0x1d8ce", + "totalDifficultyRaw": "0x65", + "numberRaw": "0x64", + "nonceRaw": null, + "sizeRaw": "0x47", + "gasLimitRaw": "0x77359400", + "timestampRaw": "0x16366bddafe", + "difficultyRaw": "0x1" } - ] } ``` ### 3.3. 根据块hash获取块信息接口 @@ -1789,72 +1793,74 @@ HTTP GET **2)数据格式** ``` -http://localhost:5002/WeBASE-Front/1/web3/blockByHash/0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625 +http://localhost:5002/WeBASE-Front/1/web3/blockByHash/0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade ``` #### 响应参数 **1)数据格式** ``` -{{ - "number": 2, - "hash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "parentHash": "0x489ee0c00527879f7e2470bde7b62e9ea30fadb242bcbd9ba582d0dee4958e2f", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "transactionsRoot": "0xade02313d3200f38dfc18cdc368241cf4c1cb7e72011edf847ec216efa43a99e", - "receiptsRoot": "0xb7c4b856c9335bd345c0b022057567a2223218e7a7dab822981467b29ac1e326", - "dbHash": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "stateRoot": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "sealer": "0x2", - "sealerList": [ - "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f", - "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7", - "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39", - "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d" - ], - "extraData": [], - "gasLimit": "0", - "gasUsed": "0", - "timestamp": "1619424150450", - "signatureList": [ - { - "index": "0x1", - "signature": "0xa05b5d220e41051fa80f212884d9cdda3a8973a4ac2d2dc74e42db32b459e5f595a61e30266f0e8bf7edb065ff107c6af5e6349f9ae518146dc686406ebbade165bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7" - }, - { - "index": "0x3", - "signature": "0x48bb622e24b18f4eb601137d44b5d86e2c287be3aa849dce1768e87e75308ba69391e62f90d76bf84b9b6eb1509d11409f9b784bc7b052458a4596b81961fac8fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d" - }, - { - "index": "0x2", - "signature": "0x3a3cc8c20c5cdbb6431ec1f749d94662670e87442debef119a4e6469ccb16a60a152d32754ab833efa513839b076c2aa1ceb7e536db3734b740e9192b10ee38695efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39" - } - ], - "transactions": [ - { - "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "blockNumber": 2, - "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d", - "gas": "0x419ce0", - "hash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429", - "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029", - "nonce": "0x3460c30bd3e4e88a31d6d033b3a172859bf003258e9606fd63fb0d91f91f4e6", - "to": "0x0000000000000000000000000000000000000000", - "transactionIndex": "0x0", - "value": "0x0", - "gasPrice": "0x51f4d5c00", - "blockLimit": "0x1f5", - "chainId": "0x1", - "groupId": "0x1", - "extraData": "0x", - "signature": { - "r": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462b", - "s": "0xd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124", - "v": "0xc7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7", - "signature": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462bd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124c7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7" - } +{ + "code": 0, + "message": "success", + "data": { + "number": 100, + "hash": "0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade", + "parentHash": "0xc784a2af86e6726fcdc63b57ed1b91a40efc7d8b1b7285154d399ea78bd18754", + "nonce": 0, + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000040000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000800000000000000000000000000", + "transactionsRoot": "0x27055bac669a67e8aaa1455ad9fd70b75dd86dc905c6bd0d111ed67ab182d1dc", + "stateRoot": "0xa05ad5db11b8be6aed3b591f2f64fdbb241506cbe9ef591f3a4b946ca777f838", + "receiptsRoot": "0xc1d4b43ed68d7263ddf50861feec26440e933a0b152917e938194f5079b48ce4", + "author": "0x0000000000000000000000000000000000000000", + "miner": "0x0000000000000000000000000000000000000000", + "mixHash": null, + "difficulty": 1, + "totalDifficulty": 101, + "extraData": "0xd98097312e332e302b2b302d524c696e75782f672b2b2f496e74", + "size": 71, + "gasLimit": 2000000000, + "gasUsed": 121038, + "timestamp": 1526437108478, + "transactions": [ + { + "hash": "0xb2c733b742045e61c0fd6e7e2bafece04d56262a4887de9f78dad2c5dd2f944b", + "nonce": 9.1623055443573E+74, + "blockHash": "0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade", + "blockNumber": 100, + "transactionIndex": 0, + "from": "0x59bd3815f73b197d6ef327f2a45089f50aba942a", + "to": "0x986278eb8e8b4ef98bdfc055c02d65865fc87ad2", + "value": 0, + "gasPrice": 30000000, + "gas": 30000000, + "input": "0x48f85bce000000000000000000000000000000000000000000000000000000000000001caf3fbec3675eabb85c0b25e2992d6f0a5e1546dad85c20733fdb27cfa4ca782a5fdfb621b416f3494c7d8ca436c12309884550d402ea79f03ef8ddfdd494f7a4", + "creates": null, + "publicKey": null, + "raw": null, + "r": null, + "s": null, + "v": 0, + "valueRaw": "0x0", + "gasPriceRaw": "0x1c9c380", + "gasRaw": "0x1c9c380", + "blockNumberRaw": "0x64", + "transactionIndexRaw": "0x0", + "nonceRaw": "0x2069170146129593df177e2c37f1b7fe74e2d0fda53dcbbca34a243d46e367a" + } + ], + "uncles": [], + "sealFields": null, + "gasUsedRaw": "0x1d8ce", + "totalDifficultyRaw": "0x65", + "numberRaw": "0x64", + "nonceRaw": null, + "sizeRaw": "0x47", + "gasLimitRaw": "0x77359400", + "timestampRaw": "0x16366bddafe", + "difficultyRaw": "0x1" } - ] } ``` @@ -1892,7 +1898,9 @@ http://localhost:5002/WeBASE-Front/1/web3/blockTransCnt/100 **1)数据格式** ``` -2 +{ + 1 +} ``` ### 3.5. 获取PbftView接口 @@ -1961,7 +1969,7 @@ HTTP GET **2)数据格式** ``` -http://localhost:5002/WeBASE-Front/1/web3/transactionReceipt/0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429 +http://localhost:5002/WeBASE-Front/1/web3/transactionReceipt/0xb2c733b742045e61c0fd6e7e2bafece04d56262a4887de9f78dad2c5dd2f944b ``` #### 响应参数 @@ -1970,25 +1978,43 @@ http://localhost:5002/WeBASE-Front/1/web3/transactionReceipt/0x69ced0162a0c3892e ``` { - "transactionHash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429", - "transactionIndex": "0x0", - "root": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "blockNumber": "2", - "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d", - "to": "0x0000000000000000000000000000000000000000", - "gasUsed": "316449", - "contractAddress": "0xa8af0ee580d8af674a60341030ddbc45431bc235", - "logs": [], - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "status": "0x0", - "statusMsg": "None", - "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029", - "output": "0x", - "txProof": null, - "receiptProof": null, - "message": null, - "statusOK": true + "transactionHash": "0xb2c733b742045e61c0fd6e7e2bafece04d56262a4887de9f78dad2c5dd2f944b", + "transactionIndex": 0, + "blockHash": "0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade", + "blockNumber": 100, + "cumulativeGasUsed": 121038, + "gasUsed": 121038, + "contractAddress": "0x0000000000000000000000000000000000000000", + "root": null, + "from": null, + "to": null, + "logs": [ + { + "removed": false, + "logIndex": 0, + "transactionIndex": 0, + "transactionHash": "0xb2c733b742045e61c0fd6e7e2bafece04d56262a4887de9f78dad2c5dd2f944b", + "blockHash": "0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade", + "blockNumber": 100, + "address": "0x986278eb8e8b4ef98bdfc055c02d65865fc87ad2", + "data": "0x00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000001caf3fbec3675eabb85c0b25e2992d6f0a5e1546dad85c20733fdb27cfa4ca782a5fdfb621b416f3494c7d8ca436c12309884550d402ea79f03ef8ddfdd494f7a40000000000000000000000000000000000000000000000000000000000000040666164363863656230616530316530643731616635356331316561643031613532656638363435343866306134643133633836363164393664326461366239380000000000000000000000000000000000000000000000000000000000000002363000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000023630000000000000000000000000000000000000000000000000000000000000", + "type": "mined", + "topics": [ + "0xbf474e795141390215f4f179557402a28c562b860f7b74dce4a3c0e0604cd97e" + ], + "logIndexRaw": "0", + "blockNumberRaw": "100", + "transactionIndexRaw": "0" + } + ], + "logsBloom": null, + "gasUsedRaw": "0x1d8ce", + "blockNumberRaw": "100", + "transactionIndexRaw": "0", + "cumulativeGasUsedRaw": "0x1d8ce", + "message": null, + "txProof": null, + "receiptProof": null } ``` @@ -2019,7 +2045,7 @@ HTTP GET **2)数据格式** ``` -http://localhost:5002/WeBASE-Front/1/web3/transaction/0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429 +http://localhost:5002/WeBASE-Front/1/web3/transaction/0xa6750b812b1a7e36313879b09f0c41fc583b463c15e57608416f3a32688b432b ``` #### 响应参数 @@ -2028,27 +2054,29 @@ http://localhost:5002/WeBASE-Front/1/web3/transaction/0x69ced0162a0c3892e4eaa309 **1)数据格式** ``` { - "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "blockNumber": 2, - "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d", - "gas": "4300000", - "hash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429", - "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029", - "nonce": "0x3460c30bd3e4e88a31d6d033b3a172859bf003258e9606fd63fb0d91f91f4e6", - "to": "0x0000000000000000000000000000000000000000", - "transactionIndex": "0x0", - "value": "0x0", - "gasPrice": "22000000000", - "blockLimit": "0x1f5", - "chainId": "0x1", - "groupId": "1", - "extraData": "0x", - "signature": { - "r": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462b", - "s": "0xd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124", - "v": "0xc7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7", - "signature": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462bd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124c7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7" - } + "hash": "0xb2c733b742045e61c0fd6e7e2bafece04d56262a4887de9f78dad2c5dd2f944b", + "nonce": 9.1623055443573E+74, + "blockHash": "0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade", + "blockNumber": 100, + "transactionIndex": 0, + "from": "0x59bd3815f73b197d6ef327f2a45089f50aba942a", + "to": "0x986278eb8e8b4ef98bdfc055c02d65865fc87ad2", + "value": 0, + "gasPrice": 30000000, + "gas": 30000000, + "input": "0x48f85bce000000000000000000000000000000000000000000000000000000000000001caf3fbec3675eabb85c0b25e2992d6f0a5e1546dad85c20733fdb27cfa4ca782a5fdfb621b416f3494c7d8ca436c12309884550d402ea79f03ef8ddfdd494f7a4", + "creates": null, + "publicKey": null, + "raw": null, + "r": null, + "s": null, + "v": 0, + "nonceRaw": "0x2069170146129593df177e2c37f1b7fe74e2d0fda53dcbbca34a243d46e367a", + "blockNumberRaw": "0x64", + "transactionIndexRaw": "0x0", + "valueRaw": "0x0", + "gasPriceRaw": "0x1c9c380", + "gasRaw": "0x1c9c380" } ``` @@ -2090,13 +2118,11 @@ http://localhost:5002/WeBASE-Front/1/web3/clientVersion **2)数据格式** ``` { - "FISCO-BCOS Version": "2.7.2 gm", - "Supported Version": "2.7.2", - "Chain Id": "1", - "Build Time": "20210201 10:03:03", - "Build Type": "Linux/clang/Release", - "Git Branch": "HEAD", - "Git Commit Hash": "4c8a5bbe44c19db8a002017ff9dbb16d3d28e9da" + "Build Time": "20190318 10:56:37", + "Build Type": "Linux/g++/RelWithDebInfo", + "FISCO-BCOS Version": "2.0.0-rc1", + "Git Branch": "master", + "Git Commit Hash": "2467ddf73b091bc8e0ee611ccee85db7989ad389" } ``` @@ -2219,7 +2245,7 @@ HTTP GET **2)数据格式** ``` -http://localhost:5002/WeBASE-Front/1/web3/transByBlockHashAndIndex/0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429/0 +http://localhost:5002/WeBASE-Front/1/web3/transByBlockHashAndIndex/0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade/0 ``` #### 响应参数 @@ -2228,27 +2254,29 @@ http://localhost:5002/WeBASE-Front/1/web3/transByBlockHashAndIndex/0x69ced0162a0 ``` { - "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "blockNumber": 2, - "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d", - "gas": "4300000", - "hash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429", - "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029", - "nonce": "0x3460c30bd3e4e88a31d6d033b3a172859bf003258e9606fd63fb0d91f91f4e6", - "to": "0x0000000000000000000000000000000000000000", - "transactionIndex": "0x0", - "value": "0x0", - "gasPrice": "22000000000", - "blockLimit": "0x1f5", - "chainId": "0x1", - "groupId": "1", - "extraData": "0x", - "signature": { - "r": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462b", - "s": "0xd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124", - "v": "0xc7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7", - "signature": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462bd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124c7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7" - } + "hash": "0x7c503f202a5e275d8792dd2419ac48418dbec602038fb2a85c899403471f065d", + "nonce": 1.26575985412899E+75, + "blockHash": "0x0d9ed7b20645d5b8200347a72e7fb15347b83d74c6e1b6c3995cdb7a849f95d9", + "blockNumber": 100, + "transactionIndex": 0, + "from": "0x6f00a620a61fd6b33e6076880fecc49959eaa4ea", + "to": "0x9cb5641d991df690ed905c34f9aaf22370034220", + "value": 0, + "gasPrice": 1, + "gas": 100000000, + "input": "0x4ed3885e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000016100000000000000000000000000000000000000000000000000000000000000", + "creates": null, + "publicKey": null, + "raw": null, + "r": null, + "s": null, + "v": 0, + "blockNumberRaw": "0x64", + "nonceRaw": "0x2cc650a5cbeb268577ac15c7dd2afee0680901de94f8543e86e906247e7edbf", + "valueRaw": "0x0", + "gasPriceRaw": "0x1", + "gasRaw": "0x5f5e100", + "transactionIndexRaw": "0x0" } ``` @@ -2280,7 +2308,7 @@ HTTP GET **2)数据格式** ``` -http://localhost:5002/WeBASE-Front/1/web3/transByBlockNumberAndIndex/2/0 +http://localhost:5002/WeBASE-Front/1/web3/transByBlockNumberAndIndex/100/0 ``` #### 响应参数 @@ -2288,27 +2316,29 @@ http://localhost:5002/WeBASE-Front/1/web3/transByBlockNumberAndIndex/2/0 **1)数据格式** ``` { - "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "blockNumber": 2, - "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d", - "gas": "4300000", - "hash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429", - "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029", - "nonce": "0x3460c30bd3e4e88a31d6d033b3a172859bf003258e9606fd63fb0d91f91f4e6", - "to": "0x0000000000000000000000000000000000000000", - "transactionIndex": "0x0", - "value": "0x0", - "gasPrice": "22000000000", - "blockLimit": "0x1f5", - "chainId": "0x1", - "groupId": "1", - "extraData": "0x", - "signature": { - "r": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462b", - "s": "0xd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124", - "v": "0xc7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7", - "signature": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462bd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124c7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7" - } + "hash": "0x7c503f202a5e275d8792dd2419ac48418dbec602038fb2a85c899403471f065d", + "nonce": 1.26575985412899E+75, + "blockHash": "0x0d9ed7b20645d5b8200347a72e7fb15347b83d74c6e1b6c3995cdb7a849f95d9", + "blockNumber": 100, + "transactionIndex": 0, + "from": "0x6f00a620a61fd6b33e6076880fecc49959eaa4ea", + "to": "0x9cb5641d991df690ed905c34f9aaf22370034220", + "value": 0, + "gasPrice": 1, + "gas": 100000000, + "input": "0x4ed3885e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000016100000000000000000000000000000000000000000000000000000000000000", + "creates": null, + "publicKey": null, + "raw": null, + "r": null, + "s": null, + "v": 0, + "blockNumberRaw": "0x64", + "nonceRaw": "0x2cc650a5cbeb268577ac15c7dd2afee0680901de94f8543e86e906247e7edbf", + "valueRaw": "0x0", + "gasPriceRaw": "0x1", + "gasRaw": "0x5f5e100", + "transactionIndexRaw": "0x0" } ``` @@ -2345,54 +2375,49 @@ http://localhost:5002/WeBASE-Front/1/web3/consensusStatus **1)数据格式** ``` -{ - "baseConsensusInfo": { - "nodeNum": "4", - "consensusedBlockNumber": "233", - "highestblockNumber": "232", - "groupId": "1", - "protocolId": "65544", - "accountType": "1", - "cfgErr": "false", - "omitEmptyBlock": "true", - "nodeId": "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d", - "allowFutureBlocks": "true", - "connectedNodes": "3", - "currentView": "102303", - "toView": "102303", - "leaderFailed": "false", - "highestblockHash": "0x7f0885a7188bd5c1b3f8c182e00be0e63a3b1653b12752cf8501ddac995e6efc", - "leaderId": null, - "leaderIdx": null, - "node_index": "3", - "node index": null, - "max_faulty_leader": "1", - "sealer.": [ - "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f", - "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7", - "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39", - "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d" - ] - }, - "viewInfos": [ - { - "nodeId": "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f", - "view": "102300" - }, - { - "nodeId": "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7", - "view": "102301" - }, +[ { - "nodeId": "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39", - "view": "102302" + "accountType": 1, + "allowFutureBlocks": true, + "cfgErr": false, + "connectedNodes": 3, + "consensusedBlockNumber": 126, + "currentView": 499824, + "groupId": 1, + "highestblockHash": "0x563d4ec57b597d5d81f0c1b0045c04e57ffebe3a02ff3fef402be56742dc8fd1", + "highestblockNumber": 125, + "leaderFailed": false, + "max_faulty_leader": 1, + "node index": 2, + "nodeId": "d822165959a0ed217df6541f1a7dd38b79336ff571dd5f8f85ad76f3e7ec097e1eabd8b03e4a757fd5a9fb0eea905aded56aaf44df83c34b73acb9ab7ac65010", + "nodeNum": 4, + "omitEmptyBlock": true, + "protocolId": 264, + "sealer.0": "552398be0eef124c000e632b0b76a48c52b6cfbd547d92c15527c2d1df15fab2bcded48353db22526c3540e4ab2027630722889f20a4a614bb11a7887a85941b", + "sealer.1": "adfa2f9116d7ff68e0deb75307fa1595d636bf097ad1de4fb55cff00e4fef40b453abb30388aa2112bf5cd4c987afe2e047250f7049791aa1ee7091c9e2ab7bb", + "sealer.2": "d822165959a0ed217df6541f1a7dd38b79336ff571dd5f8f85ad76f3e7ec097e1eabd8b03e4a757fd5a9fb0eea905aded56aaf44df83c34b73acb9ab7ac65010", + "sealer.3": "dde0bbf5eb3a731e6da861586e98e088e16e6fdd9afae2f2c213cead20a4f5eaa3910042b70d62266d2350d98a43c1f235c8e0da384448384893857873abdb75", + "toView": 499824 }, - { - "nodeId": "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d", - "view": "102303" - } - ] -} + [ + { + "nodeId": "552398be0eef124c000e632b0b76a48c52b6cfbd547d92c15527c2d1df15fab2bcded48353db22526c3540e4ab2027630722889f20a4a614bb11a7887a85941b", + "view": 499823 + }, + { + "nodeId": "adfa2f9116d7ff68e0deb75307fa1595d636bf097ad1de4fb55cff00e4fef40b453abb30388aa2112bf5cd4c987afe2e047250f7049791aa1ee7091c9e2ab7bb", + "view": 499820 + }, + { + "nodeId": "d822165959a0ed217df6541f1a7dd38b79336ff571dd5f8f85ad76f3e7ec097e1eabd8b03e4a757fd5a9fb0eea905aded56aaf44df83c34b73acb9ab7ac65010", + "view": 499824 + }, + { + "nodeId": "dde0bbf5eb3a731e6da861586e98e088e16e6fdd9afae2f2c213cead20a4f5eaa3910042b70d62266d2350d98a43c1f235c8e0da384448384893857873abdb75", + "view": 499822 + } + ] +] ``` ### 3.14. 获取节点状态列表接口 @@ -2441,32 +2466,18 @@ http://localhost:5002/WeBASE-Front/1/web3/getNodeStatusList ``` [ { - "nodeId": "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f", - "blockNumber": 232, - "pbftView": 101224, - "status": 1, - "latestStatusUpdateTime": "2021-07-08 15:42:01" - }, - { - "nodeId": "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7", - "blockNumber": 232, - "pbftView": 101221, - "status": 1, - "latestStatusUpdateTime": "2021-07-08 15:42:01" - }, - { - "nodeId": "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39", - "blockNumber": 232, - "pbftView": 101222, + "nodeId": "2917803543bcb58ad91cdf67e7b576a5b0440b4f76e6f5440edb8b09dadee297174d25133e841a17e4f89aa59bbaf4c80896af9d6a978aae04b3d0b9cd9d5b84", + "blockNumber": 3, + "pbftView": 146093, "status": 1, - "latestStatusUpdateTime": "2021-07-08 15:42:01" + "latestStatusUpdateTime": "2019-07-25 10:07:07" }, { - "nodeId": "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d", - "blockNumber": 232, - "pbftView": 101225, + "nodeId": "8722cc018a79bc48b7408649fac4a45bd336a88959570ebba15eefb48fdc23b8a96f328d46852f3d12c4dde7346c573585386fadb5568ce1820144c106af1f72", + "blockNumber": 3, + "pbftView": 146095, "status": 1, - "latestStatusUpdateTime": "2021-07-08 15:42:01" + "latestStatusUpdateTime": "2019-07-25 10:07:07" } ] ``` @@ -2624,31 +2635,36 @@ http://localhost:5002/WeBASE-Front/1/web3/peers **1)数据格式** ``` [ - { - "NodeID": "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f", - "IPAndPort": "127.0.0.1:65030", - "Agency": "agencyA_son", - "Topic": [], - "Node": "node2" - }, - { - "NodeID": "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39", - "IPAndPort": "127.0.0.1:65014", - "Agency": "agencyA_son", - "Topic": [], - "Node": "node3" - }, - { - "NodeID": "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7", - "IPAndPort": "127.0.0.1:65022", - "Agency": "agencyA_son", - "Topic": [ - "_block_notify_1", - "_block_notify_2", - "_block_notify_2147483647" - ], - "Node": "node1" - } + { + "ipandPort": "127.0.0.1:30301", + "IPAndPort": "127.0.0.1:30301", + "NodeID": "adfa2f9116d7ff68e0deb75307fa1595d636bf097ad1de4fb55cff00e4fef40b453abb30388aa2112bf5cd4c987afe2e047250f7049791aa1ee7091c9e2ab7bb", + "Topic": [] + }, + { + "ipandPort": "127.0.0.1:57678", + "IPAndPort": "127.0.0.1:57678", + "NodeID": "e28f3d7f5b82e21918a15639eac342dcf678ebb0efe7c65c76514b0ba6b28ace8e47b4a25c9b3f9763b79db847e250a19f827b132f230298980f3ca9779c2564", + "Topic": [] + }, + { + "ipandPort": "127.0.0.1:57608", + "IPAndPort": "127.0.0.1:57608", + "NodeID": "dde0bbf5eb3a731e6da861586e98e088e16e6fdd9afae2f2c213cead20a4f5eaa3910042b70d62266d2350d98a43c1f235c8e0da384448384893857873abdb75", + "Topic": [] + }, + { + "ipandPort": "127.0.0.1:57616", + "IPAndPort": "127.0.0.1:57616", + "NodeID": "552398be0eef124c000e632b0b76a48c52b6cfbd547d92c15527c2d1df15fab2bcded48353db22526c3540e4ab2027630722889f20a4a614bb11a7887a85941b", + "Topic": [] + }, + { + "ipandPort": "127.0.0.1:57670", + "IPAndPort": "127.0.0.1:57670", + "NodeID": "56edfaf60bcb09b9814ad31dcd959eb388f0314445db3deb92cedde97c0ecec210f713591a15f3a7168ba023290cfbe78656b57c37157e6ec74a85182630bd61", + "Topic": [] + } ] ``` @@ -2758,7 +2774,7 @@ HTTP GET **2)数据格式** ``` -http://localhost:5002/WeBASE-Front/1/web3/search?input=123 +http://localhost:5002/WeBASE-Front/1/web3/search?input=1 ``` #### 响应参数 @@ -2766,64 +2782,62 @@ http://localhost:5002/WeBASE-Front/1/web3/search?input=123 **1)数据格式** ``` { - "number": 123, - "hash": "0xa12a4a8d26a15fcff6f67acf94a3fb2c08d4476806009be40fe4026fd622419d", - "parentHash": "0x898c6b1657d4eb26307b39f248e471498975eb820671c7540fa516e6c7b411e8", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "transactionsRoot": "0xa94acacd692cf3b23e19b429ce89c2016020b2264854fd609ba2b16f0c7d5f73", - "receiptsRoot": "0x9529b51c1f7ddd178ffd4a65d146b50cfc0beb405a808677dfddd694cf555a09", - "dbHash": "0x3047354b6776fd1f02911f2c4fc4aa1b215b3df53cc7504a71b5f3bfe12eca3a", - "stateRoot": "0x3047354b6776fd1f02911f2c4fc4aa1b215b3df53cc7504a71b5f3bfe12eca3a", - "sealer": "0x1", - "sealerList": [ - "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f", - "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7", - "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39", - "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d" - ], - "extraData": [], - "gasLimit": "0", - "gasUsed": "0", - "timestamp": "1621928850887", - "signatureList": [ - { - "index": "0x3", - "signature": "0x8549a8adddb9ff2d8d472b7a65ca414a7f10519f59e11244b9e92fed2e30f29cc272938a695ebb1ead579bdaed401b6aa31395890139abe406518471efa55d6afe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d" - }, - { - "index": "0x1", - "signature": "0x0ff480d6c3fe5908c554653376492cba23cfc938bc0847298c9c8b4c140b417be1990d25c0239f9b18e24276e864e1f2ac4beab47ddf5277a767bb7c93e143ed65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7" - }, - { - "index": "0x2", - "signature": "0x50aa1513c390e5e61221418aa46f8dd45e3ce6e8c0a6fa5aa75650517560589590172b1e6cc64e9ba7ab45c964ff925524cecf6c2be0a28ea11426febb69305195efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39" - } - ], - "transactions": [ - { - "blockHash": "0xa12a4a8d26a15fcff6f67acf94a3fb2c08d4476806009be40fe4026fd622419d", - "blockNumber": 123, - "from": "0x1cd8126354aa951dc8ed083ed91fd31fad1f50d8", - "gas": "0x5f5e100", - "hash": "0xbe858390cf0bd94f9d17c6ab5e04a7d354f9482f2568f067bdc2529a0af324db", - "input": "0x25e85d16000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000803935656661666135313937373936653765646636343731393164653833663432353964376362623036306634626163353836386265343734303337663439313434643538316331356438616566396230376437386631383034316135663433633363323633353265626266353538336364323330373033353863386662613339", - "nonce": "0x1479caf2ff5f1a6121beac93c85b59c36280ffe6a7f124cbc3d232021fa3307", - "to": "0x0000000000000000000000000000000000001003", - "transactionIndex": "0x0", - "value": "0x0", - "gasPrice": "0x1", - "blockLimit": "0x26e", - "chainId": "0x1", - "groupId": "0x1", - "extraData": "0x", - "signature": { - "r": "0x36edc104cc5c2c5c992f9804bd3415378f93c18ebc9cdeb7794c08b1c95fd7ad", - "s": "0xed555fe3a192acc5ea01951f7286f93cff3471e84731a2942968a2fd9a9a14bc", - "v": "0xd3a0fac51c66adf23bfccc6bb3aaa3d3623040912963ceb818ca2d8b1fb649c64bce64d99a8d9a39158b2c713101dbca10a478131dcae7e42d156e0e69455652", - "signature": "0x36edc104cc5c2c5c992f9804bd3415378f93c18ebc9cdeb7794c08b1c95fd7aded555fe3a192acc5ea01951f7286f93cff3471e84731a2942968a2fd9a9a14bcd3a0fac51c66adf23bfccc6bb3aaa3d3623040912963ceb818ca2d8b1fb649c64bce64d99a8d9a39158b2c713101dbca10a478131dcae7e42d156e0e69455652" - } - } - ] + "number": 1, + "hash": "0x3875dbec6e0ad0790dc0a0e8535b7c286ef7cee4149e5b1494f5c65631a9e321", + "parentHash": "0xed3350d191d23cbc609c98e920baa583403b9a02fa934df868e7f425cd72f5c3", + "nonce": 0, + "sha3Uncles": null, + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "transactionsRoot": "0xa3db8478e08931f8967023a60d260b182d828aad959433e0b77f097d7650b742", + "stateRoot": "0xf32d3e504fc8813c139d1f6f61ae1c8e355502e10b9ea24e5ad5d3ada01ea400", + "receiptsRoot": null, + "author": null, + "sealer": "0x0", + "mixHash": null, + "difficulty": 0, + "totalDifficulty": 0, + "extraData": [], + "size": 0, + "gasLimit": 0, + "gasUsed": 0, + "timestamp": 1557304350431, + "transactions": [ + { + "hash": "0x4145b921309fcaa92b05b782e0181d671b8e68fc6d61d939358ed558fa3489c9", + "nonce": 1.47418536037145E+75, + "blockHash": "0x3875dbec6e0ad0790dc0a0e8535b7c286ef7cee4149e5b1494f5c65631a9e321", + "blockNumber": 1, + "transactionIndex": 0, + "from": "0x33a41878e78fb26735bf425f9328990e3a1a89df", + "to": null, + "value": 0, + "gasPrice": 1, + "gas": 100000000, + "input": "0x6080604052348015600f57600080fd5b5060868061001e6000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806335b09a6e146044575b600080fd5b348015604f57600080fd5b5060566058565b005b5600a165627a7a723058204aacdb57d6f2ae0f7f6c89c28236bba0205631183fd99785de220481566e683f0029", + "creates": null, + "publicKey": null, + "raw": null, + "r": null, + "s": null, + "v": 0, + "nonceRaw": "0x3425bfe0f36e343686ccbe34a4fe8b05e0e0257ea7ee87417a6d898f0eb43ec", + "transactionIndexRaw": "0x0", + "blockNumberRaw": "0x1", + "valueRaw": "0x0", + "gasPriceRaw": "0x1", + "gasRaw": "0x5f5e100" + } + ], + "uncles": null, + "sealFields": null, + "nonceRaw": null, + "numberRaw": "0x1", + "difficultyRaw": null, + "totalDifficultyRaw": null, + "sizeRaw": null, + "gasLimitRaw": "0x0", + "gasUsedRaw": "0x0", + "timestampRaw": "0x16a969296df" } ``` @@ -2861,35 +2875,33 @@ http://localhost:5002/WeBASE-Front/1/web3/syncStatus **1)数据格式** ``` { - "isSyncing": "false", - "protocolId": "65545", - "genesisHash": "1caec77e0ff42af4f045af2ba5503c775c33430085b246374cdd23d1c9191173", - "nodeId": "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d", - "blockNumber": "232", - "latestHash": "7f0885a7188bd5c1b3f8c182e00be0e63a3b1653b12752cf8501ddac995e6efc", - "knownHighestNumber": "232", - "txPoolSize": "0", - "peers": [ - { - "nodeId": "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f", - "genesisHash": "1caec77e0ff42af4f045af2ba5503c775c33430085b246374cdd23d1c9191173", - "blockNumber": "232", - "latestHash": "7f0885a7188bd5c1b3f8c182e00be0e63a3b1653b12752cf8501ddac995e6efc" - }, - { - "nodeId": "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7", - "genesisHash": "1caec77e0ff42af4f045af2ba5503c775c33430085b246374cdd23d1c9191173", - "blockNumber": "232", - "latestHash": "7f0885a7188bd5c1b3f8c182e00be0e63a3b1653b12752cf8501ddac995e6efc" - }, - { - "nodeId": "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39", - "genesisHash": "1caec77e0ff42af4f045af2ba5503c775c33430085b246374cdd23d1c9191173", - "blockNumber": "232", - "latestHash": "7f0885a7188bd5c1b3f8c182e00be0e63a3b1653b12752cf8501ddac995e6efc" - } - ], - "knownLatestHash": "7f0885a7188bd5c1b3f8c182e00be0e63a3b1653b12752cf8501ddac995e6efc" + "blockNumber": 126, + "genesisHash": "0xed3350d191d23cbc609c98e920baa583403b9a02fa934df868e7f425cd72f5c3", + "isSyncing": false, + "latestHash": "0x49ca6eb004f372c71ed900ec6992582cd107e4f3ea36aaa5a0a78829ebef1f14", + "nodeId": "d822165959a0ed217df6541f1a7dd38b79336ff571dd5f8f85ad76f3e7ec097e1eabd8b03e4a757fd5a9fb0eea905aded56aaf44df83c34b73acb9ab7ac65010", + "peers": [ + { + "blockNumber": 126, + "genesisHash": "0xed3350d191d23cbc609c98e920baa583403b9a02fa934df868e7f425cd72f5c3", + "latestHash": "0x49ca6eb004f372c71ed900ec6992582cd107e4f3ea36aaa5a0a78829ebef1f14", + "nodeId": "552398be0eef124c000e632b0b76a48c52b6cfbd547d92c15527c2d1df15fab2bcded48353db22526c3540e4ab2027630722889f20a4a614bb11a7887a85941b" + }, + { + "blockNumber": 126, + "genesisHash": "0xed3350d191d23cbc609c98e920baa583403b9a02fa934df868e7f425cd72f5c3", + "latestHash": "0x49ca6eb004f372c71ed900ec6992582cd107e4f3ea36aaa5a0a78829ebef1f14", + "nodeId": "adfa2f9116d7ff68e0deb75307fa1595d636bf097ad1de4fb55cff00e4fef40b453abb30388aa2112bf5cd4c987afe2e047250f7049791aa1ee7091c9e2ab7bb" + }, + { + "blockNumber": 126, + "genesisHash": "0xed3350d191d23cbc609c98e920baa583403b9a02fa934df868e7f425cd72f5c3", + "latestHash": "0x49ca6eb004f372c71ed900ec6992582cd107e4f3ea36aaa5a0a78829ebef1f14", + "nodeId": "dde0bbf5eb3a731e6da861586e98e088e16e6fdd9afae2f2c213cead20a4f5eaa3910042b70d62266d2350d98a43c1f235c8e0da384448384893857873abdb75" + } + ], + "protocolId": 265, + "txPoolSize": "0" } ``` @@ -3298,145 +3310,6 @@ http://localhost:5002/WeBASE-Front/1/web3/nodeInfo ``` -### 3.30. 根据块高获取区块头 - - -#### 接口描述 - -> 返回 - -#### 接口URL - -**http://localhost:5002/WeBASE-Front/{groupId}/web3/blockHeaderByNumber/{blockNumber}** - -#### 调用方法 - -HTTP GET - -#### 请求参数 - -**1)参数表** - -| **序号** | **中文** | **参数名** | **类型** | **最大长度** | **必填** | **说明** | -| -------- | -------- | ---------------- | ---------- | ------------ | -------- | -------- | -| 1 | 群组编号 | groupId | int | | 是 | | - -**2)数据格式** - -``` -http://localhost:5002/WeBASE-Front/1/web3/blockHeaderByNumber/2 -``` - -#### 响应参数 -**1)数据格式** - -``` -{ - "number": 2, - "hash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "parentHash": "0x489ee0c00527879f7e2470bde7b62e9ea30fadb242bcbd9ba582d0dee4958e2f", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "transactionsRoot": "0xade02313d3200f38dfc18cdc368241cf4c1cb7e72011edf847ec216efa43a99e", - "receiptsRoot": "0xb7c4b856c9335bd345c0b022057567a2223218e7a7dab822981467b29ac1e326", - "dbHash": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "stateRoot": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "sealer": "0x2", - "sealerList": [ - "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f", - "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7", - "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39", - "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d" - ], - "extraData": [], - "gasLimit": "0", - "gasUsed": "0", - "timestamp": "1619424150450", - "signatureList": [ - { - "index": "0x1", - "signature": "0xa05b5d220e41051fa80f212884d9cdda3a8973a4ac2d2dc74e42db32b459e5f595a61e30266f0e8bf7edb065ff107c6af5e6349f9ae518146dc686406ebbade165bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7" - }, - { - "index": "0x3", - "signature": "0x48bb622e24b18f4eb601137d44b5d86e2c287be3aa849dce1768e87e75308ba69391e62f90d76bf84b9b6eb1509d11409f9b784bc7b052458a4596b81961fac8fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d" - }, - { - "index": "0x2", - "signature": "0x3a3cc8c20c5cdbb6431ec1f749d94662670e87442debef119a4e6469ccb16a60a152d32754ab833efa513839b076c2aa1ceb7e536db3734b740e9192b10ee38695efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39" - } - ] -} -``` - -### 3.31. 根据区块哈希获取区块头 - - -#### 接口描述 - -> 返回 - -#### 接口URL - -**http://localhost:5002/WeBASE-Front/{groupId}/web3/blockHeaderByHash/{blockHash}** - -#### 调用方法 - -HTTP GET - -#### 请求参数 - -**1)参数表** - -| **序号** | **中文** | **参数名** | **类型** | **最大长度** | **必填** | **说明** | -| -------- | -------- | ---------------- | ---------- | ------------ | -------- | -------- | -| 1 | 群组编号 | groupId | int | | 是 | | - -**2)数据格式** - -``` -http://localhost:5002/WeBASE-Front/1/web3/blockHeaderByHash/0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625 -``` - -#### 响应参数 -**1)数据格式** - -``` -{ - "number": 2, - "hash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "parentHash": "0x489ee0c00527879f7e2470bde7b62e9ea30fadb242bcbd9ba582d0dee4958e2f", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "transactionsRoot": "0xade02313d3200f38dfc18cdc368241cf4c1cb7e72011edf847ec216efa43a99e", - "receiptsRoot": "0xb7c4b856c9335bd345c0b022057567a2223218e7a7dab822981467b29ac1e326", - "dbHash": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "stateRoot": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "sealer": "0x2", - "sealerList": [ - "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f", - "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7", - "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39", - "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d" - ], - "extraData": [], - "gasLimit": "0", - "gasUsed": "0", - "timestamp": "1619424150450", - "signatureList": [ - { - "index": "0x1", - "signature": "0xa05b5d220e41051fa80f212884d9cdda3a8973a4ac2d2dc74e42db32b459e5f595a61e30266f0e8bf7edb065ff107c6af5e6349f9ae518146dc686406ebbade165bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7" - }, - { - "index": "0x3", - "signature": "0x48bb622e24b18f4eb601137d44b5d86e2c287be3aa849dce1768e87e75308ba69391e62f90d76bf84b9b6eb1509d11409f9b784bc7b052458a4596b81961fac8fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d" - }, - { - "index": "0x2", - "signature": "0x3a3cc8c20c5cdbb6431ec1f749d94662670e87442debef119a4e6469ccb16a60a152d32754ab833efa513839b076c2aa1ceb7e536db3734b740e9192b10ee38695efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39" - } - ] -} -``` ## 4. 性能检测接口 @@ -3911,36 +3784,20 @@ HTTP POST ``` { - "groupId": "1", - "signUserId": "f4975519b0274e6ca8283650a7e1bc07", - "contractName": "HelloWorld", - "contractPath": "/", - "version": "", - "funcName": "set", - "funcParam": ["333"], - "contractAddress": "0xe10441d9179cf0424aae808b51bc85dcbbfe1447", - "contractAbi": [{ - "inputs": [{ - "internalType": "string", - "name": "n", - "type": "string" - }], - "name": "set", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function", - "funcId": 2 - }], - "useAes": false, - "useCns": false, - "cnsName": "" + "groupId" :1, + "signUserId": "458ecc77a08c486087a3dcbc7ab5a9c3", + "contractAbi":[{"constant":true,"inputs":[],"name":"getVersion","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getStorageCell","outputs":[{"name":"","type":"string"},{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"n","type":"string"}],"name":"setVersion","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"storageHash","type":"string"},{"name":"storageInfo","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}], + "contractAddress":"0x14d5af9419bb5f89496678e3e74ce47583f8c166", + "funcName":"set", + "funcParam":["test"], + "useCns":false } ``` 示例: ``` -curl -X POST "http://localhost:5002/WeBASE-Front/trans/handleWithSign" -H "accept: */*" -H "Content-Type: application/json" -d "{\"groupId\":\"1\",\"signUserId\":\"f4975519b0274e6ca8283650a7e1bc07\",\"contractName\":\"HelloWorld\",\"contractPath\":\"/\",\"version\":\"\",\"funcName\":\"set\",\"funcParam\":[\"333\"],\"contractAddress\":\"0xe10441d9179cf0424aae808b51bc85dcbbfe1447\",\"contractAbi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"n\",\"type\":\"string\"}],\"name\":\"set\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"funcId\":2}],\"useAes\":false,\"useCns\":false,\"cnsName\":\"\"}" +curl -X POST "http://localhost:5002/WeBASE-Front/trans/handleWithSign" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"contractAbi\": [ { \"outputs\": [], \"constant\": false, \"payable\": false, \"inputs\": [ { \"name\": \"n\", \"type\": \"string\" } ], \"name\": \"set\", \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"outputs\": [ { \"name\": \"\", \"type\": \"string\" } ], \"constant\": true, \"payable\": false, \"inputs\": [], \"name\": \"get\", \"stateMutability\": \"view\", \"type\": \"function\" }, { \"payable\": false, \"inputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"constructor\" }, { \"inputs\": [ { \"indexed\": false, \"name\": \"name\", \"type\": \"string\" } ], \"name\": \"nameEvent\", \"anonymous\": false, \"type\": \"event\" } ], \"contractAddress\": \"0x7571ff73f1a37ca07f678aebc4d8213e7ef5c266\", \"funcName\": \"set\", \"funcParam\": [ \"test\" ], \"groupId\": 1, \"signUserId\": "458ecc77a08c486087a3dcbc7ab5a9c3"}" ``` #### 响应参数 @@ -3955,25 +3812,42 @@ b、正确发送数据上链返回值信息(交易收据) ``` { - "transactionHash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429", - "transactionIndex": "0x0", - "root": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "blockNumber": "2", - "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d", - "to": "0x0000000000000000000000000000000000000000", - "gasUsed": "316449", - "contractAddress": "0xa8af0ee580d8af674a60341030ddbc45431bc235", - "logs": [], - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "transactionHash": "0x0b426a58af8ba449742b937f1e9b2b225335638707b93d6b296dfd8107edddd7", + "transactionIndex": 0, + "blockHash": "0xc8eb7a983ecb8c2a0a64450a059d2cf3de8c8d786211dcec48ab9c47219ee8f7", + "blockNumber": 36985, + "gasUsed": 35400, + "contractAddress": "0x0000000000000000000000000000000000000000", + "root": null, "status": "0x0", - "statusMsg": "None", - "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029", + "from": "0xb173ca9a2e07efe6007aee751a013849d53e7c29", + "to": "0x7571ff73f1a37ca07f678aebc4d8213e7ef5c266", + "input": "0x4ed3885e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000047465737400000000000000000000000000000000000000000000000000000000", "output": "0x", - "txProof": null, - "receiptProof": null, - "message": null, - "statusOK": true + "logs": [ + { + "removed": false, + "logIndex": null, + "transactionIndex": null, + "transactionHash": null, + "blockHash": null, + "blockNumber": null, + "address": "0x7571ff73f1a37ca07f678aebc4d8213e7ef5c266", + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000047465737400000000000000000000000000000000000000000000000000000000", + "type": null, + "topics": [ + "0x9645e7fb5eec05c0f156d4901a10663561199c6dd0401214a0b833fe0022d899" + ], + "logIndexRaw": null, + "blockNumberRaw": null, + "transactionIndexRaw": null + } + ], + "logsBloom": "0x00000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000020000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000", + "gasUsedRaw": "0x8a48", + "statusOK": true, + "blockNumberRaw": "0x9079", + "transactionIndexRaw": "0x0" } ``` @@ -4029,36 +3903,22 @@ HTTP POST 示例: ``` -curl -l -H "Content-type: application/json" -X POST -d '{\"groupId\":\"1\",\"user\":\"0x7bfa3539c8761978f0a2a1f7f240bde97819fb03\",\"contractName\":\"HelloWorld\",\"contractPath\":\"/\",\"version\":\"\",\"funcName\":\"set\",\"funcParam\":[\"333\"],\"contractAddress\":\"0xe10441d9179cf0424aae808b51bc85dcbbfe1447\",\"contractAbi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"n\",\"type\":\"string\"}],\"name\":\"set\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"funcId\":2}],\"useAes\":false,\"useCns\":false,\"cnsName\":\"\"}' http://10.0.0.1:5002/WeBASE-Front/trans/handle +curl -l -H "Content-type: application/json" -X POST -d '{"contractName": +"HelloWorld", "contractAbi": [{\"constant\":false,\"inputs\":[{\"indexed\":false,\"name\":\"n\",\"type\":\"string\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}], funcName": "set", "funcParam": ["Hi,Welcome!"], "user": "0x2db346f9d24324a4b0eac7fb7f3379a2422704db", "contractAddress":"dasdfav23rf213vbcdvadf3bcdf2fc23rqde","groupId": 1,"useCns": false}' http://10.0.0.1:5002/WeBASE-Front/trans/handle ``` 传入合约abi: ``` { - "groupId": "1", - "user": "0x7bfa3539c8761978f0a2a1f7f240bde97819fb03", - "contractName": "HelloWorld", - "contractPath": "/", - "version": "", - "funcName": "set", - "funcParam": ["333"], - "contractAddress": "0xe10441d9179cf0424aae808b51bc85dcbbfe1447", - "contractAbi": [{ - "inputs": [{ - "internalType": "string", - "name": "n", - "type": "string" - }], - "name": "set", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function", - "funcId": 2 - }], - "useAes": false, - "useCns": false, - "cnsName": "" + "user":"0x2db346f9d24324a4b0eac7fb7f3379a2422704db", + "contractName":"HelloWorld", + "contractAddress":"dasdfav23rf213vbcdvadf3bcdf2fc23rqde", + "funcName":"set", + "contractAbi":[{"constant":true,"inputs":[],"name":"getVersion","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getStorageCell","outputs":[{"name":"","type":"string"},{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"n","type":"string"}],"name":"setVersion","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"storageHash","type":"string"},{"name":"storageInfo","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}], + "funcParam":["Hi,Welcome!"], + "groupId" :"1", + "useCns": false } ``` @@ -4074,25 +3934,23 @@ b、正确发送数据上链返回值信息(交易收据) ``` { - "transactionHash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429", - "transactionIndex": "0x0", - "root": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "blockNumber": "2", - "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d", - "to": "0x0000000000000000000000000000000000000000", - "gasUsed": "316449", - "contractAddress": "0xa8af0ee580d8af674a60341030ddbc45431bc235", - "logs": [], - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "status": "0x0", - "statusMsg": "None", - "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029", - "output": "0x", - "txProof": null, - "receiptProof": null, - "message": null, - "statusOK": true + "code": 0, + "message": "success", + "data": { + "blockHash": + "0x1d8d8275aa116d65893291c140849be272dac1d4ca0a0a722f44404b2f2356c3", + "gasUsed": 32798, + "transactionIndexRaw": "0", + "blockNumberRaw": "33", + "blockNumber": 33, + "contractAddress": "0x0000000000000000000000000000000000000000", + "cumulativeGasUsed": 32798, + "transactionIndex": 0, + "gasUsedRaw": "0x801e", + "logs": [], + "cumulativeGasUsedRaw": "0x801e", + "transactionHash":"0x0653a8e959771955330461456dd094a96d9071bfa31e6f43b68b30f10a85689c" + } } ``` @@ -4124,8 +3982,8 @@ HTTP POST ``` { - "signedStr": "0xf9012da001071041dddc1b3c553b48c0fbefecc07f3812f5ce4004d47708f1c3342844db018405f5e10082029d94e10441d9179cf0424aae808b51bc85dcbbfe144780b8643590b49f000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000033333330000000000000000000000000000000000000000000000000000000000010180b84083bb5313e3dd7825b8b3e32d73aa8aedf9f9a8fcf435e5c37edfe4645c1af4211c12e1368024336a576f26ed624407da0b94e0bc5760514543c0b7a38fa03a7da0972843d0879ffdbdae733e8707896a532e5e1a3c7262cb84db657dd34f09111ba0786106465fe0fd2383588693cafef8934df62b188c6bb5a74eb6b9f23adaba32", - "sync": true, + "signedStr": "0xddd", + "sync": 1, "groupId":1 } ``` @@ -4136,25 +3994,43 @@ HTTP POST ``` { - "transactionHash": "0xd1234cdb673447b654874d05d4ed98be89f3cb7c5a6c12bc51e1274a03af029c", - "transactionIndex": "0x0", - "root": "0xeecf2b6bbb028e38e704ca88fe1d9f5e3d43197b32c3336d3273d86fb3a135f0", - "blockNumber": "0xa9", - "blockHash": "0x906bdf0747ba68c03e6cf73463db62fdbd8ab8debc149f890475775d7c6a8af7", - "from": "0x7bfa3539c8761978f0a2a1f7f240bde97819fb03", - "to": "0xe10441d9179cf0424aae808b51bc85dcbbfe1447", - "gasUsed": "0x710b", - "contractAddress": "0x0000000000000000000000000000000000000000", - "logs": [], - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "status": "0x0", - "statusMsg": "None", - "input": "0x3590b49f000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000033333330000000000000000000000000000000000000000000000000000000000", - "output": "0x", - "txProof": null, - "receiptProof": null, - "message": "Success", - "statusOK": true + "transactionHash": "0xb2c733b742045e61c0fd6e7e2bafece04d56262a4887de9f78dad2c5dd2f944b", + "transactionIndex": 0, + "blockHash": "0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade", + "blockNumber": 100, + "cumulativeGasUsed": 121038, + "gasUsed": 121038, + "contractAddress": "0x0000000000000000000000000000000000000000", + "root": null, + "from": null, + "to": null, + "logs": [ + { + "removed": false, + "logIndex": 0, + "transactionIndex": 0, + "transactionHash": "0xb2c733b742045e61c0fd6e7e2bafece04d56262a4887de9f78dad2c5dd2f944b", + "blockHash": "0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade", + "blockNumber": 100, + "address": "0x986278eb8e8b4ef98bdfc055c02d65865fc87ad2", + "data": "0x00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000001caf3fbec3675eabb85c0b25e2992d6f0a5e1546dad85c20733fdb27cfa4ca782a5fdfb621b416f3494c7d8ca436c12309884550d402ea79f03ef8ddfdd494f7a40000000000000000000000000000000000000000000000000000000000000040666164363863656230616530316530643731616635356331316561643031613532656638363435343866306134643133633836363164393664326461366239380000000000000000000000000000000000000000000000000000000000000002363000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000023630000000000000000000000000000000000000000000000000000000000000", + "type": "mined", + "topics": [ + "0xbf474e795141390215f4f179557402a28c562b860f7b74dce4a3c0e0604cd97e" + ], + "logIndexRaw": "0", + "blockNumberRaw": "100", + "transactionIndexRaw": "0" + } + ], + "logsBloom": null, + "gasUsedRaw": "0x1d8ce", + "blockNumberRaw": "100", + "transactionIndexRaw": "0", + "cumulativeGasUsedRaw": "0x1d8ce", + "message": null, + "txProof": null, + "receiptProof": null } ``` @@ -4252,193 +4128,6 @@ HTTP POST } ``` - -### 5.6. 获取签名后的交易体编码值(结合WeBASE-Sign) - -#### 接口描述 - -构造交易体RawTransaction并将交易体编码,通过传入的`signUserId`签名服务的用户ID,使用对应的私钥对交易提进行签名后,返回已签名的交易体编码值(十六进制字符串) - -签名后的交易的编码值可以直接通过`/trans/signed-transaction`接口提交到链上 - -#### 接口URL - -**http://localhost:5002/WeBASE-Front/trans/convertRawTxStr/withSign** - -#### 调用方法 - -HTTP POST - -#### 请求参数 - -**1)参数表** - -| **序号** | **中文** | **参数名** | **类型** | **最大长度** | **必填** | **说明** | -| -------- | -------------- | --------------- | -------- | ------------ | -------- | ---------------------------------------------- | -| 1 | 用户编号 | signUserId | String | 64 | 是 | WeBASE-Sign用户编号,若为空则返回未签名交易提编码值 | -| 2 | 合约名称 | contractName | String | | 是 | | -| 3 | 合约地址 | contractAddress | String | | 是 | | -| 4 | 方法名 | funcName | String | | 是 | | -| 5 | 合约编译后生成的abi文件内容 | contractAbi | List | | 是 | 合约中单个函数的ABI,若不存在同名函数可以传入整个合约ABI,格式:JSONArray | -| 6 | 方法参数 | funcParam | List | | 否 | JSON数组,多个参数以逗号分隔(参数为数组时同理),如:["str1",["arr1","arr2"]] | -| 7 | 群组ID | groupId | int | | 是 | 默认为1 | -| 8 | 是否使用cns调用 | useCns | bool | | 是 | | -| 9 | cns名称 | cnsName | String | | 否 | CNS名称,useCns为true时不能为空 | -| 10 | cns版本 | version | String | | 否 | CNS版本,useCns为true时不能为空 | - - -**2)数据格式** - -``` -{ - "transactionHash": "0x42894f8478bc5cf3417c31a559f22e7d59b049fc3136e223d9ec7003927b16c1", - "transactionIndex": "0x0", - "root": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockNumber": "369", - "blockHash": "0x2462d0e8d7f4ed892a0a18c982c3398dd43250863c6fe5e182df4f7eaab205f7", - "from": "0xfc2038f30e82a2c7afbb27da4cd7c44ece8a5c91", - "to": "0xe10441d9179cf0424aae808b51bc85dcbbfe1447", - "gasUsed": "149305", - "contractAddress": "0x0000000000000000000000000000000000000000", - "logs": [], - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "status": "0x0", - "statusMsg": "None", - "input": "0x3590b49f000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000033333330000000000000000000000000000000000000000000000000000000000", - "output": "0x", - "txProof": null, - "receiptProof": null, - "message": null, - "statusOK": true -} -``` - -#### 响应参数 - -``` -0xf9012da002c1442b6ce974291ec317db9859e8310de46f6636d105f19fee67f10ac60b2f018405f5e10082029e94e10441d9179cf0424aae808b51bc85dcbbfe144780b8643590b49f000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000033333330000000000000000000000000000000000000000000000000000000000010180b8407d3efe268051e49350d877eaba7bbe6369a44263aec6e47fcba2ac1aff849261e833361bc67befbf4566894478c011dcae3e06818a381401751d1bf8bceecedaa01605fb8fcb546b0dc79e1da004a8323b151d1f569e10cae85a3f62bad5d7150fa0d77282eb650e0f52956693177717eb31cfddcada0681973a6aed9c46f3d8eb4d -``` - - -### 5.7. 获取签名后的交易体编码值(本地签名) - -#### 接口描述 - -构造交易体RawTransaction并将交易体编码,并通过传入的`user`地址的私钥对交易提进行签名后,返回已签名的交易体编码值(十六进制字符串) - -签名后的交易的编码值可以直接通过`/trans/signed-transaction`接口提交到链上 - -#### 接口URL - -**http://localhost:5002/WeBASE-Front/trans/convertRawTxStr/local** - -#### 调用方法 - -HTTP POST - -#### 请求参数 - -**1)参数表** - -| **序号** | **中文** | **参数名** | **类型** | **最大长度** | **必填** | **说明** | -| -------- | --------------------------- | --------------- | -------- | ------------ | -------- | ------------------------------------------------------------ | -| 1 | 用户地址 | user | String | | 是 | 用户地址,可通过`/privateKey`接口创建。*若user为空,则返回未签名交易编码值* | -| 2 | 合约名称 | contractName | String | | 是 | | -| 3 | 合约地址 | contractAddress | String | | 是 | | -| 4 | 方法名 | funcName | String | | 是 | | -| 5 | 合约编译后生成的abi文件内容 | contractAbi | List | | 是 | 合约中单个函数的ABI,若不存在同名函数可以传入整个合约ABI,格式:JSONArray | -| 6 | 方法参数 | funcParam | List | | 否 | JSON数组,多个参数以逗号分隔(参数为数组时同理),如:["str1",["arr1","arr2"]],根据所调用的合约方法判断是否必填 | -| 7 | 群组ID | groupId | int | | 是 | 默认为1 | -| 8 | 合约路径 | contractPath | int | | 否 | | -| 9 | 是否使用cns调用 | useCns | bool | | 是 | | -| 10 | cns名称 | cnsName | String | | 否 | CNS名称,useCns为true时不能为空 | -| 11 | cns版本 | version | String | | 否 | CNS版本,useCns为true时不能为空 | - -**2)数据格式** - -示例: - -``` -{ - "user":"0x2db346f9d24324a4b0eac7fb7f3379a2422704db", - "contractName":"HelloWorld", - "contractAddress":"dasdfav23rf213vbcdvadf3bcdf2fc23rqde", - "funcName":"set", - "contractAbi":[{"constant":true,"inputs":[],"name":"getVersion","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getStorageCell","outputs":[{"name":"","type":"string"},{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"n","type":"string"}],"name":"setVersion","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"storageHash","type":"string"},{"name":"storageInfo","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}], - "funcParam":["Hi,Welcome!"], - "groupId" :"1", - "useCns": false -} -``` - -#### 响应参数 - -**1)数据格式** - -``` -0xf9012da001071041dddc1b3c553b48c0fbefecc07f3812f5ce4004d47708f1c3342844db018405f5e10082029d94e10441d9179cf0424aae808b51bc85dcbbfe144780b8643590b49f000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000033333330000000000000000000000000000000000000000000000000000000000010180b84083bb5313e3dd7825b8b3e32d73aa8aedf9f9a8fcf435e5c37edfe4645c1af4211c12e1368024336a576f26ed624407da0b94e0bc5760514543c0b7a38fa03a7da0972843d0879ffdbdae733e8707896a532e5e1a3c7262cb84db657dd34f09111ba0786106465fe0fd2383588693cafef8934df62b188c6bb5a74eb6b9f23adaba32 -``` - - -### 5.8. 获取合约函数的编码值 - -#### 接口描述 - -构造合约函数的编码值,适用于查询交易,合约函数的编码值可以直接通过`/trans/query-transaction`接口提交到链上 - -#### 接口URL - -**http://localhost:5002/WeBASE-Front/trans/encodeFunction** - -#### 调用方法 - -HTTP POST - -#### 请求参数 - -**1)参数表** - -| **序号** | **中文** | **参数名** | **类型** | **最大长度** | **必填** | **说明** | -| -------- | --------------------------- | --------------- | -------- | ------------ | -------- | ------------------------------------------------------------ | -| 1 | 方法名 | funcName | String | | 是 | | -| 2 | 合约编译后生成的abi文件内容 | contractAbi | List | | 是 | 合约中单个函数的ABI,若不存在同名函数可以传入整个合约ABI,格式:JSONArray | -| 3 | 方法参数 | funcParam | List | | 是 | JSON数组,多个参数以逗号分隔(参数为数组时同理),如:["str1",["arr1","arr2"]],根据所调用的合约方法判断是否必填,为空则使用`[]`空数组代替 | - -**2)数据格式** - -示例: - -``` -{ - "contractAbi": [{ - "inputs": [], - "name": "get", - "outputs": [{ - "internalType": "string", - "name": "", - "type": "string" - }], - "stateMutability": "view", - "type": "function", - "funcId": 1 - }], - "contractAddress": "0xe10441d9179cf0424aae808b51bc85dcbbfe1447", - "encodeStr": "0x299f7f9d", - "funcName": "get", - "groupId": 1, - "userAddress": "0x7bfa3539c8761978f0a2a1f7f240bde97819fb03" -} -``` - -#### 响应参数 - -**1)数据格式** - -``` -0x299f7f9d -``` - - ## 6. 系统管理接口 使用FISCO BCOS v2.5.0 与 WeBASE-Front v1.4.1 (及)以上版本将使用预编译合约中的ChainGovernance接口(从本章节[接口6.13](#governance)开始),详情可参考[FISCO BCOS基于角色的权限控制](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/manual/permission_control.html#id2) diff --git a/docs/WeBASE-Front/upgrade.md b/docs/WeBASE-Front/upgrade.md index 46d3932f..f64d501b 100644 --- a/docs/WeBASE-Front/upgrade.md +++ b/docs/WeBASE-Front/upgrade.md @@ -10,12 +10,6 @@ WeBASE-Front升级的必须步骤: 各个版本的具体修改可参考下文 -#### v1.5.2 -- 优化合约Java项目导出功能,支持批量编译合约,支持多用户与channel端口检查 -- 合约仓库新增Asset资产合约 -- 增加交易组装接口`/tran/convertRawTxStr`和编码交易函数接口`/trans/encodeFunction` -- 支持合约IDE绑定合约地址、支持无私钥用户时交易窗口直接创建私钥 - #### v1.5.1 - 合约IDE支持导出合约的Java工程脚手架 - 合约仓库新增SmartDev存证合约 @@ -24,7 +18,8 @@ WeBASE-Front升级的必须步骤: - 修复合约IDE中合约调用参数为字符串时不能输入空格 #### v1.5.0 -- Web3SDK切换到JavaSDK + +##### 支持导出证书与私钥 - 支持导出前置的SDK证书与私钥、支持导出Pem/P12/WeID私钥 #### v1.4.3 diff --git a/docs/WeBASE-Install/developer.md b/docs/WeBASE-Install/developer.md index fa008a52..3c1a60a6 100644 --- a/docs/WeBASE-Install/developer.md +++ b/docs/WeBASE-Install/developer.md @@ -18,7 +18,7 @@ 1. 下载安装包 ```shell - wget https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/releases/download/v1.5.2/webase-front.zip + wget https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/releases/download/v1.5.1/webase-front.zip ``` diff --git a/docs/WeBASE-Node-Manager/appendix.md b/docs/WeBASE-Node-Manager/appendix.md index 100be352..d41c40c7 100644 --- a/docs/WeBASE-Node-Manager/appendix.md +++ b/docs/WeBASE-Node-Manager/appendix.md @@ -131,24 +131,13 @@ Could not find method compileOnly() for arguments [[org.projectlombok:lombok:1.1 INSERT INTO tb_account_info (account,account_pwd,role_id,create_time,modify_time)values('test', '$2a$10$F/aEB1iEx/FvVh0fMn6L/uyy.PkpTy8Kd9EdbqLGo7Bw7eCivpq.m',100000,now(),now()); ``` -##### 免鉴权调用(联调) - -在`application.yml`中配置`constant.isUseSecurity`为`false`即可禁用WeBASE-Node-Manager的登录鉴权。 - -![](../../images/WeBASE/mgr/disable_auth.png) - -- 免鉴权后,默认使用的是管理员用户admin(管理员用户可以看到所有用户的数据),可以调过登陆直接访问WeBASE-Web节点管理台的主页,如`http://localhost:5000/#/home`。 -- 若需要指定用户进行接口调用,可以在请求的`headers`中增加`Account`字段,其值设置为节点管理服务的用户名,如获取开发者用户`developer1`对应数据(开发者用户只能看到自己所创建的数据)。 - -![](../../images/WeBASE/mgr/api_with_header_account.png) - ### 3. 配置文件解析 | 参数 | 默认值 | 描述 | |------|-------------|-----------| | server.port | 5001 | 当前服务端口 | -| server.servlet.context-path | /WeBASE-Node-Manager | 当前服务访问路径 | +| server.servlet.context-path | /WeBASE-Node-Manager | 当前服务访问目录 | | mybatis.typeAliasesPackage | com.webank.webase.node.mgr | mapper类扫描路径 | | mybatis.mapperLocations | classpath:mapper/*.xml | mybatis的xml路径 | | spring.datasource.driver-class-name | com.mysql.cj.jdbc.Driver | mysql驱动 | @@ -171,7 +160,7 @@ INSERT INTO tb_account_info (account,account_pwd,role_id,create_time,modify_time | constant.blockRetainMax | 10000 | 表中区块保留的条数(开启constant.isDeleteInfo时有效) | | constant.verificationCodeMaxAge | 300 | y验证码有效时长(秒) | | constant.authTokenMaxAge | 1800 | 登录token有效时长(秒) | -| constant.isUseSecurity | true | 是否启用登录鉴权,若false则默认使用admin权限免登陆鉴权 | +| constant.isUseSecurity | true | 是否启用登录鉴权 | | constant.aesKey | ERTadb83f9ege39k | aes加密key(16位),建议更改 | | constant.jwtSecret | S3g4HtJyg7G6Hg0Ln3g4H5Jyg7H6f9dL | jwt生成时用到的key,建议更改 | | constant.frontUrl | http://%1s:%2d/WeBASE-Front/%3s | 前置服务的请求路径 | diff --git a/docs/WeBASE-APP-SDK/api.md b/docs/WeBASE-Node-Manager/appintegration.md similarity index 96% rename from docs/WeBASE-APP-SDK/api.md rename to docs/WeBASE-Node-Manager/appintegration.md index 2946b5c0..fc0360db 100644 --- a/docs/WeBASE-APP-SDK/api.md +++ b/docs/WeBASE-Node-Manager/appintegration.md @@ -1,9 +1,75 @@ -# 接口说明 +# 应用接入说明 + +应用管理是WeBASE管理台提供的一种第三方应用接入功能。其他应用可以通过WeBASE通用API来开发自己的运维管理台。接入的步骤如下: + +1. 通过WeBASE管理平台获得注册信息,并通过API向WeBASE注册服务。 +2. 通过WeBASE提供的基础能力API和WeBASE连通。 + +## 签名 + +### 签名说明 + +第三方应用从WeBASE管理平台获取注册信息**WeBASE的IP和端口、为应用分配的`appKey`(应用Key)和`appSecret`(应用密码,应用自己保存,不要暴露)**,向WeBASE发送请求时,需要使用应用分配的`appSecret`对请求进行签名。WeBASE收到请求后,根据`appKey`查询应用对应的`appSecret`,使用相同规则对请求进行签名验证。只有在验证通过后,WeBASE才会对请求进行相应的处理。 + +* 每个URL请求需带以下三个参数: + +| 参数名 | 类型 | 描述 | 参数值 | 备注 | +| --------- | ------ | -------------------- | ------------- | --------------------------------------------- | +| timestamp | long | 请求的时间戳(毫秒) | 1614928857832 | 当前时间戳,有效期默认5分钟 | +| appKey | String | 应用Key | fdsf78aW | 从WeBASE管理平台获取 | +| signature | String | 签名串 | 15B8F38... | 从WeBASE管理平台获取appSecret对appKey做的签名 | + +### 签名规则 + +使用MD5对`timestamp`、`appKey`加密并转大写得到签名值`signature` + +``` +public static String md5Encrypt(long timestamp, String appKey, String appSecret) { + try { + String dataStr = timestamp + appKey + appSecret; + MessageDigest m = MessageDigest.getInstance("MD5"); + m.update(dataStr.getBytes("UTF8")); + byte s[] = m.digest(); + String result = ""; + for (int i = 0; i < s.length; i++) { + result += Integer.toHexString((0x000000FF & s[i]) | 0xFFFFFF00).substring(6); + } + return result.toUpperCase(); + } catch (Exception e) { + e.printStackTrace(); + } + return ""; + } +``` + +### 示例 + +* 参数值: + +| 参数 | 参数值 | +| --------- | ---------------------------------- | +| timestamp | `1614928857832` | +| appKey | `fdsf78aW` | +| appSecret | `oMdarsqFOsSKThhvXagTpNdoOcIJxUwQ` | + +* 签名后的 `signature` 为 + +```Bash +EEFD7CD030E6B311AA85B053A90E8A31 +``` + + + + + +## WeBASE通用API + ## 1 应用管理模块 ### 1.1 应用注册 + #### 传输协议规范 * 网络传输协议:使用HTTP协议 diff --git a/docs/WeBASE-Node-Manager/index.md b/docs/WeBASE-Node-Manager/index.md index 4363465c..b08aca63 100644 --- a/docs/WeBASE-Node-Manager/index.md +++ b/docs/WeBASE-Node-Manager/index.md @@ -7,6 +7,7 @@ README.md install.md interface.md + appintegration.md upgrade.md appendix.md ``` diff --git a/docs/WeBASE-Node-Manager/interface.md b/docs/WeBASE-Node-Manager/interface.md index c9e5b8bb..879f9c9b 100644 --- a/docs/WeBASE-Node-Manager/interface.md +++ b/docs/WeBASE-Node-Manager/interface.md @@ -488,13 +488,13 @@ http://127.0.0.1:5001/WeBASE-Node-Manager/transaction/transList/300001/1/10?tran | 序号 | 输入参数 | 类型 | 可为空 | 备注 | |------|-------------|---------------|--------|-------------------------------| | 1 | groupId | int | 否 | 所属群组编号 | -| 2 | transHash | String | 否 | 交易hash | +| 2 | transHash | String | 是 | 交易hash | ***2)入参示例*** ``` -http://127.0.0.1:5001/WeBASE-Node-Manager/transaction/transactionReceipt/1/0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429 +http://127.0.0.1:5001/WeBASE-Node-Manager/transaction/transactionReceipt/1/0xda879949df6b5d75d2d807f036b461e0cebcc1abaccac119c9a282d3941a4818 ``` @@ -529,25 +529,23 @@ http://127.0.0.1:5001/WeBASE-Node-Manager/transaction/transactionReceipt/1/0x69c "code": 0, "message": "success", "data": { - "transactionHash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429", - "transactionIndex": "0x0", - "root": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "blockNumber": "2", - "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d", - "to": "0x0000000000000000000000000000000000000000", - "gasUsed": "316449", - "contractAddress": "0xa8af0ee580d8af674a60341030ddbc45431bc235", - "logs": [], - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "transactionHash": "0xda879949df6b5d75d2d807f036b461e0cebcc1abaccac119c9a282d3941a4818", + "transactionIndex": 0, + "blockHash": "0x739853061c6c87ed691c0ee6f938589f7e2e442d42b16f582b353a475359b91d", + "blockNumber": 4311, + "cumulativeGasUsed": 0, + "gasUsed": 32940, + "contractAddress": "0x0000000000000000000000000000000000000000", "status": "0x0", - "statusMsg": "None", - "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029", + "from": "0xe4bc056009daed8253008e03db6f62d93ccfacea", + "to": "0x522eda3fbe88c07025f1db3f7dc7d9836af95b3f", "output": "0x", - "txProof": null, - "receiptProof": null, - "message": null, - "statusOK": true + "logs": [], + "logsBloom": "0x000000000000000000000000000000000000000", + "blockNumberRaw": "0x10d7", + "transactionIndexRaw": "0x0", + "statusOK": true, + "gasUsedRaw": "0x80ac" } } ``` @@ -585,7 +583,7 @@ http://127.0.0.1:5001/WeBASE-Node-Manager/transaction/transactionReceipt/1/0x69c ***2)入参示例*** ``` -http://127.0.0.1:5001/WeBASE-Node-Manager/transaction/transInfo/1/0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429 +http://127.0.0.1:5001/WeBASE-Node-Manager/transaction/transInfo/1/0xda879949df6b5d75d2d807f036b461e0cebcc1abaccac119c9a282d3941a4818 ``` @@ -630,27 +628,23 @@ http://127.0.0.1:5001/WeBASE-Node-Manager/transaction/transInfo/1/0x69ced0162a0c "code": 0, "message": "success", "data": { - "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "blockNumber": 2, - "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d", - "gas": "4300000", - "hash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429", - "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029", - "nonce": "0x3460c30bd3e4e88a31d6d033b3a172859bf003258e9606fd63fb0d91f91f4e6", - "to": "0x0000000000000000000000000000000000000000", - "transactionIndex": "0x0", - "value": "0x0", - "gasPrice": "22000000000", - "blockLimit": "0x1f5", - "chainId": "0x1", - "groupId": "1", - "extraData": "0x", - "signature": { - "r": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462b", - "s": "0xd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124", - "v": "0xc7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7", - "signature": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462bd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124c7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7" - } + "hash": "0xda879949df6b5d75d2d807f036b461e0cebcc1abaccac119c9a282d3941a4818", + "nonce": "600264747827990445399299219738839026203774909117379671331964756256186263529", + "blockHash": "0x739853061c6c87ed691c0ee6f938589f7e2e442d42b16f582b353a475359b91d", + "blockNumber": 4311, + "transactionIndex": 0, + "from": "0xe4bc056009daed8253008e03db6f62d93ccfacea", + "to": "0x522eda3fbe88c07025f1db3f7dc7d9836af95b3f", + "value": 0, + "gasPrice": 100000000, + "gas": 100000000, + "input": "0x4ed3885e000000000000000", + "v": 0, + "nonceRaw": "0x153bce0f26461030fe5189385b9c3e84336b007769a3849524ca3f4af7d67e9", + "blockNumberRaw": "0x10d7", + "transactionIndexRaw": "0x0", + "gasPriceRaw": "0x5f5e100", + "gasRaw": "0x5f5e100" } } ``` @@ -1184,13 +1178,13 @@ http://127.0.0.1:5001/WeBASE-Node-Manager/account/login?checkCode=aege ### 4.1 查询区块列表 -#### 传输协议规范 +#### 4.1.1 传输协议规范 * 网络传输协议:使用HTTP协议 * 请求地址:**/block/blockList/{groupId}/{pageNumber}/{pageSize}}?pkHash={pkHash}&blockNumber={blockNumber}** * 请求方式:GET * 返回格式:JSON -#### 请求参数 +#### 4.1.2 请求参数 ***1)入参表*** @@ -1210,7 +1204,7 @@ http://127.0.0.1:5001/WeBASE-Node-Manager/account/login?checkCode=aege http://127.0.0.1:5001/WeBASE-Node-Manager/block/blockList/300001/1/10?pkHash= ``` -#### 返回参数 +#### 4.1.3 返回参数 ***1)出参表*** @@ -1266,13 +1260,13 @@ http://127.0.0.1:5001/WeBASE-Node-Manager/block/blockList/300001/1/10?pkHash= ### 4.2 根据块高或hash查询区块信息 -#### 传输协议规范 +#### 4.2.1 传输协议规范 * 网络传输协议:使用HTTP协议 -* 请求地址:**/block/blockByNumber/{groupId}/{blockNumber}** +* 请求地址:**/block/blockList/{groupId}/{pageNumber}/{pageSize}}?pkHash={pkHash}&blockNumber={blockNumber}** * 请求方式:GET * 返回格式:JSON -#### 请求参数 +#### 4.2.2 请求参数 ***1)入参表*** @@ -1287,11 +1281,11 @@ http://127.0.0.1:5001/WeBASE-Node-Manager/block/blockList/300001/1/10?pkHash= ***2)入参示例*** ``` -http://127.0.0.1:5001/WeBASE-Node-Manager/block/blockByNumber/1/2 +http://127.0.0.1:5001/WeBASE-Node-Manager/block/blockByNumber/1/11 ``` -#### 返回参数 +#### 4.2.3 返回参数 ***1)出参表*** @@ -1350,70 +1344,50 @@ http://127.0.0.1:5001/WeBASE-Node-Manager/block/blockByNumber/1/2 * 成功: ``` { - "code": 0, - "message": "success", - "data": { - "number": 2, - "hash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "parentHash": "0x489ee0c00527879f7e2470bde7b62e9ea30fadb242bcbd9ba582d0dee4958e2f", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "transactionsRoot": "0xade02313d3200f38dfc18cdc368241cf4c1cb7e72011edf847ec216efa43a99e", - "receiptsRoot": "0xb7c4b856c9335bd345c0b022057567a2223218e7a7dab822981467b29ac1e326", - "dbHash": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "stateRoot": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "sealer": "0x2", - "sealerList": [ - "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f", - "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7", - "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39", - "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d" - ], - "extraData": [], - "gasLimit": "0", - "gasUsed": "0", - "timestamp": "1619424150450", - "signatureList": [ - { - "index": "0x1", - "signature": "0xa05b5d220e41051fa80f212884d9cdda3a8973a4ac2d2dc74e42db32b459e5f595a61e30266f0e8bf7edb065ff107c6af5e6349f9ae518146dc686406ebbade165bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7" - }, - { - "index": "0x3", - "signature": "0x48bb622e24b18f4eb601137d44b5d86e2c287be3aa849dce1768e87e75308ba69391e62f90d76bf84b9b6eb1509d11409f9b784bc7b052458a4596b81961fac8fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d" - }, - { - "index": "0x2", - "signature": "0x3a3cc8c20c5cdbb6431ec1f749d94662670e87442debef119a4e6469ccb16a60a152d32754ab833efa513839b076c2aa1ceb7e536db3734b740e9192b10ee38695efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39" - } - ], - "transactions": [ - { - "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "blockNumber": 2, - "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d", - "gas": "0x419ce0", - "hash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429", - "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029", - "nonce": "0x3460c30bd3e4e88a31d6d033b3a172859bf003258e9606fd63fb0d91f91f4e6", - "to": "0x0000000000000000000000000000000000000000", - "transactionIndex": "0x0", - "value": "0x0", - "gasPrice": "0x51f4d5c00", - "blockLimit": "0x1f5", - "chainId": "0x1", - "groupId": "0x1", - "extraData": "0x", - "signature": { - "r": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462b", - "s": "0xd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124", - "v": "0xc7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7", - "signature": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462bd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124c7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7" - } - } - ] - }, - "attachment": null -} + "code": 0, + "message": "success", + "data": { + "number": 11, + "hash": "0xeef574a136f1d5031ce7f5d4bbc19fa1a1b5736f38ec5687d43405a572219405", + "parentHash": "0xca84147e343acb972dc9247727b920b5c081320bbe940f4e2b24363836dca4a1", + "nonce": "0", + "sealer": "0x0", + "logsBloom": "0x000000000000000000000000000000000000", + "transactionsRoot": "0x68510be0e37b993874c6cb59170b87f01fc9672a162b30df7ea96cb026f3ab27", + "stateRoot": "0xa6e930f100c2f4a13816e57aede9b63f3b7d51d64148f4412d8a6efcb0fa9c79", + "difficulty": 0, + "totalDifficulty": 0, + "extraData": [], + "size": 0, + "gasLimit": 0, + "gasUsed": 0, + "timestamp": "1551667286153", + "gasLimitRaw": "0x0", + "timestampRaw": "0x1694693d089", + "gasUsedRaw": "0x0", + "numberRaw": "0xb", + "transactions": [ + { + "hash": "0x30ab22a942a6545cfe46fd725e53311fbcfea655f9c0d1e198b83749f5d7bf9b", + "nonce": "1224685724047484442779169279180691132123728860283320089873703663086305160417", + "blockHash": "0xeef574a136f1d5031ce7f5d4bbc19fa1a1b5736f38ec5687d43405a572219405", + "blockNumber": 11, + "transactionIndex": 0, + "from": "0x148947262ec5e21739fe3a931c29e8b84ee34a0f", + "to": "0xdfb1684019f7f6ea2c41590ac55d29961de5deba", + "value": 0, + "gasPrice": 300000000, + "gas": 300000000, + "input": "0x66c991390000000000000000000000000000000000000000000000000000000000000004", + "v": 0, + "nonceRaw": "0x2b525c633f530fdd935428a58afcfbb533e4dd16f24eda6b6a860b63e6a2ce1", + "blockNumberRaw": "0xb", + "transactionIndexRaw": "0x0", + "gasPriceRaw": "0x11e1a300", + "gasRaw": "0x11e1a300" + } + ] + } ``` * 失败: @@ -1426,154 +1400,6 @@ http://127.0.0.1:5001/WeBASE-Node-Manager/block/blockByNumber/1/2 ``` -### 4.5 根据块高获取区块头 - - -#### 接口描述 - -> 返回 - -#### 接口URL - -**http://localhost:5001/WeBASE-Node-Manager/block/blockHeaderByNumber/{blockNumber}** - -#### 调用方法 - -HTTP GET - -#### 请求参数 - -**1)参数表** - -| **序号** | **中文** | **参数名** | **类型** | **最大长度** | **必填** | **说明** | -| -------- | -------- | ---------------- | ---------- | ------------ | -------- | -------- | -| 1 | 群组编号 | groupId | int | | 是 | | - -**2)数据格式** - -``` -http://localhost:5001/WeBASE-Node-Manager/block/blockHeaderByNumber/2 -``` - -#### 响应参数 -**1)数据格式** - -``` -{ - "code": 0, - "message": "success", - "data": { - "number": 2, - "hash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "parentHash": "0x489ee0c00527879f7e2470bde7b62e9ea30fadb242bcbd9ba582d0dee4958e2f", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "transactionsRoot": "0xade02313d3200f38dfc18cdc368241cf4c1cb7e72011edf847ec216efa43a99e", - "receiptsRoot": "0xb7c4b856c9335bd345c0b022057567a2223218e7a7dab822981467b29ac1e326", - "dbHash": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "stateRoot": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "sealer": "0x2", - "sealerList": [ - "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f", - "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7", - "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39", - "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d" - ], - "extraData": [], - "gasLimit": "0", - "gasUsed": "0", - "timestamp": "1619424150450", - "signatureList": [ - { - "index": "0x1", - "signature": "0xa05b5d220e41051fa80f212884d9cdda3a8973a4ac2d2dc74e42db32b459e5f595a61e30266f0e8bf7edb065ff107c6af5e6349f9ae518146dc686406ebbade165bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7" - }, - { - "index": "0x3", - "signature": "0x48bb622e24b18f4eb601137d44b5d86e2c287be3aa849dce1768e87e75308ba69391e62f90d76bf84b9b6eb1509d11409f9b784bc7b052458a4596b81961fac8fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d" - }, - { - "index": "0x2", - "signature": "0x3a3cc8c20c5cdbb6431ec1f749d94662670e87442debef119a4e6469ccb16a60a152d32754ab833efa513839b076c2aa1ceb7e536db3734b740e9192b10ee38695efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39" - } - ] - } -} -``` - -### 4.4. 根据区块哈希获取区块头 - - -#### 接口描述 - -> 返回 - -#### 接口URL - -**http://localhost:5001/WeBASE-Node-Manager/block/blockHeaderByHash/{blockHash}** - -#### 调用方法 - -HTTP GET - -#### 请求参数 - -**1)参数表** - -| **序号** | **中文** | **参数名** | **类型** | **最大长度** | **必填** | **说明** | -| -------- | -------- | ---------------- | ---------- | ------------ | -------- | -------- | -| 1 | 群组编号 | groupId | int | | 是 | | - -**2)数据格式** - -``` -http://localhost:5001/WeBASE-Front/block/blockHeaderByHash/0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625 -``` - -#### 响应参数 -**1)数据格式** - -``` -{ - "code": 0, - "message": "success", - "data": { - "number": 2, - "hash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "parentHash": "0x489ee0c00527879f7e2470bde7b62e9ea30fadb242bcbd9ba582d0dee4958e2f", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "transactionsRoot": "0xade02313d3200f38dfc18cdc368241cf4c1cb7e72011edf847ec216efa43a99e", - "receiptsRoot": "0xb7c4b856c9335bd345c0b022057567a2223218e7a7dab822981467b29ac1e326", - "dbHash": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "stateRoot": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "sealer": "0x2", - "sealerList": [ - "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f", - "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7", - "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39", - "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d" - ], - "extraData": [], - "gasLimit": "0", - "gasUsed": "0", - "timestamp": "1619424150450", - "signatureList": [ - { - "index": "0x1", - "signature": "0xa05b5d220e41051fa80f212884d9cdda3a8973a4ac2d2dc74e42db32b459e5f595a61e30266f0e8bf7edb065ff107c6af5e6349f9ae518146dc686406ebbade165bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7" - }, - { - "index": "0x3", - "signature": "0x48bb622e24b18f4eb601137d44b5d86e2c287be3aa849dce1768e87e75308ba69391e62f90d76bf84b9b6eb1509d11409f9b784bc7b052458a4596b81961fac8fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d" - }, - { - "index": "0x2", - "signature": "0x3a3cc8c20c5cdbb6431ec1f749d94662670e87442debef119a4e6469ccb16a60a152d32754ab833efa513839b076c2aa1ceb7e536db3734b740e9192b10ee38695efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39" - } - ] - } -} -``` - ## 5 合约管理模块 ### 5.1 查询合约列表 @@ -1984,27 +1810,7 @@ http://127.0.0.1:5001/WeBASE-Node-Manager/contract/transaction { "code": 0, "message": "success", - "data": { - "transactionHash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429", - "transactionIndex": "0x0", - "root": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15", - "blockNumber": "2", - "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625", - "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d", - "to": "0x0000000000000000000000000000000000000000", - "gasUsed": "316449", - "contractAddress": "0xa8af0ee580d8af674a60341030ddbc45431bc235", - "logs": [], - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "status": "0x0", - "statusMsg": "None", - "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029", - "output": "0x", - "txProof": null, - "receiptProof": null, - "message": null, - "statusOK": true - } + "data": {} } ``` diff --git a/docs/WeBASE-Node-Manager/upgrade.md b/docs/WeBASE-Node-Manager/upgrade.md index 086b11c7..1d31a558 100644 --- a/docs/WeBASE-Node-Manager/upgrade.md +++ b/docs/WeBASE-Node-Manager/upgrade.md @@ -12,19 +12,6 @@ WeBASE-Node-Manager升级的必须步骤: 各个版本的具体修改可参考下文 -#### v1.5.2 -- 优化合约IDE Java项目导出功能,支持多用户与channel端口检查 -- 合约仓库新增Asset资产合约 -- 优化免登陆鉴权模式、增加Swagger、支持开发者导出私钥、支持合约IDE绑定合约地址 -- 修复异常合约列表排序、修复获取区块头接口 - - -##### 数据表更新 - -执行webase-node-mgr中`script/upgrade`目录中的`v151_v152.sql`即可更新数据表,可通过`mysql -e source v151_v152.sql`命令执行 -- 注:更新前提前备份mysql数据 - - #### v1.5.1 - 新增导出合约Java工程脚手架 - 新增合约仓库接口 @@ -53,7 +40,6 @@ WeBASE-Node-Manager升级的必须步骤: - 新增节点监控的链上TPS、出块周期、块大小的统计 - 新增合约列表中的已登记合约与链上全量合约视图、新增私钥用户列表中的已登记私钥与链上全量私钥视图 - 支持导出Txt/Pem/P12/WeID私钥文件、支持导出前置的SDK证书 -- Web3SDK切换到JavaSDK ##### 数据表更新 diff --git a/docs/WeBASE-Sign/install.md b/docs/WeBASE-Sign/install.md index b978b398..08eab647 100644 --- a/docs/WeBASE-Sign/install.md +++ b/docs/WeBASE-Sign/install.md @@ -4,7 +4,7 @@ | 环境 | 版本 | | ------ | ------------------- | -| Java | Java1.8或以上版本 | +| Java | jdk1.8或以上版本 | | 数据库 | MySQL-5.6或以上版本 | 备注:安装说明请参看 [附录-1](./appendix.html#id2)。 @@ -121,8 +121,8 @@ constant: ## 6. 查看日志 -在dist目录查看: +在dist目录下查看: + ```shell -全量日志:tail -f log/WeBASE-Sign.log -错误日志:tail -f log/WeBASE-Sign-error.log +tail -f log/WeBASE-Sign.log ``` \ No newline at end of file diff --git a/docs/WeBASE-Training-Plugin-Plan/index.md b/docs/WeBASE-Training-Plugin-Plan/index.md index 57f6ecfd..0eca7817 100644 --- a/docs/WeBASE-Training-Plugin-Plan/index.md +++ b/docs/WeBASE-Training-Plugin-Plan/index.md @@ -29,24 +29,7 @@ WeBASE实训插件方案主要的目的是:将WeBASE管理台的部分功能 ### 4.2 WeBASE配置 -#### 4.2.1 WeBASE-Node-Manager数据库中插入参数设置数据,脚本如下: - -```plain -INSERT INTO `tb_config`(`config_name`, `config_type`, `config_value`, `create_time`, `modify_time`) VALUES ('SupportIframe', 2, '1', '2020-09-22 17:14:23', '2020-09-22 17:14:23'); -INSERT INTO `tb_config`(`config_name`, `config_type`, `config_value`, `create_time`, `modify_time`) VALUES ('IframeSupportHostList', 3, 'baidu.com|163.com', '2020-09-22 17:14:23', '2020-09-22 17:14:23');  -``` - -其中,SupportIframe设置为1,表示开启iframe嵌入支持;IframeSupportHostList为iframe嵌入支持的host白名单列表。 - -配置访问接口如下: - -``` -http://127.0.0.1:5001/WeBASE-Node-Manager/config/list?type=2 -``` - - - -#### 4.2.2 WeBASE-Node-Manager配置 +#### 4.2.1 WeBASE-Node-Manager配置 修改webase-node-manager/conf/application.yml。 @@ -68,6 +51,22 @@ permitUrlArray: /account/login,/account/pictureCheckCode,/login,/user/privateKey 2. 固定校验码为了实现单点登录 3. permitUrlArray配置是为了放开接口访问权限 + +#### 4.2.2 WeBASE-Node-Manager数据库中插入参数设置数据,脚本如下: + +```plain +INSERT INTO `tb_config`(`config_name`, `config_type`, `config_value`, `create_time`, `modify_time`) VALUES ('SupportIframe', 2, '1', '2020-09-22 17:14:23', '2020-09-22 17:14:23'); +INSERT INTO `tb_config`(`config_name`, `config_type`, `config_value`, `create_time`, `modify_time`) VALUES ('IframeSupportHostList', 3, 'baidu.com|163.com', '2020-09-22 17:14:23', '2020-09-22 17:14:23');  +``` + +其中,SupportIframe设置为1,表示开启iframe嵌入支持;IframeSupportHostList为iframe嵌入支持的host白名单列表。 + +配置访问接口如下: + +``` +http://127.0.0.1:5001/WeBASE-Node-Manager/config/list?type=2 +``` + ## 5 实验台中使用 ### 5.1 iframe嵌入 diff --git a/docs/WeBASE-Web/install.md b/docs/WeBASE-Web/install.md index 86c9ec6a..b43a57d2 100644 --- a/docs/WeBASE-Web/install.md +++ b/docs/WeBASE-Web/install.md @@ -63,7 +63,6 @@ git clone https://gitee.com/WeBank/WeBASE-Web-Mobile.git 在docs目录下有配置文件nginx.conf,修改完后替换安装的nginx的配置文件nginx.conf(这里nginx安装配置文件在/usr/local/nginx/conf下面,如果这里没找到,可以到/etc下寻找,如有权限问题,请加上sudo)。 - - 修改配置: ``` @@ -80,8 +79,7 @@ sed -i "s%/data/WeBASE-Web/dist%${your_file_dir}%g" docs/nginx.conf sed -i "s%10.0.0.1:5001%${your_node_manager}%g" docs/nginx.conf ``` -- 复制配置文件nginx.conf到默认配置目录中 -- 也可以直接通过`nginx -c docs/nginx.conf`命令加载docs/nginx.conf配置 +- 复制配置文件nginx.conf ``` cp -rf docs/nginx.conf /usr/local/nginx/conf @@ -129,7 +127,6 @@ cp -rf docs/nginx.conf /usr/local/nginx/conf ``` ps -ef | grep nginx ``` - ### 6. 访问页面 ``` diff --git a/docs/WeBASE-Web/upgrade.md b/docs/WeBASE-Web/upgrade.md index 220790ce..ac4ccb82 100644 --- a/docs/WeBASE-Web/upgrade.md +++ b/docs/WeBASE-Web/upgrade.md @@ -8,12 +8,6 @@ WeBASE-Web升级的必须步骤: 各个版本的具体修改可参考下文 -#### v1.5.2 -- 优化合约Java项目导出功能,支持批量编译合约,支持多用户与channel端口检查 -- 合约仓库新增Asset资产合约 -- 优化交易弹窗,支持无私钥用户时直接创建私钥 -- 支持开发者导出私钥、支持合约IDE绑定合约地址 - #### v1.5.1 - 新增导出合约Java工程脚手架 - 新增合约仓库 diff --git a/docs/WeBASE/ChangeLOG.md b/docs/WeBASE/ChangeLOG.md index 18202cbf..83e33efa 100644 --- a/docs/WeBASE/ChangeLOG.md +++ b/docs/WeBASE/ChangeLOG.md @@ -3,20 +3,6 @@ ## 支持FISCO-BCOS 2.X.X系列版本 -### WeBASE v1.5.2 - -WeBASE v1.5.2 版本支持 FISCO-BCOS 2.5.x及以上版本。WeBASE 子系统推荐使用下表的版本搭配,FISCO-BCOS 推荐使用 [FISCO BCOS 2.7.2](https://github.com/FISCO-BCOS/FISCO-BCOS/releases/tag/v2.7.2)版本。 - -| WeBASE子系统名称 | 配套版本地址 | FISCO-BCOS 2.X.X | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| [节点前置服务](https://webasedoc.readthedocs.io/zh_CN/latest/docs/WeBASE-Front/index.html) | [WeBASE-Front Release v1.5.2](https://github.com/WeBankFinTech/WeBASE-Front/releases/tag/v1.5.2) | [FISCO BCOS 2.7.2](https://github.com/FISCO-BCOS/FISCO-BCOS/releases/tag/v2.7.2) | -| [节点管理服务](https://webasedoc.readthedocs.io/zh_CN/latest/docs/WeBASE-Node-Manager/index.html) | [WeBASE-Node-Manager Release v1.5.2](https://github.com/WeBankFinTech/WeBASE-Node-Manager/releases/tag/v1.5.2) | [FISCO BCOS 2.7.2](https://github.com/FISCO-BCOS/FISCO-BCOS/releases/tag/v2.7.2) | -| [WeBASE管理平台](https://webasedoc.readthedocs.io/zh_CN/latest/docs/WeBASE-Web/index.html) | [WeBASE-Web Release v1.5.2](https://github.com/WeBankFinTech/WeBASE-Web/releases/tag/v1.5.2) | [FISCO BCOS 2.7.2](https://github.com/FISCO-BCOS/FISCO-BCOS/releases/tag/v2.7.2) | -| [签名服务](https://webasedoc.readthedocs.io/zh_CN/latest/docs/WeBASE-Sign/index.html) | [WeBASE-Sign Release v1.5.0](https://github.com/WeBankFinTech/WeBASE-Sign/releases/tag/v1.5.0) | [FISCO BCOS 2.7.2](https://github.com/FISCO-BCOS/FISCO-BCOS/releases/tag/v2.7.2) | -| [交易服务](https://webasedoc.readthedocs.io/zh_CN/latest/docs/WeBASE-Transaction/index.html) | [WeBASE-Transaction Release v1.4.0](https://github.com/WeBankFinTech/WeBASE-Transaction/releases/tag/v1.4.0) | [FISCO BCOS 2.7.2](https://github.com/FISCO-BCOS/FISCO-BCOS/releases/tag/v2.7.2) | - - - ### WeBASE v1.5.1 WeBASE v1.5.1 版本支持 FISCO-BCOS 2.5.x及以上版本。WeBASE 子系统推荐使用下表的版本搭配,FISCO-BCOS 推荐使用 [FISCO BCOS 2.7.2](https://github.com/FISCO-BCOS/FISCO-BCOS/releases/tag/v2.7.2)版本。 diff --git a/docs/WeBASE/install.md b/docs/WeBASE/install.md index a2915910..8211f98d 100644 --- a/docs/WeBASE/install.md +++ b/docs/WeBASE/install.md @@ -44,7 +44,7 @@ MySQL-5.6或以上版本: mysql --version ``` -- Mysql安装部署可参考[数据库部署](#mysql-install) +- Mysql安装部署可参考[数据库部署](#mysql) #### 检查Python @@ -96,7 +96,7 @@ Python3.6及以上版本,需安装`PyMySQL`依赖包 获取部署安装包: ```shell -wget https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/releases/download/v1.5.2/webase-deploy.zip +wget https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/releases/download/v1.5.1/webase-deploy.zip ``` 解压安装包: ```shell @@ -130,10 +130,10 @@ cd webase-deploy ```shell # WeBASE子系统的最新版本(v1.1.0或以上版本) -webase.web.version=v1.5.2 -webase.mgr.version=v1.5.2 +webase.web.version=v1.5.1 +webase.mgr.version=v1.5.1 webase.sign.version=v1.5.0 -webase.front.version=v1.5.2 +webase.front.version=v1.5.1 # 节点管理子系统mysql数据库配置 mysql.ip=127.0.0.1 @@ -520,47 +520,16 @@ java -version ``` ### 2. 数据库部署 - + -#### ① CentOS安装MariaDB +此处以Centos安装*MariaDB*为例。*MariaDB*数据库是 MySQL 的一个分支,主要由开源社区在维护,采用 GPL 授权许可。*MariaDB*完全兼容 MySQL,包括API和命令行。其他安装方式请参考[MySQL官网](https://dev.mysql.com/downloads/mysql/)。 -此处以**CentOS 7(x86_64)**安装**MariaDB 10.2**为例。*MariaDB*数据库是 MySQL 的一个分支,主要由开源社区在维护,采用 GPL 授权许可。*MariaDB*完全兼容 MySQL,包括API和命令行。MariaDB 10.2版本对应Mysql 5.7。其他安装方式请参考[MySQL官网](https://dev.mysql.com/downloads/mysql/)。 -- CentOS 7 默认MariaDB为5.5版本,安装10.2版本需要按下文进行10.2版本的配置。 -- 若使用CentOS 8则直接使用`sudo yum install -y mariadb*`即可安装MariaDB 10.3,并跳到下文的 *启停* 章节即可。 +#### ① 安装MariaDB -使用`vi`或`vim`创建新文件`/etc/yum.repos.d/mariadb.repo`,并写入下文的文件内容(参考[MariaDB中科大镜像源修改](http://mirrors.ustc.edu.cn/help/mariadb.html)进行配置) +- 安装命令 -- 创建repo文件 -```Bash -sudo vi /etc/yum.repos.d/mariadb.repo -``` - -- 文件内容,此处使用的是中科大镜像源 -```Bash -# MariaDB 10.2 CentOS repository list - created 2021-07-12 07:37 UTC -# http://downloads.mariadb.org/mariadb/repositories/ -[mariadb] -name = MariaDB -baseurl = https://mirrors.ustc.edu.cn/mariadb/yum/10.2/centos7-amd64 -gpgkey=https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB -gpgcheck=1 -``` - -- 更新yum源缓存数据 -``` -yum clean all -yum makecache all -``` - -- 安装`MariaDB 10.2` -- 如果已存在使用`sudo yum install -y mariadb*`命令安装的MariaDB,其版本默认为5.5版本,对应Mysql版本为5.5。新版本MariaDB无法兼容升级,需要先**卸载旧版本**的MariaDB,卸载前需要**备份**数据库内容,卸载命令可参考`yum remove mariadb` -``` -sudo yum install MariaDB-server MariaDB-client -y -``` - -若安装时遇到错误`“Failed to connect to 2001:da8:d800:95::110: Network is unreachable”`,将源地址中的 `mirrors.ustc.edu.cn` 替换为 `ipv4.mirrors.ustc.edu.cn` 以强制使用 IPv4: -``` -sudo sed -i 's#//mirrors.ustc.edu.cn#//ipv4.mirrors.ustc.edu.cn#g' /etc/yum.repos.d/mariadb +```shell +sudo yum install -y mariadb* ``` - 启停 @@ -633,8 +602,8 @@ mysql -utest -p123456 -h localhost -P 3306 mysql > create database webasenodemanager; ``` - ### 3. Python部署 + python版本要求使用python3.x, 推荐使用python3.6及以上版本 diff --git a/docs_en/conf.py b/docs_en/conf.py index 37d047a2..40a7ba2c 100644 --- a/docs_en/conf.py +++ b/docs_en/conf.py @@ -110,7 +110,7 @@ # The short X.Y version. version = '1.5' # The full version, including alpha/beta/rc tags. -release = 'v1.5.2' +release = 'v1.5.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/images/WeBASE/mgr/api_with_header_account.png b/images/WeBASE/mgr/api_with_header_account.png deleted file mode 100644 index 736c090e..00000000 Binary files a/images/WeBASE/mgr/api_with_header_account.png and /dev/null differ diff --git a/images/WeBASE/mgr/disable_auth.png b/images/WeBASE/mgr/disable_auth.png deleted file mode 100644 index 85b2dd92..00000000 Binary files a/images/WeBASE/mgr/disable_auth.png and /dev/null differ diff --git a/index.rst b/index.rst index 097b6c41..a7f51ca3 100644 --- a/index.rst +++ b/index.rst @@ -22,21 +22,6 @@ WeBASE(WeBank Blockchain Application Software Extension) 是在区块链应 - `WeBASE版本信息 <./docs/WeBASE/ChangeLOG.html#fisco-bcos-2-x-x>`_ - `安装部署 <./docs/WeBASE-Install/index.html>`_ - `WeBASE管理平台使用手册 <./docs/WeBASE-Console-Suit/index.html>`_ - - `WeBASE应用管理 <./docs/WeBASE-APP-SDK/index.html>`_ - - `WeBASE合约仓库 <./docs/WeBASE-Contract-Warehouse/index.html>`_ - - `WeBASE实训插件方案 <./docs/WeBASE-Training-Plugin-Plan/index.html>`_ - - .. container:: card-holder - - .. container:: card ref - - .. raw:: html - -
-             解决方案 -

- - - `WeBASE应用管理 <./docs/WeBASE-APP-SDK/index.html>`_ - `WeBASE合约仓库 <./docs/WeBASE-Contract-Warehouse/index.html>`_ - `WeBASE实训插件方案 <./docs/WeBASE-Training-Plugin-Plan/index.html>`_ @@ -110,7 +95,7 @@ WeBASE(WeBank Blockchain Application Software Extension) 是在区块链应 - SmartDev-Contract 智能合约库组件:`[GitHub] `_ `[Gitee] `_ `[文档] `_ - SmartDev-SCGP 合约编译插件:`[GitHub] `_ `[Gitee] `_ `[文档] `_ - SmartDev-Scaffold 应用开发脚手架:`[GitHub] `_ `[Gitee] `_ `[文档] `_ - - **WeBankBlockchain-OpenLedger 分布式账本解决方案**:`[GitHub] `_ `[Gitee] `_ `[文档] `_ + .. toctree:: @@ -139,7 +124,6 @@ WeBASE(WeBank Blockchain Application Software Extension) 是在区块链应 :caption: WeBASE使用指南 docs/WeBASE-Console-Suit/index.md - docs/WeBASE-APP-SDK/index.md docs/WeBASE-Contract-Warehouse/index.md docs/WeBASE-Training-Plugin-Plan/index.md docs/WeBASE/quick-start.md diff --git a/release_note.txt b/release_note.txt index 59b432c2..de27550e 100644 --- a/release_note.txt +++ b/release_note.txt @@ -1 +1 @@ -v1.5.2 +v1.5.1