接口文档

1. 合约接口

1.1. 发送abi接口

接口描述

根据abi内容判断合约是否已部署,未部署则生成对应abi文件

接口URL

http://localhost:8081/WeBASE-Front/contract/abiInfo

调用方法

HTTP POST

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1所属群组groupIdInteger
2合约名称contractNameString
3合约地址addressString
4合约abiabiInfoListabi文件里面的内容,是一个JSONArray
5合约bincontractBinString

2)数据格式

  1. {
  2. "groupId": 1,
  3. "contractName": "HelloWorld",
  4. "address": "0x31b26e43651e9371c88af3d36c14cfd938baf4fd",
  5. "contractBin": "608060405234801561001057600080fd5b5060405161031d38038061031d8339810180",
  6. "abiInfo": [
  7. {"inputs": [{"type": "string", "name": "n"}], "constant": false, "name": "set",
  8. "outputs": [], "payable": false, "type": "function"},
  9. {"inputs": [], "constant": true, "name": "get", "outputs": [{"type": "string",
  10. "name": ""}], "payable": false, "type": "function"},
  11. {"inputs": [], "constant": false, "name": "HelloWorld", "outputs": [],
  12. "payable": false, "type": "function"}
  13. ]
  14. }

响应参数

1)数据格式

1.2. 合约部署接口

接口描述

将合约部署到当前节点

接口URL

http://localhost:8081/WeBASE-Front/contract/deploy

调用方法

HTTP POST

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1所属群组groupIdint
2用户编号userString用户编号或者用户地址
3合约名称contractNameString
4合约abiabiInfoList
5合约binbytecodeBinString
6构造函数参数funcParamList

2)数据格式

  1. {
  2. "user":700001,
  3. "contractName":"HelloWorld",
  4. "abiInfo": [],
  5. "bytecodeBin":"",
  6. "funcParam":[]
  7. }

响应参数

1)数据格式

  1. {
  2. "0x60aac015d5d41adc74217419ea77815ecb9a2192"
  3. }

1.3. cns接口

接口描述

根据合约名及版本号查询合约地址

接口URL

http://localhost:8081/WeBASE-Front/contract/cns?groupId={groupId}&name={name}&version={version}

调用方法

HTTP POST

请求参数

  • 参数表
    序号中文参数名类型最大长度必填说明
    1所属群组groupIdint
    2合约名称nameString
    3合约版本versionString

2)数据格式http://localhost:8081/WeBASE-Front/contract/cns?groupId=1&name=HelloWorld&version=2

响应参数

1)数据格式

  1. {
  2. "0x31b26e43651e9371c88af3d36c14cfd938baf4fd"
  3. }

1.4. java转译接口

接口描述

将合约abi转成java文件

接口URL

http://localhost:8081/WeBASE-Front/contract/compile-java

调用方法

HTTP POST

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1合约名称contractNameString
2合约abiabiInfoList
3合约binbytecodeBinString
4所在目录packageNameString生成java所在的包名
  • 数据格式{“contractName”: “HeHe”,“abiInfo”: [],“contractBin”: “60806040526004361061004c576000357c0100000000000000000000029”,“packageName”: “com.webank”}

响应参数

1)参数表

java文件

2)数据格式

1.5. 保存合约接口

接口描述

支持前置的控制台保存合约信息

接口URL

http://localhost:8081/WeBASE-Front/contract/save

调用方法

HTTP POST

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1所属群组groupIdint
2合约编号contractIdint
3合约名称contractNameString
4合约所在目录contractPathString
5合约abicontractAbiString
6bytecodeBinbytecodeBinString
7合约bincontractBinString
8合约源码contractSourceString

2)数据格式

  1. {
  2. "groupId": "1",
  3. "contractName": "HeHe",
  4. "contractPath": "/",
  5. "contractSource": "cHJhZ21hIHNvbGlkaXR5IF4wLjQuMjsn0=",
  6. "contractAbi": “[]”
  7. "contractBin": "60806040526004361061004c576000357c0100000000000000000000000029",
  8. "bytecodeBin": "6080604052348015610010572269b80029",
  9. "contractId": 1
  10. }

响应参数

1)参数表

序号中文参数名类型最大长度必填说明
1合约编号idInteger
2所在目录contractPathString
3合约bincontractBinString
4合约名称contractNameString
5合约状态contractStatusInteger1未部署,2已部署
6所属群组groupIdInteger
7合约源码contractSourceString
8合约abicontractAbiString
9合约bincontractBinString
10bytecodeBinbytecodeBinString
11合约地址contractAddressString
12部署时间deployTimeString
13修改时间modifyTimeString
14创建时间createTimeString
15备注descriptionString

2)数据格式

  1. {
  2. "id": 1,
  3. "contractPath": "/",
  4. "contractName": "HeHe",
  5. "contractStatus": 1,
  6. "groupId": 1,
  7. "contractSource": "cHJhZ21hIHNvbGlkaXR5IF4wLjQuMjsKCmICB9Cn0=",
  8. "contractAbi": "[{\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}]",
  9. "contractBin": "60806040526004361061004c5760003569b80029",
  10. "bytecodeBin": "608060405234801561001057600080fd5b506029",
  11. "contractAddress": null,
  12. "deployTime": null,
  13. "description": null,
  14. "createTime": "2019-06-10 11:48:51",
  15. "modifyTime": "2019-06-10 15:31:29"
  16. }

1.6. 删除合约接口

接口描述

支持前置的控制台通过群组编号和合约编号删除未部署的合约信息

接口URL

http://localhost:8081/WeBASE-Front/contract/{groupId}/{contractId}

调用方法

HTTP DELETE

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1所属群组groupIdint
2合约编号contractIdint

2)数据格式http://localhost:8081/WeBASE-Front/contract/1/1

响应参数

1)参数表

序号中文参数名类型必填说明
1返回码codeString返回码信息请参看附录1
2提示信息messageString
3返回数据dataObject

2)数据格式

  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": null
  5. }

1.7. 分页查询合约列表

接口描述

支持前置的控制台分页查询合约列表

接口URL

http://localhost:8081/WeBASE-Front/contract/contractList

调用方法

HTTP POST

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1所属群组groupIdInteger
2合约名称contractNameString
3合约状态contractStatusInteger1未部署,2已部署
4合约地址contractAddressString
5当前页码pageNumberInteger从0开始
6每页记录数pageSizeInteger

2)数据格式

  1. {
  2. "groupId": "1",
  3. "pageNumber": 0,
  4. "pageSize": 10,
  5. "contractName": "",
  6. "contractAddress": "",
  7. "contractStatus": 2
  8. }

响应参数

1)参数表

序号中文参数名类型必填说明
1返回码codeString返回码信息请参看附录1
2提示信息messageString
3返回数据dataObject
3.1合约编号idInteger
3.2所在目录contractPathString
3.3合约bincontractBinString
3.4合约名称contractNameString
3.5合约状态contractStatusInteger1未部署,2已部署
3.6所属群组groupIdInteger
3.7合约源码contractSourceString
3.8合约abicontractAbiString
3.9合约bincontractBinString
3.10bytecodeBinbytecodeBinString
3.11合约地址contractAddressString
3.12部署时间deployTimeString
3.13修改时间modifyTimeString
3.14创建时间createTimeString
3.15备注descriptionString

2)数据格式

  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": [
  5. {
  6. "id": 2,
  7. "contractPath": "/",
  8. "contractName": "HeHe",
  9. "contractStatus": 1,
  10. "groupId": 1,
  11. "contractSource": "cHJhZ21hIHNvbGlkaXR5IICB9Cn0=",
  12. "contractAbi": "",
  13. "contractBin": "",
  14. "bytecodeBin": null,
  15. "contractAddress": null,
  16. "deployTime": null,
  17. "description": null,
  18. "createTime": "2019-06-10 16:42:50",
  19. "modifyTime": "2019-06-10 16:42:52"
  20. }
  21. ],
  22. "totalCount": 1
  23. }

2. 私钥接口

2.1. 获取公私钥接口

接口描述

通过调用此接口获取公私钥对和对应账户信息

接口URL

http://localhost:8081/WeBASE-Front/privateKey?useAes={useAes}&userName={userName}

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1是否需要加密私钥useAesboolean
2用户名userNameString

2)数据格式

http://localhost:8081/WeBASE-Front/privateKey?useAes=false&userName=test

响应参数

1)数据格式

  1. {
  2. "publicKey":"1c7073dc185af0644464b178da932846666a858bc492450e9e94c77203428ed54e2ce45679dbb36bfed714dbe055a215dc1aaf4a75faeddce6a62b39c0158e1e",
  3. "privateKey":"008cf98bd0f37fb0984ab43ed6fc2dcdf58811522af7e4a3bedbe84636a79a501c",
  4. "address":"0x2e8ff65fb1b2ce5b0c9476b8f8beb221445f42ee"
  5. }

2.2. 导入私钥接口

接口描述

导入私钥信息,并返回对应的公钥及用户地址

接口URL

http://localhost:8081/WeBASE-Front/privateKey/import?privateKey={privateKey}&useAes={useAes}

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1私钥信息privateKeyString
2是否是加密私钥useAesboolean默认true

2)数据格式

http://localhost:8081/WeBASE-Front/privateKey/import?privateKey=

008cf98bd0f37fb0984ab43ed6fc2dcdf58811522af7e4a3bedbe84636a79a501c&useAes=false

响应参数

1)数据格式

  1. {
  2. "publicKey":"1c7073dc185af0644464b178da932846666a858bc492450e9e94c77203428ed54e2ce45679dbb36bfed714dbe055a215dc1aaf4a75faeddce6a62b39c0158e1e",
  3. "privateKey":"008cf98bd0f37fb0984ab43ed6fc2dcdf58811522af7e4a3bedbe84636a79a501c",
  4. "address":"0x2e8ff65fb1b2ce5b0c9476b8f8beb221445f42ee"
  5. }

3. web3接口

3.1. 获取块高接口

接口描述

获取节点最新块高

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/blockNumber

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1群组编号groupIdint

2)数据格式http://localhost:8081/WeBASE-Front/1/web3/blockNumber

响应参数

1)数据格式

  1. {
  2. 8346
  3. }

3.2. 根据块高获取块信息接口

接口描述

通过块高获取块信息

接口URL

http://localhost:8081/WeBASE-Front/1/web3/blockByNumber/{blockNumber}

调用方法

HTTP GET

请求参数

  • 参数表
    序号中文参数名类型最大长度必填说明
    1块高blockNumberBigInteger

2)数据格式

http://localhost:8081/WeBASE-Front/1/web3/blockByNumber/100

响应参数

1)数据格式

  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "number": 100,
  6. "hash": "0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade",
  7. "parentHash": "0xc784a2af86e6726fcdc63b57ed1b91a40efc7d8b1b7285154d399ea78bd18754",
  8. "nonce": 0,
  9. "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  10. "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000040000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000800000000000000000000000000",
  11. "transactionsRoot": "0x27055bac669a67e8aaa1455ad9fd70b75dd86dc905c6bd0d111ed67ab182d1dc",
  12. "stateRoot": "0xa05ad5db11b8be6aed3b591f2f64fdbb241506cbe9ef591f3a4b946ca777f838",
  13. "receiptsRoot": "0xc1d4b43ed68d7263ddf50861feec26440e933a0b152917e938194f5079b48ce4",
  14. "author": "0x0000000000000000000000000000000000000000",
  15. "miner": "0x0000000000000000000000000000000000000000",
  16. "mixHash": null,
  17. "difficulty": 1,
  18. "totalDifficulty": 101,
  19. "extraData": "0xd98097312e332e302b2b302d524c696e75782f672b2b2f496e74",
  20. "size": 71,
  21. "gasLimit": 2000000000,
  22. "gasUsed": 121038,
  23. "timestamp": 1526437108478,
  24. "transactions": [
  25. {
  26. "hash": "0xb2c733b742045e61c0fd6e7e2bafece04d56262a4887de9f78dad2c5dd2f944b",
  27. "nonce": 9.1623055443573E+74,
  28. "blockHash": "0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade",
  29. "blockNumber": 100,
  30. "transactionIndex": 0,
  31. "from": "0x59bd3815f73b197d6ef327f2a45089f50aba942a",
  32. "to": "0x986278eb8e8b4ef98bdfc055c02d65865fc87ad2",
  33. "value": 0,
  34. "gasPrice": 30000000,
  35. "gas": 30000000,
  36. "input": "0x48f85bce000000000000000000000000000000000000000000000000000000000000001caf3fbec3675eabb85c0b25e2992d6f0a5e1546dad85c20733fdb27cfa4ca782a5fdfb621b416f3494c7d8ca436c12309884550d402ea79f03ef8ddfdd494f7a4",
  37. "creates": null,
  38. "publicKey": null,
  39. "raw": null,
  40. "r": null,
  41. "s": null,
  42. "v": 0,
  43. "valueRaw": "0x0",
  44. "gasPriceRaw": "0x1c9c380",
  45. "gasRaw": "0x1c9c380",
  46. "blockNumberRaw": "0x64",
  47. "transactionIndexRaw": "0x0",
  48. "nonceRaw": "0x2069170146129593df177e2c37f1b7fe74e2d0fda53dcbbca34a243d46e367a"
  49. }
  50. ],
  51. "uncles": [],
  52. "sealFields": null,
  53. "gasUsedRaw": "0x1d8ce",
  54. "totalDifficultyRaw": "0x65",
  55. "numberRaw": "0x64",
  56. "nonceRaw": null,
  57. "sizeRaw": "0x47",
  58. "gasLimitRaw": "0x77359400",
  59. "timestampRaw": "0x16366bddafe",
  60. "difficultyRaw": "0x1"
  61. }
  62. }

3.3. 根据块hash获取块信息接口

接口描述

通过块hash获取块信息

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/blockByHash/{blockHash}

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1群组编号groupIdint
2区块hashblockByHashString

2)数据格式

  1. http://localhost:8081/WeBASE-Front/1/web3/blockByHash/0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade

响应参数

1)数据格式

  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "number": 100,
  6. "hash": "0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade",
  7. "parentHash": "0xc784a2af86e6726fcdc63b57ed1b91a40efc7d8b1b7285154d399ea78bd18754",
  8. "nonce": 0,
  9. "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  10. "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000040000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000800000000000000000000000000",
  11. "transactionsRoot": "0x27055bac669a67e8aaa1455ad9fd70b75dd86dc905c6bd0d111ed67ab182d1dc",
  12. "stateRoot": "0xa05ad5db11b8be6aed3b591f2f64fdbb241506cbe9ef591f3a4b946ca777f838",
  13. "receiptsRoot": "0xc1d4b43ed68d7263ddf50861feec26440e933a0b152917e938194f5079b48ce4",
  14. "author": "0x0000000000000000000000000000000000000000",
  15. "miner": "0x0000000000000000000000000000000000000000",
  16. "mixHash": null,
  17. "difficulty": 1,
  18. "totalDifficulty": 101,
  19. "extraData": "0xd98097312e332e302b2b302d524c696e75782f672b2b2f496e74",
  20. "size": 71,
  21. "gasLimit": 2000000000,
  22. "gasUsed": 121038,
  23. "timestamp": 1526437108478,
  24. "transactions": [
  25. {
  26. "hash": "0xb2c733b742045e61c0fd6e7e2bafece04d56262a4887de9f78dad2c5dd2f944b",
  27. "nonce": 9.1623055443573E+74,
  28. "blockHash": "0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade",
  29. "blockNumber": 100,
  30. "transactionIndex": 0,
  31. "from": "0x59bd3815f73b197d6ef327f2a45089f50aba942a",
  32. "to": "0x986278eb8e8b4ef98bdfc055c02d65865fc87ad2",
  33. "value": 0,
  34. "gasPrice": 30000000,
  35. "gas": 30000000,
  36. "input": "0x48f85bce000000000000000000000000000000000000000000000000000000000000001caf3fbec3675eabb85c0b25e2992d6f0a5e1546dad85c20733fdb27cfa4ca782a5fdfb621b416f3494c7d8ca436c12309884550d402ea79f03ef8ddfdd494f7a4",
  37. "creates": null,
  38. "publicKey": null,
  39. "raw": null,
  40. "r": null,
  41. "s": null,
  42. "v": 0,
  43. "valueRaw": "0x0",
  44. "gasPriceRaw": "0x1c9c380",
  45. "gasRaw": "0x1c9c380",
  46. "blockNumberRaw": "0x64",
  47. "transactionIndexRaw": "0x0",
  48. "nonceRaw": "0x2069170146129593df177e2c37f1b7fe74e2d0fda53dcbbca34a243d46e367a"
  49. }
  50. ],
  51. "uncles": [],
  52. "sealFields": null,
  53. "gasUsedRaw": "0x1d8ce",
  54. "totalDifficultyRaw": "0x65",
  55. "numberRaw": "0x64",
  56. "nonceRaw": null,
  57. "sizeRaw": "0x47",
  58. "gasLimitRaw": "0x77359400",
  59. "timestampRaw": "0x16366bddafe",
  60. "difficultyRaw": "0x1"
  61. }
  62. }

3.4. 获取块中交易个数接口

接口描述

根据块高获取该块中的交易个数

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/blockTransCnt/{blockNumber}

调用方法

HTTP GET

请求参数

  • 参数表
    序号中文参数名类型最大长度必填说明
    1块高blockNumberBigInteger

2)数据格式

http://localhost:8081/WeBASE-Front/1/web3/blockTransCnt/100

响应参数

1)数据格式

  1. {
  2. 1
  3. }

}

3.5. 获取PbftView接口

接口描述

通过调用此接口获取PbftView

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/pbftView

调用方法

HTTP GET

请求参数

  • 参数表
    序号中文参数名类型最大长度必填说明
    1群组编号groupIdint

2)数据格式

http://localhost:8081/WeBASE-Front/1/web3/pbftView

响应参数

1)数据格式

  1. {
  2. 160565
  3. }

3.6. 获取交易回执接口

接口描述

根据交易hash获取交易回执

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/transactionReceipt/{transHash}

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1群组编号groupIdint
2交易hashtransHashString

2)数据格式

  1. http://localhost:8081/WeBASE-Front/1/web3/transactionReceipt/0xb2c733b742045e61c0fd6e7e2bafece04d56262a4887de9f78dad2c5dd2f944b

响应参数

2)数据格式

  1. {
  2. "transactionHash": "0xb2c733b742045e61c0fd6e7e2bafece04d56262a4887de9f78dad2c5dd2f944b",
  3. "transactionIndex": 0,
  4. "blockHash": "0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade",
  5. "blockNumber": 100,
  6. "cumulativeGasUsed": 121038,
  7. "gasUsed": 121038,
  8. "contractAddress": "0x0000000000000000000000000000000000000000",
  9. "root": null,
  10. "from": null,
  11. "to": null,
  12. "logs": [
  13. {
  14. "removed": false,
  15. "logIndex": 0,
  16. "transactionIndex": 0,
  17. "transactionHash": "0xb2c733b742045e61c0fd6e7e2bafece04d56262a4887de9f78dad2c5dd2f944b",
  18. "blockHash": "0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade",
  19. "blockNumber": 100,
  20. "address": "0x986278eb8e8b4ef98bdfc055c02d65865fc87ad2",
  21. "data": "0x00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000001caf3fbec3675eabb85c0b25e2992d6f0a5e1546dad85c20733fdb27cfa4ca782a5fdfb621b416f3494c7d8ca436c12309884550d402ea79f03ef8ddfdd494f7a40000000000000000000000000000000000000000000000000000000000000040666164363863656230616530316530643731616635356331316561643031613532656638363435343866306134643133633836363164393664326461366239380000000000000000000000000000000000000000000000000000000000000002363000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000023630000000000000000000000000000000000000000000000000000000000000",
  22. "type": "mined",
  23. "topics": [
  24. "0xbf474e795141390215f4f179557402a28c562b860f7b74dce4a3c0e0604cd97e"
  25. ],
  26. "logIndexRaw": "0",
  27. "blockNumberRaw": "100",
  28. "transactionIndexRaw": "0"
  29. }
  30. ],
  31. "logsBloom": null,
  32. "gasUsedRaw": "0x1d8ce",
  33. "blockNumberRaw": "100",
  34. "transactionIndexRaw": "0",
  35. "cumulativeGasUsedRaw": "0x1d8ce"
  36. }

3.7. 根据交易hash获取交易信息接口

接口描述

根据交易hash获取交易信息

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/transaction/{transHash}

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1群组编号groupIdint
2交易hashtransHashString

2)数据格式

  1. http://localhost:8081/WeBASE-Front/1/web3/transaction/0xa6750b812b1a7e36313879b09f0c41fc583b463c15e57608416f3a32688b432b

响应参数

1)数据格式

  1. {
  2. "hash": "0xb2c733b742045e61c0fd6e7e2bafece04d56262a4887de9f78dad2c5dd2f944b",
  3. "nonce": 9.1623055443573E+74,
  4. "blockHash": "0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade",
  5. "blockNumber": 100,
  6. "transactionIndex": 0,
  7. "from": "0x59bd3815f73b197d6ef327f2a45089f50aba942a",
  8. "to": "0x986278eb8e8b4ef98bdfc055c02d65865fc87ad2",
  9. "value": 0,
  10. "gasPrice": 30000000,
  11. "gas": 30000000,
  12. "input": "0x48f85bce000000000000000000000000000000000000000000000000000000000000001caf3fbec3675eabb85c0b25e2992d6f0a5e1546dad85c20733fdb27cfa4ca782a5fdfb621b416f3494c7d8ca436c12309884550d402ea79f03ef8ddfdd494f7a4",
  13. "creates": null,
  14. "publicKey": null,
  15. "raw": null,
  16. "r": null,
  17. "s": null,
  18. "v": 0,
  19. "nonceRaw": "0x2069170146129593df177e2c37f1b7fe74e2d0fda53dcbbca34a243d46e367a",
  20. "blockNumberRaw": "0x64",
  21. "transactionIndexRaw": "0x0",
  22. "valueRaw": "0x0",
  23. "gasPriceRaw": "0x1c9c380",
  24. "gasRaw": "0x1c9c380"
  25. }

3.8. 获取web3j版本接口

接口描述

获取web3j版本

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/clientVersion

调用方法

HTTP GET

请求参数

1)参数表

无入参

响应参数

1)参数表

2)数据格式

  1. {
  2. "Build Time": "20190318 10:56:37",
  3. "Build Type": "Linux/g++/RelWithDebInfo",
  4. "FISCO-BCOS Version": "2.0.0-rc1",
  5. "Git Branch": "master",
  6. "Git Commit Hash": "2467ddf73b091bc8e0ee611ccee85db7989ad389"
  7. }

3.9. 获取合约二进制代码接口

接口描述

获取指定块高区块指定合约地址的二进制代码

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/code/{address}/{blockNumber}

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1合约地址addressString
2块高blockNumberBigInteger

响应参数

2)数据格式

  1. {
  2. 0x
  3. }

3.10. 获取总交易数

接口描述

获取总交易数量

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/transaction-total

调用方法

HTTP GET

请求参数

1)参数表

2)数据格式

http://localhost:8081/WeBASE-Front/1/web3/transaction-total

响应参数

1)参数表

序号中文参数名类型最大长度必填说明
1总交易数txSumint
2快高blockNumberint
3blockNumberRawString
4txSumRawString

2)数据格式

  1. {
  2. "txSum": 125,
  3. "blockNumber": 125,
  4. "blockNumberRaw": "0x7d",
  5. "txSumRaw": "0x7d"
  6. }

3.11. 根据块hash和交易index获取交易接口

接口描述

获取指定区块指定位置的交易信息

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/transByBlockHashAndIndex/{blockHash}/{transactionIndex}

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1块hashblockHashString
2交易位置transactionIndexBigInteger

2)数据格式

  1. http://localhost:8081/WeBASE-Front/1/web3/transByBlockHashAndIndex/0xf27ff42d4be65329a1e7b11365e190086d92f9836168d0379e92642786db7ade/0

响应参数

2)数据格式

  1. {
  2. "hash": "0x7c503f202a5e275d8792dd2419ac48418dbec602038fb2a85c899403471f065d",
  3. "nonce": 1.26575985412899E+75,
  4. "blockHash": "0x0d9ed7b20645d5b8200347a72e7fb15347b83d74c6e1b6c3995cdb7a849f95d9",
  5. "blockNumber": 100,
  6. "transactionIndex": 0,
  7. "from": "0x6f00a620a61fd6b33e6076880fecc49959eaa4ea",
  8. "to": "0x9cb5641d991df690ed905c34f9aaf22370034220",
  9. "value": 0,
  10. "gasPrice": 1,
  11. "gas": 100000000,
  12. "input": "0x4ed3885e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000016100000000000000000000000000000000000000000000000000000000000000",
  13. "creates": null,
  14. "publicKey": null,
  15. "raw": null,
  16. "r": null,
  17. "s": null,
  18. "v": 0,
  19. "blockNumberRaw": "0x64",
  20. "nonceRaw": "0x2cc650a5cbeb268577ac15c7dd2afee0680901de94f8543e86e906247e7edbf",
  21. "valueRaw": "0x0",
  22. "gasPriceRaw": "0x1",
  23. "gasRaw": "0x5f5e100",
  24. "transactionIndexRaw": "0x0"
  25. }

3.12. 根据块高和交易index获取交易接口

接口描述

获取指定区块指定位置的交易信息

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/transByBlockNumberAndIndex/{blockNumber}/{transactionIndex}

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1群组编号groupIdint
2块高blockNumberBigInteger
3交易位置transactionIndexBigInteger

2)数据格式

http://localhost:8081/WeBASE-Front/1/web3/transByBlockNumberAndIndex/100/0

响应参数

1)数据格式

  1. {
  2. "hash": "0x7c503f202a5e275d8792dd2419ac48418dbec602038fb2a85c899403471f065d",
  3. "nonce": 1.26575985412899E+75,
  4. "blockHash": "0x0d9ed7b20645d5b8200347a72e7fb15347b83d74c6e1b6c3995cdb7a849f95d9",
  5. "blockNumber": 100,
  6. "transactionIndex": 0,
  7. "from": "0x6f00a620a61fd6b33e6076880fecc49959eaa4ea",
  8. "to": "0x9cb5641d991df690ed905c34f9aaf22370034220",
  9. "value": 0,
  10. "gasPrice": 1,
  11. "gas": 100000000,
  12. "input": "0x4ed3885e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000016100000000000000000000000000000000000000000000000000000000000000",
  13. "creates": null,
  14. "publicKey": null,
  15. "raw": null,
  16. "r": null,
  17. "s": null,
  18. "v": 0,
  19. "blockNumberRaw": "0x64",
  20. "nonceRaw": "0x2cc650a5cbeb268577ac15c7dd2afee0680901de94f8543e86e906247e7edbf",
  21. "valueRaw": "0x0",
  22. "gasPriceRaw": "0x1",
  23. "gasRaw": "0x5f5e100",
  24. "transactionIndexRaw": "0x0"
  25. }

3.13. 获取群组内的共识状态信息接口

接口描述

返回指定群组内的共识状态信息

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/consensusStatus

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1群组编号groupIdint

2)数据格式

http://localhost:8081/WeBASE-Front/1/web3/consensusStatus

响应参数

1)数据格式

  1. [
  2. {
  3. "accountType": 1,
  4. "allowFutureBlocks": true,
  5. "cfgErr": false,
  6. "connectedNodes": 3,
  7. "consensusedBlockNumber": 126,
  8. "currentView": 499824,
  9. "groupId": 1,
  10. "highestblockHash": "0x563d4ec57b597d5d81f0c1b0045c04e57ffebe3a02ff3fef402be56742dc8fd1",
  11. "highestblockNumber": 125,
  12. "leaderFailed": false,
  13. "max_faulty_leader": 1,
  14. "node index": 2,
  15. "nodeId": "d822165959a0ed217df6541f1a7dd38b79336ff571dd5f8f85ad76f3e7ec097e1eabd8b03e4a757fd5a9fb0eea905aded56aaf44df83c34b73acb9ab7ac65010",
  16. "nodeNum": 4,
  17. "omitEmptyBlock": true,
  18. "protocolId": 264,
  19. "sealer.0": "552398be0eef124c000e632b0b76a48c52b6cfbd547d92c15527c2d1df15fab2bcded48353db22526c3540e4ab2027630722889f20a4a614bb11a7887a85941b",
  20. "sealer.1": "adfa2f9116d7ff68e0deb75307fa1595d636bf097ad1de4fb55cff00e4fef40b453abb30388aa2112bf5cd4c987afe2e047250f7049791aa1ee7091c9e2ab7bb",
  21. "sealer.2": "d822165959a0ed217df6541f1a7dd38b79336ff571dd5f8f85ad76f3e7ec097e1eabd8b03e4a757fd5a9fb0eea905aded56aaf44df83c34b73acb9ab7ac65010",
  22. "sealer.3": "dde0bbf5eb3a731e6da861586e98e088e16e6fdd9afae2f2c213cead20a4f5eaa3910042b70d62266d2350d98a43c1f235c8e0da384448384893857873abdb75",
  23. "toView": 499824
  24. },
  25. [
  26. {
  27. "nodeId": "552398be0eef124c000e632b0b76a48c52b6cfbd547d92c15527c2d1df15fab2bcded48353db22526c3540e4ab2027630722889f20a4a614bb11a7887a85941b",
  28. "view": 499823
  29. },
  30. {
  31. "nodeId": "adfa2f9116d7ff68e0deb75307fa1595d636bf097ad1de4fb55cff00e4fef40b453abb30388aa2112bf5cd4c987afe2e047250f7049791aa1ee7091c9e2ab7bb",
  32. "view": 499820
  33. },
  34. {
  35. "nodeId": "d822165959a0ed217df6541f1a7dd38b79336ff571dd5f8f85ad76f3e7ec097e1eabd8b03e4a757fd5a9fb0eea905aded56aaf44df83c34b73acb9ab7ac65010",
  36. "view": 499824
  37. },
  38. {
  39. "nodeId": "dde0bbf5eb3a731e6da861586e98e088e16e6fdd9afae2f2c213cead20a4f5eaa3910042b70d62266d2350d98a43c1f235c8e0da384448384893857873abdb75",
  40. "view": 499822
  41. }
  42. ],
  43. {
  44. "prepareCache_blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  45. "prepareCache_height": -1,
  46. "prepareCache_idx": "65535",
  47. "prepareCache_view": "9223372036854775807"
  48. },
  49. {
  50. "rawPrepareCache_blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  51. "rawPrepareCache_height": -1,
  52. "rawPrepareCache_idx": "65535",
  53. "rawPrepareCache_view": "9223372036854775807"
  54. },
  55. {
  56. "committedPrepareCache_blockHash": "0x15cf36c1f15572c448f7d4295958972e6b876deef319c532b8f7d79fcbde072f",
  57. "committedPrepareCache_height": 125,
  58. "committedPrepareCache_idx": "1",
  59. "committedPrepareCache_view": "62209"
  60. },
  61. {
  62. "signCache_cachedSize": "0"
  63. },
  64. {
  65. "commitCache_cachedSize": "0"
  66. },
  67. {
  68. "viewChangeCache_cachedSize": "0"
  69. }
  70. ]

3.14. 获取节点状态列表接口

接口描述

返回节点的快高、pbftview及状态

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/nodeHeartBeat

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1节点IdnodeIdString
2节点块高blockNumberbigInteger
3节点pbftViewpbftViewbigInteger
4节点状态statusint1正常,2异常
5上次状态修改时间latestStatusUpdateTimeString跟上次状态变更时间间隔至少大于三秒才会重新检测节点状态

2)数据格式

http://localhost:8081/WeBASE-Front/1/web3/getNodeStatusList

响应参数

1)数据格式

  1. {
  2.  
  3. "blockNumber": 1,
  4.  
  5. "pbftView": 1232
  6.  
  7. }

3.15. 获取群组列表接口

接口描述

返回群组列表

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/groupList

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明

2)数据格式

http://localhost:8081/WeBASE-Front/1/web3/groupList

响应参数

1)数据格式

  1. [
  2. "1",
  3. "2"
  4. ]

3.16. 获取观察及共识节点列表

接口描述

返回指定群组内的共识节点和观察节点列表

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/groupPeers

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1群组编号groupIdint

2)数据格式

http://localhost:8081/WeBASE-Front/1/web3/groupPeers

响应参数

1)数据格式

  1. [
  2. "d822165959a0ed217df6541f1a7dd38b79336ff571dd5f8f85ad76f3e7ec097e1eabd8b03e4a757fd5a9fb0eea905aded56aaf44df83c34b73acb9ab7ac65010",
  3. "adfa2f9116d7ff68e0deb75307fa1595d636bf097ad1de4fb55cff00e4fef40b453abb30388aa2112bf5cd4c987afe2e047250f7049791aa1ee7091c9e2ab7bb",
  4. "552398be0eef124c000e632b0b76a48c52b6cfbd547d92c15527c2d1df15fab2bcded48353db22526c3540e4ab2027630722889f20a4a614bb11a7887a85941b",
  5. "dde0bbf5eb3a731e6da861586e98e088e16e6fdd9afae2f2c213cead20a4f5eaa3910042b70d62266d2350d98a43c1f235c8e0da384448384893857873abdb75"
  6. ]

3.17. 获取群组内观察节点列表

接口描述

返回指定群组内的观察节点列表

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/observerList

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1群组编号groupIdint

2)数据格式

http://localhost:8081/WeBASE-Front/1/web3/observerList

响应参数

1)数据格式

  1. [
  2. "d822165959a0ed217df6541f1a7dd38b79336ff571dd5f8f85ad76f3e7ec097e1eabd8b03e4a757fd5a9fb0eea905aded56aaf44df83c34b73acb9ab7a165010"
  3. ]

3.18. 获取群组最新的pbftview视图

top

接口描述

返回指定群组内的pbftview

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/pbftView

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1群组编号groupIdint

2)数据格式

http://localhost:8081/WeBASE-Front/1/web3/pbftView

响应参数

1)数据格式

  1. 859

3.19. 获取已连接的P2P节点信息

接口描述

返回指定群组内已连接的P2P节点信息

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/peers

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1群组编号groupIdint

2)数据格式

http://localhost:8081/WeBASE-Front/1/web3/peers

响应参数

1)数据格式

  1. [
  2. {
  3. "ipandPort": "127.0.0.1:30301",
  4. "IPAndPort": "127.0.0.1:30301",
  5. "NodeID": "adfa2f9116d7ff68e0deb75307fa1595d636bf097ad1de4fb55cff00e4fef40b453abb30388aa2112bf5cd4c987afe2e047250f7049791aa1ee7091c9e2ab7bb",
  6. "Topic": []
  7. },
  8. {
  9. "ipandPort": "127.0.0.1:57678",
  10. "IPAndPort": "127.0.0.1:57678",
  11. "NodeID": "e28f3d7f5b82e21918a15639eac342dcf678ebb0efe7c65c76514b0ba6b28ace8e47b4a25c9b3f9763b79db847e250a19f827b132f230298980f3ca9779c2564",
  12. "Topic": []
  13. },
  14. {
  15. "ipandPort": "127.0.0.1:57608",
  16. "IPAndPort": "127.0.0.1:57608",
  17. "NodeID": "dde0bbf5eb3a731e6da861586e98e088e16e6fdd9afae2f2c213cead20a4f5eaa3910042b70d62266d2350d98a43c1f235c8e0da384448384893857873abdb75",
  18. "Topic": []
  19. },
  20. {
  21. "ipandPort": "127.0.0.1:57616",
  22. "IPAndPort": "127.0.0.1:57616",
  23. "NodeID": "552398be0eef124c000e632b0b76a48c52b6cfbd547d92c15527c2d1df15fab2bcded48353db22526c3540e4ab2027630722889f20a4a614bb11a7887a85941b",
  24. "Topic": []
  25. },
  26. {
  27. "ipandPort": "127.0.0.1:57670",
  28. "IPAndPort": "127.0.0.1:57670",
  29. "NodeID": "56edfaf60bcb09b9814ad31dcd959eb388f0314445db3deb92cedde97c0ecec210f713591a15f3a7168ba023290cfbe78656b57c37157e6ec74a85182630bd61",
  30. "Topic": []
  31. }
  32. ]

3.20. 获取群组内正在处理的交易数

接口描述

获取群组内正在处理的交易数

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/pending-transactions-count

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1群组编号groupIdint

2)数据格式

http://localhost:8081/WeBASE-Front/1/web3/pending-transactions-count

响应参数

1)数据格式

  1. 0

3.21. 获取共识节点接口

接口描述

返回群组内共识节点列表

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/sealerList

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1群组编号groupIdint

2)数据格式

http://localhost:8081/WeBASE-Front/1/web3/sealerList

响应参数

1)数据格式

  1. [
  2. "d822165959a0ed217df6541f1a7dd38b79336ff571dd5f8f85ad76f3e7ec097e1eabd8b03e4a757fd5a9fb0eea905aded56aaf44df83c34b73acb9ab7ac65010",
  3. "adfa2f9116d7ff68e0deb75307fa1595d636bf097ad1de4fb55cff00e4fef40b453abb30388aa2112bf5cd4c987afe2e047250f7049791aa1ee7091c9e2ab7bb",
  4. "552398be0eef124c000e632b0b76a48c52b6cfbd547d92c15527c2d1df15fab2bcded48353db22526c3540e4ab2027630722889f20a4a614bb11a7887a85941b",
  5. "dde0bbf5eb3a731e6da861586e98e088e16e6fdd9afae2f2c213cead20a4f5eaa3910042b70d62266d2350d98a43c1f235c8e0da384448384893857873abdb75"
  6. ]

3.22. 区块/交易

接口描述

如果输入块高就返回区块信息,如果输入交易hash就返回交易信息

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/search?input={inputValue}

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1群组编号groupIdint
2查询参数inputValueint/String如果输入块高就返回区块信息,如果输入交易hash就返回交易信息

2)数据格式

http://localhost:8081/WeBASE-Front/1/web3/search?input=1

响应参数

1)数据格式

  1. {
  2. "number": 1,
  3. "hash": "0x3875dbec6e0ad0790dc0a0e8535b7c286ef7cee4149e5b1494f5c65631a9e321",
  4. "parentHash": "0xed3350d191d23cbc609c98e920baa583403b9a02fa934df868e7f425cd72f5c3",
  5. "nonce": 0,
  6. "sha3Uncles": null,
  7. "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  8. "transactionsRoot": "0xa3db8478e08931f8967023a60d260b182d828aad959433e0b77f097d7650b742",
  9. "stateRoot": "0xf32d3e504fc8813c139d1f6f61ae1c8e355502e10b9ea24e5ad5d3ada01ea400",
  10. "receiptsRoot": null,
  11. "author": null,
  12. "sealer": "0x0",
  13. "mixHash": null,
  14. "difficulty": 0,
  15. "totalDifficulty": 0,
  16. "extraData": [],
  17. "size": 0,
  18. "gasLimit": 0,
  19. "gasUsed": 0,
  20. "timestamp": 1557304350431,
  21. "transactions": [
  22. {
  23. "hash": "0x4145b921309fcaa92b05b782e0181d671b8e68fc6d61d939358ed558fa3489c9",
  24. "nonce": 1.47418536037145E+75,
  25. "blockHash": "0x3875dbec6e0ad0790dc0a0e8535b7c286ef7cee4149e5b1494f5c65631a9e321",
  26. "blockNumber": 1,
  27. "transactionIndex": 0,
  28. "from": "0x33a41878e78fb26735bf425f9328990e3a1a89df",
  29. "to": null,
  30. "value": 0,
  31. "gasPrice": 1,
  32. "gas": 100000000,
  33. "input": "0x6080604052348015600f57600080fd5b5060868061001e6000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806335b09a6e146044575b600080fd5b348015604f57600080fd5b5060566058565b005b5600a165627a7a723058204aacdb57d6f2ae0f7f6c89c28236bba0205631183fd99785de220481566e683f0029",
  34. "creates": null,
  35. "publicKey": null,
  36. "raw": null,
  37. "r": null,
  38. "s": null,
  39. "v": 0,
  40. "nonceRaw": "0x3425bfe0f36e343686ccbe34a4fe8b05e0e0257ea7ee87417a6d898f0eb43ec",
  41. "transactionIndexRaw": "0x0",
  42. "blockNumberRaw": "0x1",
  43. "valueRaw": "0x0",
  44. "gasPriceRaw": "0x1",
  45. "gasRaw": "0x5f5e100"
  46. }
  47. ],
  48. "uncles": null,
  49. "sealFields": null,
  50. "nonceRaw": null,
  51. "numberRaw": "0x1",
  52. "difficultyRaw": null,
  53. "totalDifficultyRaw": null,
  54. "sizeRaw": null,
  55. "gasLimitRaw": "0x0",
  56. "gasUsedRaw": "0x0",
  57. "timestampRaw": "0x16a969296df"
  58. }

3.23. 获取群组内同步状态信息

接口描述

获取群组内同步状态信息

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/syncStatus

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1群组编号groupIdint

2)数据格式

http://localhost:8081/WeBASE-Front/1/web3/syncStatus

响应参数

1)数据格式

  1. {
  2. "blockNumber": 126,
  3. "genesisHash": "0xed3350d191d23cbc609c98e920baa583403b9a02fa934df868e7f425cd72f5c3",
  4. "isSyncing": false,
  5. "latestHash": "0x49ca6eb004f372c71ed900ec6992582cd107e4f3ea36aaa5a0a78829ebef1f14",
  6. "nodeId": "d822165959a0ed217df6541f1a7dd38b79336ff571dd5f8f85ad76f3e7ec097e1eabd8b03e4a757fd5a9fb0eea905aded56aaf44df83c34b73acb9ab7ac65010",
  7. "peers": [
  8. {
  9. "blockNumber": 126,
  10. "genesisHash": "0xed3350d191d23cbc609c98e920baa583403b9a02fa934df868e7f425cd72f5c3",
  11. "latestHash": "0x49ca6eb004f372c71ed900ec6992582cd107e4f3ea36aaa5a0a78829ebef1f14",
  12. "nodeId": "552398be0eef124c000e632b0b76a48c52b6cfbd547d92c15527c2d1df15fab2bcded48353db22526c3540e4ab2027630722889f20a4a614bb11a7887a85941b"
  13. },
  14. {
  15. "blockNumber": 126,
  16. "genesisHash": "0xed3350d191d23cbc609c98e920baa583403b9a02fa934df868e7f425cd72f5c3",
  17. "latestHash": "0x49ca6eb004f372c71ed900ec6992582cd107e4f3ea36aaa5a0a78829ebef1f14",
  18. "nodeId": "adfa2f9116d7ff68e0deb75307fa1595d636bf097ad1de4fb55cff00e4fef40b453abb30388aa2112bf5cd4c987afe2e047250f7049791aa1ee7091c9e2ab7bb"
  19. },
  20. {
  21. "blockNumber": 126,
  22. "genesisHash": "0xed3350d191d23cbc609c98e920baa583403b9a02fa934df868e7f425cd72f5c3",
  23. "latestHash": "0x49ca6eb004f372c71ed900ec6992582cd107e4f3ea36aaa5a0a78829ebef1f14",
  24. "nodeId": "dde0bbf5eb3a731e6da861586e98e088e16e6fdd9afae2f2c213cead20a4f5eaa3910042b70d62266d2350d98a43c1f235c8e0da384448384893857873abdb75"
  25. }
  26. ],
  27. "protocolId": 265,
  28. "txPoolSize": "0"
  29. }

3.24. 获取交易信息接口

接口描述

根据交易hash查询交易信息

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/transaction/{transHash}

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1群组编号groupIdint
2交易hashtransHashString

2)数据格式

  1. http://localhost:8081/WeBASE-Front/1/web3/transaction/0x4145b921309fcaa92b05b782e0181d671b8e68fc6d61d939358ed558fa3489c9

响应参数

1)数据格式

  1. {
  2. "hash": "0x4145b921309fcaa92b05b782e0181d671b8e68fc6d61d939358ed558fa3489c9",
  3. "nonce": 1.47418536037145E+75,
  4. "blockHash": "0x3875dbec6e0ad0790dc0a0e8535b7c286ef7cee4149e5b1494f5c65631a9e321",
  5. "blockNumber": 1,
  6. "transactionIndex": 0,
  7. "from": "0x33a41878e78fb26735bf425f9328990e3a1a89df",
  8. "to": "0x0000000000000000000000000000000000000000",
  9. "value": 0,
  10. "gasPrice": 1,
  11. "gas": 100000000,
  12. "input": "0x6080604052348015600f57600080fd5b5060868061001e6000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806335b09a6e146044575b600080fd5b348015604f57600080fd5b5060566058565b005b5600a165627a7a723058204aacdb57d6f2ae0f7f6c89c28236bba0205631183fd99785de220481566e683f0029",
  13. "creates": null,
  14. "publicKey": null,
  15. "raw": null,
  16. "r": null,
  17. "s": null,
  18. "v": 0,
  19. "transactionIndexRaw": "0x0",
  20. "valueRaw": "0x0",
  21. "gasPriceRaw": "0x1",
  22. "blockNumberRaw": "0x1",
  23. "gasRaw": "0x5f5e100",
  24. "nonceRaw": "0x3425bfe0f36e343686ccbe34a4fe8b05e0e0257ea7ee87417a6d898f0eb43ec"
  25. }

3.25. 获取交易回执接口

接口描述

根据交易hash查询交易回执

接口URL

http://localhost:8081/WeBASE-Front/{groupId}/web3/transactionReceipt/{transHash}

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1群组编号groupIdint
2交易hashtransHashString

2)数据格式

  1. http://localhost:8081/WeBASE-Front/1/web3/transactionReceipt/0x4145b921309fcaa92b05b782e0181d671b8e68fc6d61d939358ed558fa3489c9

响应参数

1)数据格式

  1. {
  2. "transactionHash": "0x4145b921309fcaa92b05b782e0181d671b8e68fc6d61d939358ed558fa3489c9",
  3. "transactionIndex": 0,
  4. "blockHash": "0x3875dbec6e0ad0790dc0a0e8535b7c286ef7cee4149e5b1494f5c65631a9e321",
  5. "blockNumber": 1,
  6. "cumulativeGasUsed": 0,
  7. "gasUsed": 88537,
  8. "contractAddress": "0x30905b39fa9f08822f342377d229d781ae8f9be6",
  9. "root": null,
  10. "status": "0x0",
  11. "from": "0x33a41878e78fb26735bf425f9328990e3a1a89df",
  12. "to": "0x0000000000000000000000000000000000000000",
  13. "output": "0x",
  14. "logs": [],
  15. "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  16. "transactionIndexRaw": "0x0",
  17. "blockNumberRaw": "0x1",
  18. "statusOK": true,
  19. "cumulativeGasUsedRaw": null,
  20. "gasUsedRaw": "0x159d9"
  21. }

4. 性能检测接口

4.1. 获取机器配置信息

接口描述

获取机器配置信息

接口URL

http://localhost:8081/WeBASE-Front/performance/config

调用方法

HTTP GET

请求参数

1)参数表

无入参

响应参数

4.2. 获取机器历史性能信息

接口描述

获取机器历史性能信息

接口URL

http://localhost:8081/WeBASE-Front/performance

调用方法

HTTP GET

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1开始日期beginDateLocalDateTime
2结束日期endDateLocalDateTime
3对比开始日期contrastBeginDateLocalDateTime
4对比结束日期contrastEndDateLocalDateTime
5间隔gapint

响应参数

1)参数表

  1. {
  2. [{"metricType":"cpu","data":{"lineDataList":{"timestampList":[],"valueList":[]},"contrastDataList":{"timestampList":[],"valueList":[]}}},{"metricType":"memory","data":{"lineDataList":{"timestampList":null,"valueList":[]},"contrastDataList":{"timestampList":null,"valueList":[]}}},{"metricType":"disk","data":{"lineDataList":{"timestampList":null,"valueList":[]},"contrastDataList":{"timestampList":null,"valueList":[]}}},{"metricType":"txbps","data":{"lineDataList":{"timestampList":null,"valueList":[]},"contrastDataList":{"timestampList":null,"valueList":[]}}},{"metricType":"rxbps","data":{"lineDataList":{"timestampList":null,"valueList":[]},"contrastDataList":{"timestampList":null,"valueList":[]}}}]}
  3. }

5. 交易接口

5.1. 交易处理接口

接口描述

通过合约信息进行调用,前置根据调用的合约方法是否是“constant”方法区分返回信息,“constant”方法为查询,返回要查询的信息。非“constant”方法为发送数据上链,返回块hash、块高、交易hash等信息。

接口URL

http://localhost:8081/WeBASE-Front/trans/handle

调用方法

HTTP POST

请求参数

1)参数表

序号中文参数名类型最大长度必填说明
1用户地址userString用户地址
2合约名称contractNameString
3合约地址contractAddressString
4方法名funcNameString
5方法参数funcParamListJSONArray,对应合约方法参数,多个参数以“,”分隔
6群组IDgroupIdint
7是否是加密私钥useAesboolean

2)数据格式

  1. {
  2. "useAes ":false,
  3. "user ":0x3615c3819708b9c113d93a6720a11bfd6be9d39a,
  4. "contractName":"HelloWorld",
  5. "contractAddress":"dasdfav23rf213vbcdvadf3bcdf2fc23rqde",
  6. "funcName":"set",
  7. "funcParam":["Hi,Welcome!"],
  8. "groupId" :"1"
  9. }

示例:curl -l -H “Content-type: application/json” -X POST -d ‘{“contractName”:“HelloWorld”, “funcName”: “set”, “funcParam”: [“Hi,Welcome!”], “user”: “0x3615c3819708b9c113d93a6720a11bfd6be9d39a”, “useAes”: false, “contractAddress”:”dasdfav23rf213vbcdvadf3bcdf2fc23rqde”,”groupId”: 1}’ http://10.0.0.1:8081/WeBASE-Front/trans/handle

响应参数

  • 数据格式a、正确查询交易返回值信息
  1. {"Hi,Welcome!"}

b、正确发送数据上链返回值信息(交易收据)

  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "blockHash":
  6. "0x1d8d8275aa116d65893291c140849be272dac1d4ca0a0a722f44404b2f2356c3",
  7. "gasUsed": 32798,
  8. "transactionIndexRaw": "0",
  9. "blockNumberRaw": "33",
  10. "blockNumber": 33,
  11. "contractAddress": "0x0000000000000000000000000000000000000000",
  12. "cumulativeGasUsed": 32798,
  13. "transactionIndex": 0,
  14. "gasUsedRaw": "0x801e",
  15. "logs": [],
  16. "cumulativeGasUsedRaw": "0x801e",
  17. "transactionHash":"0x0653a8e959771955330461456dd094a96d9071bfa31e6f43b68b30f10a85689c"
  18. }
  19. }

6. 附录

1. 返回码信息列表


codemessage描述
0success成功
101001system error系统异常
101002param valid fail参数校验异常
201001uuid cannot be empty业务流水号不能为空
201002userId cannot be empty用户编号不能为空
201003contractName cannot be empty合约名不能为空
201004version cannot be empty合约版本不能为空
201005funcName cannot be empty方法名不能为空
201006abiInfo cannot be emptyabi内容不能为空
201007contractBin cannot be empty合约bin不能为空
201008contract's current version has been deployed该合约版本已部署
201009contract is not deployed合约未部署
201010save abi errorabi保存错误
201011request funcParam is error请求的方法参数错误
201012requst blockNumber is greater than latest请求块高大于最新块高
201013get abi from chain error获取合约abi错误
201014contract deploy error合约部署错误
201015user's privateKey is null用户私钥为空
201016file is not exist文件不存在
201017failed to get node config获取节点配置失败
201018blockNumber and pbftView unchanged块高和view没有变化
201019request function is error请求的方法错误
201020transaction query from chain failed交易查询失败
201021transaction send to chain failed交易上链失败
201022node request failed节点请求失败