接口说明

    接口描述

    接口URL

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

    调用方法

    HTTP POST

    请求参数

    1)参数表

    2)数据格式

    响应参数

    1)数据格式

    1.2. 合约部署接口(结合WeBASE-Sign)

    接口描述

    将合约部署到当前节点。此接口需结合WeBASE-Sign使用,通过调用WeBASE-Sign服务的签名接口让相关用户对数据进行签名,拿回签名数据再发送上链。需要调用此接口时,工程配置文件application.yml中的配置”keyServer”需配置WeBASE-Sign服务的ip和端口,并保证WeBASE-Sign服务正常和存在相关用户。

    构造方法参数(funcParam)为JSON数组,多个参数以逗号分隔(参数为数组时同理),示例:

    1. constructor(uint n,bool b) -> [1,true]
    2. constructor(bytes b,address[] a) -> ["0x1a",["0x7939E26070BE44E6c4Fc759Ce55C6C8b166d94BE","0xce867fD9afa64175bb50A4Aa0c17fC7C4A3C67D9"]]

    构造方法参数(funcParam)为JSON数组,多个参数以逗号分隔(参数为数组时同理),示例:

    1. constructor(string s) -> ["aa,bb\"cc"] // 双引号要转义
    2. constructor(uint n,bool b) -> [1,true]
    3. constructor(bytes b,address[] a) -> ["0x1a",["0x7939E26070BE44E6c4Fc759Ce55C6C8b166d94BE","0xce867fD9afa64175bb50A4Aa0c17fC7C4A3C67D9"]]

    查看WeBASE-Front通过本地私钥(测试用户)部署合约的接口(非WeBASE-Sign签名交易),可查看其他接口-合约部署接口(本地签名)

    接口URL

    http://localhost:5002/WeBASE-Front/contract/deployWithSign

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1所属群组groupIdint
    2用户编号signUserIdStringWeBASE-Sign中的用户编号,通过webase-sign创建私钥获取
    3合约名称contractNameString
    4合约abiabiInfoList合约编译后生成的abi内容
    5合约binbytecodeBinString合约编译的bytecode(bin),用于部署合约
    6构造函数参数funcParamList合约构造函数所需参数,JSON数组,多个参数以逗号分隔(参数为数组时同理),如:[“str1”,[“arr1”,”arr2”]]
    7合约版本versionString用于指定合约在CNS中的版本

    2)数据格式

    1. {
    2. "abiInfo": [{
    3. "constant": true,
    4. "inputs": [],
    5. "name": "get",
    6. "outputs": [{
    7. "name": "",
    8. "type": "string"
    9. }],
    10. "payable": false,
    11. "stateMutability": "view",
    12. "type": "function"
    13. }, {
    14. "constant": false,
    15. "inputs": [{
    16. "name": "n",
    17. "type": "string"
    18. }],
    19. "name": "set",
    20. "outputs": [],
    21. "payable": false,
    22. "stateMutability": "nonpayable",
    23. "type": "function"
    24. }, {
    25. "inputs": [],
    26. "payable": false,
    27. "stateMutability": "nonpayable",
    28. "type": "constructor"
    29. }, {
    30. "anonymous": false,
    31. "inputs": [{
    32. "indexed": false,
    33. "name": "",
    34. "type": "string"
    35. }],
    36. "name": "Test",
    37. "type": "event"
    38. }],
    39. "bytecodeBin": "608060405234801561001057600080fd5b506040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061005c929190610062565b50610107565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100a357805160ff19168380011785556100d1565b828001600101855582156100d1579182015b828111156100d05782518255916020019190600101906100b5565b5b5090506100de91906100e2565b5090565b61010491905b808211156101005760008160009055506001016100e8565b5090565b90565b610373806101166000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d146100515780633590b49f146100e1575b600080fd5b34801561005d57600080fd5b5061006661014a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100a657808201518184015260208101905061008b565b50505050905090810190601f1680156100d35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100ed57600080fd5b50610148600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506101ec565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156101e25780601f106101b7576101008083540402835291602001916101e2565b820191906000526020600020905b8154815290600101906020018083116101c557829003601f168201915b5050505050905090565b80600090805190602001906102029291906102a2565b507f89737d892c26516d1f01db9c083272cfafd004b0c31c32b9b39dbe07037fca24816040518080602001828103825283818151815260200191508051906020019080838360005b8381101561026557808201518184015260208101905061024a565b50505050905090810190601f1680156102925780820380516001836020036101000a031916815260200191505b509250505060405180910390a150565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106102e357805160ff1916838001178555610311565b82800160010185558215610311579182015b828111156103105782518255916020019190600101906102f5565b5b50905061031e9190610322565b5090565b61034491905b80821115610340576000816000905550600101610328565b5090565b905600a165627a7a723058202a7dede15aee7c8148afdeb9f48a479ded2e2b0588f8ec9953145fe7cb15b52b0029",
    40. "funcParam": [],
    41. "groupId": 1,
    42. "signUserId": "ed54e13b0abf4c69b788bd83b8e3515e"
    43. }

    示例:

    1. curl -X POST "http://localhost:5002/WeBASE-Front/contract/deployWithSign" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"abiInfo\":[{\t\t\"constant\": true,\t\t\"inputs\": [],\t\t\"name\": \"get\",\t\t\"outputs\": [{\t\t\t\"name\": \"\",\t\t\t\"type\": \"string\"\t\t}],\t\t\"payable\": false,\t\t\"stateMutability\": \"view\",\t\t\"type\": \"function\"\t}, {\t\t\"constant\": false,\t\t\"inputs\": [{\t\t\t\"name\": \"n\",\t\t\t\"type\": \"string\"\t\t}],\t\t\"name\": \"set\",\t\t\"outputs\": [],\t\t\"payable\": false,\t\t\"stateMutability\": \"nonpayable\",\t\t\"type\": \"function\"\t}, {\t\t\"inputs\": [],\t\t\"payable\": false,\t\t\"stateMutability\": \"nonpayable\",\t\t\"type\": \"constructor\"\t}, {\t\t\"anonymous\": false,\t\t\"inputs\": [{\t\t\t\"indexed\": false,\t\t\t\"name\": \"\",\t\t\t\"type\": \"string\"\t\t}],\t\t\"name\": \"Test\",\t\t\"type\": \"event\"\t}],\"bytecodeBin\": \"608060405234801561001057600080fd5b506040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061005c929190610062565b50610107565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100a357805160ff19168380011785556100d1565b828001600101855582156100d1579182015b828111156100d05782518255916020019190600101906100b5565b5b5090506100de91906100e2565b5090565b61010491905b808211156101005760008160009055506001016100e8565b5090565b90565b610373806101166000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d146100515780633590b49f146100e1575b600080fd5b34801561005d57600080fd5b5061006661014a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100a657808201518184015260208101905061008b565b50505050905090810190601f1680156100d35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100ed57600080fd5b50610148600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506101ec565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156101e25780601f106101b7576101008083540402835291602001916101e2565b820191906000526020600020905b8154815290600101906020018083116101c557829003601f168201915b5050505050905090565b80600090805190602001906102029291906102a2565b507f89737d892c26516d1f01db9c083272cfafd004b0c31c32b9b39dbe07037fca24816040518080602001828103825283818151815260200191508051906020019080838360005b8381101561026557808201518184015260208101905061024a565b50505050905090810190601f1680156102925780820380516001836020036101000a031916815260200191505b509250505060405180910390a150565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106102e357805160ff1916838001178555610311565b82800160010185558215610311579182015b828111156103105782518255916020019190600101906102f5565b5b50905061031e9190610322565b5090565b61034491905b80821115610340576000816000905550600101610328565b5090565b905600a165627a7a723058202a7dede15aee7c8148afdeb9f48a479ded2e2b0588f8ec9953145fe7cb15b52b0029\", \"groupId\": 1, \"signUserId\": \"ed54e13b0abf4c69b788bd83b8e3515e\"}"

    响应参数

    1)数据格式

    返回合约地址:

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

    1.3. 合约部署接口(本地签名)

    接口描述

    此接口为WeBASE-Front使用本地私钥(页面中的测试用户)进行签名

    将合约部署到当前节点。

    构造方法参数(funcParam)为JSON数组,多个参数以逗号分隔(参数为数组时同理),示例:

    1. constructor(string s) -> ["aa,bb\"cc"] // 双引号要转义
    2. constructor(uint n,bool b) -> [1,true]
    3. constructor(bytes b,address[] a) -> ["0x1a",["0x7939E26070BE44E6c4Fc759Ce55C6C8b166d94BE","0xce867fD9afa64175bb50A4Aa0c17fC7C4A3C67D9"]]

    构造方法参数(funcParam)为JSON数组,多个参数以逗号分隔(参数为数组时同理),示例:

    1. constructor(string s) -> ["aa,bb\"cc"] // 双引号要转义
    2. constructor(uint n,bool b) -> [1,true]
    3. constructor(bytes b,address[] a) -> ["0x1a",["0x7939E26070BE44E6c4Fc759Ce55C6C8b166d94BE","0xce867fD9afa64175bb50A4Aa0c17fC7C4A3C67D9"]]

    查看WeBASE-Front通过WeBASE-Sign部署合约的接口(非本地私钥签名交易),可查看合约接口-合约部署接口(结合WeBASE-Sign)

    接口URL

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

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1所属群组groupIdint
    2用户地址userString用户地址,可通过/privateKey接口创建
    3合约名称contractNameString
    4合约abiabiInfoList合约编译后生成的abi文件内容
    5合约binbytecodeBinString合约编译的bytecode(bin),用于部署合约
    6构造函数参数funcParamList合约构造函数所需参数,JSON数组,多个参数以逗号分隔(参数为数组时同理),如:[“str1”,[“arr1”,”arr2”]]

    2)数据格式

    1. {
    2. "abiInfo": [{
    3. "constant": true,
    4. "inputs": [],
    5. "name": "get",
    6. "outputs": [{
    7. "name": "",
    8. "type": "string"
    9. }],
    10. "payable": false,
    11. "stateMutability": "view",
    12. "type": "function"
    13. }, {
    14. "constant": false,
    15. "inputs": [{
    16. "name": "n",
    17. "type": "string"
    18. }],
    19. "name": "set",
    20. "outputs": [],
    21. "payable": false,
    22. "stateMutability": "nonpayable",
    23. "type": "function"
    24. }, {
    25. "inputs": [],
    26. "payable": false,
    27. "stateMutability": "nonpayable",
    28. "type": "constructor"
    29. }],
    30. "bytecodeBin": "608060405234801561001057600080fd5b506040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061005c929190610062565b50610107565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100a357805160ff19168380011785556100d1565b828001600101855582156100d1579182015b828111156100d05782518255916020019190600101906100b5565b5b5090506100de91906100e2565b5090565b61010491905b808211156101005760008160009055506001016100e8565b5090565b90565b6102d7806101166000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d146100515780633590b49f146100e1575b600080fd5b34801561005d57600080fd5b5061006661014a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100a657808201518184015260208101905061008b565b50505050905090810190601f1680156100d35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100ed57600080fd5b50610148600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506101ec565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156101e25780601f106101b7576101008083540402835291602001916101e2565b820191906000526020600020905b8154815290600101906020018083116101c557829003601f168201915b5050505050905090565b8060009080519060200190610202929190610206565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061024757805160ff1916838001178555610275565b82800160010185558215610275579182015b82811115610274578251825591602001919060010190610259565b5b5090506102829190610286565b5090565b6102a891905b808211156102a457600081600090555060010161028c565b5090565b905600a165627a7a72305820748030e2b07f36768ce36d28f7d8dac238065a349c87ffd036d6009b2dcc10950029",
    31. "funcParam": [],
    32. "groupId": 1,
    33. "user": "0xe11dda6939ef947f9ef78f626e5c4fe0cbcbce1e"
    34. }

    示例:

    1. curl -X POST "http://127.0.0.1:5002/WeBASE-Front/contract/deploy" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"abiInfo\": [{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"n\",\"type\":\"string\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}], \"bytecodeBin\": \"608060405234801561001057600080fd5b506040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061005c929190610062565b50610107565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100a357805160ff19168380011785556100d1565b828001600101855582156100d1579182015b828111156100d05782518255916020019190600101906100b5565b5b5090506100de91906100e2565b5090565b61010491905b808211156101005760008160009055506001016100e8565b5090565b90565b6102d7806101166000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d146100515780633590b49f146100e1575b600080fd5b34801561005d57600080fd5b5061006661014a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100a657808201518184015260208101905061008b565b50505050905090810190601f1680156100d35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100ed57600080fd5b50610148600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506101ec565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156101e25780601f106101b7576101008083540402835291602001916101e2565b820191906000526020600020905b8154815290600101906020018083116101c557829003601f168201915b5050505050905090565b8060009080519060200190610202929190610206565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061024757805160ff1916838001178555610275565b82800160010185558215610275579182015b82811115610274578251825591602001919060010190610259565b5b5090506102829190610286565b5090565b6102a891905b808211156102a457600081600090555060010161028c565b5090565b905600a165627a7a72305820748030e2b07f36768ce36d28f7d8dac238065a349c87ffd036d6009b2dcc10950029\", \"funcParam\": [ ], \"groupId\": 1, \"user\": \"0xe11dda6939ef947f9ef78f626e5c4fe0cbcbce1e\"}"

    响应参数

    1)数据格式

    返回合约地址:

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

    1.4. java转译接口

    接口描述

    将合约abi转成java文件

    接口URL

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1合约名称contractNameString
    2合约abiabiInfoList一个ABI的JsonArray
    3合约bincontractBinString合约编译的runtime-bytecode(runtime-bin)
    4所在目录packageNameString生成java所在的包名

    2)数据格式

    1. {
    2. "contractName": "HeHe",
    3. "abiInfo": [{"constant":true,"inputs":[],"name":"get","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"n","type":"string"}],"name":"set","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"}],
    4. "contractBin": "60806040526004361061004c576000357c0100000000000000000000029",
    5. "packageName": "com.webank"
    6. }

    响应参数

    1)数据格式 返回Java合约类源码

    1. package com.webank;
    2. import java.util.Arrays;
    3. ...
    4. @SuppressWarnings("unchecked")
    5. public class HelloWorld extends Contract {
    6. public static final String[] BINARY_ARRAY = {""};
    7. public static final String BINARY = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", BINARY_ARRAY);
    8. public static final String[] SM_BINARY_ARRAY = {""};
    9. public static final String SM_BINARY = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", SM_BINARY_ARRAY);
    10. public static final String[] ABI_ARRAY = {"[{\"name\":\"get\",\"type\":\"function\",\"constant\":true,\"payable\":false,\"anonymous\":false,\"stateMutability\":\"view\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"indexed\":false,\"components\":null,\"typeAsString\":\"string\"}],\"methodSignatureAsString\":\"get()\"},{\"name\":\"set\",\"type\":\"function\",\"constant\":false,\"payable\":false,\"anonymous\":false,\"stateMutability\":\"nonpayable\",\"inputs\":[{\"name\":\"n\",\"type\":\"string\",\"indexed\":false,\"components\":null,\"typeAsString\":\"string\"}],\"outputs\":[],\"methodSignatureAsString\":\"set(string)\"},{\"name\":null,\"type\":\"constructor\",\"constant\":false,\"payable\":false,\"anonymous\":false,\"stateMutability\":\"nonpayable\",\"inputs\":[],\"outputs\":null,\"methodSignatureAsString\":\"null()\"}]"};
    11. public static final String ABI = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", ABI_ARRAY);
    12. public static final String FUNC_GET = "get";
    13. public static final String FUNC_SET = "set";
    14. protected HelloWorld(String contractAddress, Client client, CryptoKeyPair credential) {
    15. super(getBinary(client.getCryptoSuite()), contractAddress, client, credential);
    16. }
    17. public static String getBinary(CryptoSuite cryptoSuite) {
    18. return (cryptoSuite.getCryptoTypeConfig() == CryptoType.ECDSA_TYPE ? BINARY : SM_BINARY);
    19. }
    20. public String get() throws ContractException {
    21. final Function function = new Function(FUNC_GET,
    22. Arrays.<Type>asList(),
    23. Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}));
    24. return executeCallWithSingleValueReturn(function, String.class);
    25. }
    26. public TransactionReceipt set(String n) {
    27. final Function function = new Function(
    28. FUNC_SET,
    29. Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Utf8String(n)),
    30. Collections.<TypeReference<?>>emptyList());
    31. return executeTransaction(function);
    32. }
    33. public void set(String n, TransactionCallback callback) {
    34. final Function function = new Function(
    35. FUNC_SET,
    36. Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Utf8String(n)),
    37. Collections.<TypeReference<?>>emptyList());
    38. asyncExecuteTransaction(function, callback);
    39. }
    40. public String getSignedTransactionForSet(String n) {
    41. final Function function = new Function(
    42. FUNC_SET,
    43. Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Utf8String(n)),
    44. Collections.<TypeReference<?>>emptyList());
    45. return createSignedTransaction(function);
    46. }
    47. public Tuple1<String> getSetInput(TransactionReceipt transactionReceipt) {
    48. String data = transactionReceipt.getInput().substring(10);
    49. final Function function = new Function(FUNC_SET,
    50. Arrays.<Type>asList(),
    51. Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}));
    52. List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
    53. return new Tuple1<String>(
    54. (String) results.get(0).getValue()
    55. );
    56. }
    57. public static HelloWorld load(String contractAddress, Client client, CryptoKeyPair credential) {
    58. return new HelloWorld(contractAddress, client, credential);
    59. }
    60. public static HelloWorld deploy(Client client, CryptoKeyPair credential) throws ContractException {
    61. return deploy(HelloWorld.class, client, credential, getBinary(client.getCryptoSuite()), "");
    62. }
    63. }

    1.5. 保存合约接口

    接口描述

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

    接口URL

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

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1所属群组groupIdint
    2合约编号contractIdint
    3合约名称contractNameString
    4合约所在目录contractPathString
    5合约abicontractAbiString可保存合约ABI
    6合约bytecodeBinbytecodeBinString合约编译的bytecode(bin),用于部署合约
    7合约bincontractBinString合约编译的runtime-bytecode(runtime-bin),用于交易解析
    8合约源码contractSourceString

    2)数据格式

    1. {
    2. "groupId": "1",
    3. "contractName": "HelloWorld",
    4. "contractPath": "/",
    5. "contractSource": "cHJhZ21hIHNvbGlkaXR5ID49MC40LjI0IDwwLjYuMTE7Cgpjb250cmFjdCBIZWxsb1dvcmxkIHsKICAgIHN0cmluZyBuYW1lOwoKICAgIGNvbnN0cnVjdG9yKCkgcHVibGljIHsKICAgICAgICBuYW1lID0gIkhlbGxvLCBXb3JsZCEiOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldCgpIHB1YmxpYyB2aWV3IHJldHVybnMgKHN0cmluZyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gbmFtZTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXQoc3RyaW5nIG1lbW9yeSBuKSBwdWJsaWMgewogICAgICAgIG5hbWUgPSBuOwogICAgfQp9",
    6. "contractAbi": "[{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"n\",\"type\":\"string\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}]",
    7. "contractBin": "",
    8. "bytecodeBin": "",
    9. "contractId": 1
    10. }

    响应参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1合约编号idInteger
    2所在目录contractPathString
    3合约名称contractNameString
    4合约状态contractStatusInteger1未部署,2已部署
    5所属群组groupIdInteger
    6合约源码contractSourceString
    7合约abicontractAbiString合约编译后生成的abi文件内容
    8合约bincontractBinString合约编译的runtime-bytecode(runtime-bin),用于交易解析
    9合约bytecodeBinbytecodeBinString合约编译的bytecode(bin),用于部署合约
    10合约地址contractAddressString
    11部署时间deployTimeString
    12修改时间modifyTimeString
    13创建时间createTimeString
    14备注descriptionString

    2)数据格式

    1. {
    2. "id": 1,
    3. "contractPath": "/",
    4. "contractName": "HelloWorld",
    5. "contractStatus": 1,
    6. "groupId": 1,
    7. "contractSource": "cHJhZ21hIHNvbGlkaXR5ID49MC40LjI0IDwwLjYuMTE7Cgpjb250cmFjdCBIZWxsb1dvcmxkIHsKICAgIHN0cmluZyBuYW1lOwoKICAgIGNvbnN0cnVjdG9yKCkgcHVibGljIHsKICAgICAgICBuYW1lID0gIkhlbGxvLCBXb3JsZCEiOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldCgpIHB1YmxpYyB2aWV3IHJldHVybnMgKHN0cmluZyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gbmFtZTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXQoc3RyaW5nIG1lbW9yeSBuKSBwdWJsaWMgewogICAgICAgIG5hbWUgPSBuOwogICAgfQp9",
    8. "contractAbi": "[{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"n\",\"type\":\"string\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"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 DELETE

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/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:5002/WeBASE-Front/contract/contractList

    调用方法

    HTTP POST

    请求参数

    1)参数表

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

    2)数据格式

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

    响应参数

    1)参数表

    序号中文参数名类型必填说明
    1返回码codeString返回码信息请参看附录1
    2提示信息messageString
    3返回数据dataObject
    3.1合约编号idInteger
    3.2所在目录contractPathString
    3.3合约名称contractNameString
    3.4合约状态contractStatusInteger1未部署,2已部署
    3.5所属群组groupIdInteger
    3.6合约源码contractSourceString
    3.7合约abicontractAbiString合约编译后生成的abi文件内容
    3.8合约bincontractBinString合约编译的runtime-bytecode(runtime-bin),用于交易解析
    3.9bytecodeBinbytecodeBinString合约编译的bytecode(bin),用于部署合约
    3.10合约地址contractAddressString
    3.11部署时间deployTimeString
    3.12修改时间modifyTimeString
    3.13创建时间createTimeString
    3.14备注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. }

    1.8. 合约是否被修改接口

    接口描述

    校验已部署的合约是否被修改了,返回true或false

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/contract/ifChanged/1/10

    响应参数

    1)数据格式

    1. true

    1.9. 后台编译合约

    接口描述

    通过后台的solcJ对solidity合约进行编译,返回合约的BIN与ABI

    接口URL

    http://localhost:5002/WeBASE-Front/contract/contractCompile

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1合约名称contractNameString
    2合约源码solidityBase64String经过Base64编码的合约源码内容

    2)数据格式

    1. {
    2. "contractName": "HelloWorld",
    3. "solidityBase64": "cHJhZ21hIHNvbGlkaXR5ID49MC40LjI0IDwwLjYuMTE7Cgpjb250cmFjdCBIZWxsb1dvcmxkewogICAgc3RyaW5nIG5hbWU7CgogICAgY29uc3RydWN0b3IoKSBwdWJsaWMgewogICAgICAgIG5hbWUgPSAiSGVsbG8sIFdvcmxkISI7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0KCkgcHVibGljIHZpZXcgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiBuYW1lOwogICAgfQoKICAgIGZ1bmN0aW9uIHNldChzdHJpbmcgbWVtb3J5IG4pIHB1YmxpYyB7CiAgICAgICAgbmFtZSA9IG47CiAgICB9Cn0="
    4. }

    响应参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1合约名称contractNameString
    3合约binbytecodeBinString
    4合约abicontractAbiString

    2)数据格式

    1. {
    2. "contractName": "HelloWorld",
    3. "contractAbi": "[{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"n\",\"type\":\"string\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}]",
    4. "bytecodeBin": "608060405234801561001057600080fd5b506040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061005c929190610062565b50610107565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100a357805160ff19168380011785556100d1565b828001600101855582156100d1579182015b828111156100d05782518255916020019190600101906100b5565b5b5090506100de91906100e2565b5090565b61010491905b808211156101005760008160009055506001016100e8565b5090565b90565b6102d7806101166000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d146100515780633590b49f146100e1575b600080fd5b34801561005d57600080fd5b5061006661014a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100a657808201518184015260208101905061008b565b50505050905090810190601f1680156100d35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100ed57600080fd5b50610148600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506101ec565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156101e25780601f106101b7576101008083540402835291602001916101e2565b820191906000526020600020905b8154815290600101906020018083116101c557829003601f168201915b5050505050905090565b8060009080519060200190610202929190610206565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061024757805160ff1916838001178555610275565b82800160010185558215610275579182015b82811115610274578251825591602001919060010190610259565b5b5090506102829190610286565b5090565b6102a891905b808211156102a457600081600090555060010161028c565b5090565b905600a165627a7a72305820c4fdd0260810422a091a99fbd64edc672c6e498b69b9947f3e3066c074522dfa0029",
    5. "errors": ""
    6. }

    1.10. 多合约编译

    接口描述

    接口参数为合约文件压缩成zip并Base64编码后的字符串。合约文件需要放在同级目录压缩,涉及引用请使用”./XXX.sol”。可参考测试类ContractControllerTest的testMultiContractCompile()方法。国密和非国密编译的bytecodeBin不一样,以下以国密为例。

    接口URL

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1合约源码contractZipBase64String合约文件压缩成zip,并Base64编码

    2)数据格式

    1. {
    2. "contractZipBase64": "UEsDBBQAAAAIAIqMeFAi98KgkQAAAPwAAAAOAAAASGVsbG9Xb3JsZC5zb2xdjjELwjAQhfdC/8ON7VJE3Iq7k4uDmxDSMwSSi1yugkj/u7GJNPjGe/e+9x6sjFcQg7OTlRfcdsNh2I9towMJKy1wQufCNbCb3m0DSVHYkgFSHsd8wSeSwAXlnG5d5ffl4T6TFhsIDErXJ3QUlRKMMjPFkui//Kzi1B3LHykm0q+pTqK32xRaB2StsCNtuOUDUEsBAj8AFAAAAAgAiox4UCL3wqCRAAAA/AAAAA4AJAAAAAAAAAAgAAAAAAAAAEhlbGxvV29ybGQuc29sCgAgAAAAAAABABgA3EMdrL8B1gGPz3r5xAjWAX8gr5/Rr9UBUEsFBgAAAAABAAEAYAAAAL0AAAAAAA=="
    3. }

    响应参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1合约名称contractNameString
    2合约binbytecodeBinString
    3合约abicontractAbiString
    4合约内容contractSourceString单个合约内容Base64编码

    2)数据格式

    1. [
    2. {
    3. "contractName": "HelloWorld",
    4. "contractAbi": "[{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"n\",\"type\":\"string\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"name\",\"type\":\"string\"}],\"name\":\"SetName\",\"type\":\"event\"}]",
    5. "contractSource": "cHJhZ21hIHNvbGlkaXR5IF4wLjQuMjsNCmNvbnRyYWN0IEhlbGxvV29ybGR7DQogICAgc3RyaW5nIG5hbWU7DQogICAgZXZlbnQgU2V0TmFtZShzdHJpbmcgbmFtZSk7DQogICAgZnVuY3Rpb24gZ2V0KCljb25zdGFudCByZXR1cm5zKHN0cmluZyl7DQogICAgICAgIHJldHVybiBuYW1lOw0KICAgIH0NCiAgICBmdW5jdGlvbiBzZXQoc3RyaW5nIG4pew0KICAgICAgICBlbWl0IFNldE5hbWUobik7DQogICAgICAgIG5hbWU9bjsNCiAgICB9DQp9",
    6. "bytecodeBin": "608060405234801561001057600080fd5b50610373806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d146100515780633590b49f146100e1575b600080fd5b34801561005d57600080fd5b5061006661014a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100a657808201518184015260208101905061008b565b50505050905090810190601f1680156100d35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100ed57600080fd5b50610148600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506101ec565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156101e25780601f106101b7576101008083540402835291602001916101e2565b820191906000526020600020905b8154815290600101906020018083116101c557829003601f168201915b5050505050905090565b7f05432a43e07f36a8b98100b9cb3631e02f8e796b0a06813610ce8942e972fb81816040518080602001828103825283818151815260200191508051906020019080838360005b8381101561024e578082015181840152602081019050610233565b50505050905090810190601f16801561027b5780820380516001836020036101000a031916815260200191505b509250505060405180910390a1806000908051906020019061029e9291906102a2565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106102e357805160ff1916838001178555610311565b82800160010185558215610311579182015b828111156103105782518255916020019190600101906102f5565b5b50905061031e9190610322565b5090565b61034491905b80821115610340576000816000905550600101610328565b5090565b905600a165627a7a72305820cff924cb0783dc84e2e107aae1fd09e1e04154b80834c9267a4eaa630997b2b90029"
    7. }
    8. ]

    1.11. 获取全量合约列表(不包含abi/bin)

    接口描述

    根据群组编号和合约状态获取全量合约

    接口URL

    http://localhost:5002/WeBASE-Front/contract/contractList/all/light?groupId={groupId}&contractStatus={contractStatus}

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1所属群组groupIdInteger
    2合约状态contractStatusInteger1未部署,2已部署

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/contract/contractList/all/light?groupId=1&contractStatus=2

    响应参数

    1)参数表

    序号中文参数名类型必填说明
    1返回码codeString返回码信息请参看附录1
    2提示信息messageString
    3返回数据dataObject
    3.1合约编号idInteger
    3.2所在目录contractPathString
    3.3合约名称contractNameString
    3.4合约状态contractStatusInteger1未部署,2已部署
    3.5所属群组groupIdInteger
    3.6合约地址contractAddressString
    3.7部署时间deployTimeString
    3.8修改时间modifyTimeString
    3.9创建时间createTimeString
    3.10备注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. "contractAddress": null,
    13. "deployTime": null,
    14. "description": null,
    15. "createTime": "2019-06-10 16:42:50",
    16. "modifyTime": "2019-06-10 16:42:52"
    17. }
    18. ],
    19. "totalCount": 1
    20. }

    1.12. 根据id获取单个合约

    接口描述

    根据合约id获取单个合约

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1合约编号contractIdInteger

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/contract/findOne/1

    响应参数

    1)参数表

    序号中文参数名类型必填说明
    1返回码codeString返回码信息请参看附录1
    2提示信息messageString
    3返回数据dataObject
    3.1合约编号idInteger
    3.2所在目录contractPathString
    3.3合约名称contractNameString
    3.4合约状态contractStatusInteger1未部署,2已部署
    3.5所属群组groupIdInteger
    3.6合约源码contractSourceString
    3.7合约abicontractAbiString合约编译后生成的abi文件内容
    3.8合约bincontractBinString合约编译的runtime-bytecode(runtime-bin),用于交易解析
    3.9bytecodeBinbytecodeBinString合约编译的bytecode(bin),用于部署合约
    3.10合约地址contractAddressString
    3.11部署时间deployTimeString
    3.12修改时间modifyTimeString
    3.13创建时间createTimeString
    3.14备注descriptionString

    2)数据格式

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": [
    5. {
    6. "id": 1,
    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. }

    1.13. 获取合约路径列表

    接口描述

    获取合约路径列表

    接口URL

    http://localhost:5002/WeBASE-Front/contract/findPathList/{groupId}

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/contract/findPathList/1

    响应参数

    1)参数表

    序号中文参数名类型必填说明
    1返回数据dataList
    1.1群组编号groupIdInteger
    1.2所在目录contractPathString
    1.3修改时间modifyTimeString
    1.4创建时间createTimeString

    2)数据格式

    1. [
    2. {
    3. "groupId": 1,
    4. "contractPath": "/",
    5. "createTime": null,
    6. "modifyTime": "2021-07-29 14:34:52"
    7. },
    8. {
    9. "groupId": 1,
    10. "contractPath": "Asset",
    11. "createTime": null,
    12. "modifyTime": "2021-07-27 10:43:59"
    13. },
    14. {
    15. "groupId": 1,
    16. "contractPath": "template",
    17. "createTime": "2021-07-20 11:31:18",
    18. "modifyTime": "2021-07-20 11:31:18"
    19. }
    20. ]

    1.14. 保存合约路径

    接口描述

    保存合约路径

    接口URL

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1所属群组groupIdInteger
    1合约路径contractPathString若为空字符串,则保存/根目录路径

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/contract/addContractPath
    1. {
    2. "contractPath": "test",
    3. "groupId": 1
    4. }

    响应参数

    1)参数表

    序号中文参数名类型必填说明
    1群组编号groupIdInteger
    2所在目录contractPathString
    3修改时间modifyTimeString
    4创建时间createTimeString

    2)数据格式

    1. {
    2. "groupId": 1,
    3. "contractPath": "test",
    4. "createTime": "2021-07-29 14:26:54",
    5. "modifyTime": "2021-07-29 14:26:54"
    6. }

    1.15. 删除合约路径

    接口描述

    删除合约路径(不删除目录下合约)

    接口URL

    http://localhost:5002/WeBASE-Front/contract/deletePath/{groupId}/{contractPath}

    调用方法

    HTTP DELETE

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1所属群组groupIdInteger
    1合约路径contractPathString

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/contract/deletePath/1/test

    响应参数

    1)参数表

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

    2)数据格式

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

    1.16. 根据合约路径批量删除合约

    接口描述

    根据合约路径批量删除合约

    接口URL

    调用方法

    HTTP DELETE

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1所属群组groupIdInteger
    1合约路径contractPathString

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/contract/batch/1/test

    响应参数

    1)参数表

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

    2)数据格式

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

    1.17. 注册cns接口

    接口描述

    注册cns

    接口URL

    http://localhost:5002/WeBASE-Front/contract/registerCns

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1所属群组groupIdInteger
    2合约名称contractNameString
    3cns名称cnsNameString
    4合约地址contractAddressString
    5合约abiabiInfoListabi文件里面的内容,是一个JSONArray
    6cns版本versionString
    7是否保存saveEnabledbool前置控制台调用时传true,其他调用传false
    8用户地址userAddressStringsaveEnabled为true时必填
    9合约路径contractPathStringsaveEnabled为true时必填
    10签名用户编号signUserIdStringsaveEnabled为false时必填

    2)数据格式

    1. {
    2. "groupId": 1,
    3. "contractName": "Hello",
    4. "cnsName": "Hello",
    5. "contractPath": "/",
    6. "version": "v0.4",
    7. "contractAddress": "0xcaff8fdf1d461b91c7c8f0ff2af2f79a80bc189e",
    8. "abiInfo": [{"cons tant":false,"inputs":[{"name":"n","type":"string","type0":null,"indexed":false}],"name":"set","outputs":[{"name":"","type":"string","type0":null,"indexed":false}],"type":"function","payable":false,"stateMutability":"nonpayable"},{"co nstant":true,"inputs":[],"name":"get","outputs":[{"name":"","type":"string","type0":null,"indexed":false}],"type":"function","payable":false,"stateMutability":"view"},{"constant":false,"inputs":[{"name":"name","type":"string","type0":null,"indexed":false}],"name":"SetName","outputs":null,"type":"event","payable":false,"stateMutability":null}],
    9. "signUserId": null,
    10. "userAddress": "0x8c808ff5beee7b4cfb17f141f6237db93a668e46",
    11. "saveEnabled": true
    12. }

    响应参数

    1)参数表

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

    2)数据格式

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

    1.18. 根据合约地址获取cns信息

    接口描述

    根据合约地址获取cns信息,返回改合约地址最新的cns信息

    接口URL

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1所属群组groupIdInteger
    2合约地址contractAddressString

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/contract/findCns
    1. {
    2. "groupId": 1,
    3. "contractAddress": "0xe46c1a681811ee78079b48a956ead6d9dd10bf6a"
    4. }

    响应参数

    1)参数表

    序号中文参数名类型必填说明
    1返回码codeString返回码信息请参看附录1
    2提示信息messageString
    3返回数据dataList
    3.1群组编号groupIdInteger
    3.2合约路径contractPathString
    3.3合约名contractNameString
    3.4cns名cnsNameString
    3.5cns版本versionString
    3.6合约地址contractAddressString
    3.7合约AbicontractAbiString
    3.8修改时间modifyTimeString
    3.9创建时间createTimeString

    2)数据格式

    1. {
    2. "code": 0,
    3. "message": "success"
    4. "data": {
    5. "groupId": 1,
    6. "contractPath": "/",
    7. "contractName": "Hello",
    8. "cnsName": "Hello",
    9. "version": "v0.4",
    10. "contractAddress": "0xcaff8fdf1d461b91c7c8f0ff2af2f79a80bc189e",
    11. "contractAbi":"[{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"type0\":null,\"indexed\":false}],\"type\":\"function\",\"payable\":false,\"stateMutability\":\"view\"},{\"constant\":false,\"inputs\":[{\"name\":\"n\",\"type\":\"string\",\"type0\":null,\"indexed\":false}],\"name\":\"set\",\"outputs\":[],\"type\":\"function\",\"payable\":false,\"stateMutability\":\"nonpayable\"},{\"constant\":false,\"inputs\":[{\"name\":\"name\",\"type\":\"string\",\"type0\":null,\"indexed\":false}],\"name\":\"SetName\",\"outputs\":null,\"type\":\"event\",\"payable\":false,\"stateMutability\":null}]",
    12. "createTime": "2020-12-30 16:32:28",
    13. "modifyTime": "2020-12-30 16:32:28"
    14. }
    15. }

    2. 密钥接口

    2.1. 创建私钥接口

    接口描述

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

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1私钥类型typeint0-本地用户;1-本地随机;2-外部用户;默认为2
    2用户名userNameString用户名
    3签名服务用户编号signUserIdString64WeBASE-Sign中的用户编号,一般设为UUID值;类型为2-外部用户时,必填;
    4应用编号appIdString64记录私钥所属应用,可根据业务设置;类型为2-外部用户时,必填
    5是否返回私钥returnPrivateKeyBoolean类型为2-外部用户时,选填;默认为false

    2)数据格式

    1. // 本地用户
    2. http://localhost:5002/WeBASE-Front/privateKey?type=0&userName=test
    3. // 外部用户
    4. http://localhost:5002/WeBASE-Front/privateKey?type=2&signUserId=0x123&appId=2

    响应参数

    1)数据格式 本地用户时:

    1. {
    2. "address": "0x2007e1430f41f75c850464307c0994472bd92ee0",
    3. "publicKey": "0x9bd35211855f9f8de22d8a8da7f30d35d62ab2c3d36ea5162008fcbb9faff4d83809f7033deb20049bf51e081105076ec7a09a847f852530f81e978b1eda0392",
    4. "privateKey": "42caa160cadcb635381b980ddd981171c862d3105981fe92d6db330f30615f21",
    5. "userName": "test",
    6. "type": 0,
    7. "signUserId": null, // 本地用户则为空
    8. "appId": null // 本地用户则为空
    9. }

    外部用户时(来自WeBASE-Sign):

    1. {
    2. "address": "0xef5afe7d9a7516cd36b5b2471a3fbb05d3e8a846",
    3. "publicKey": "0461e78631ab8428c1be815a4543da8684db13cd2d9a0593e053184dbd29d08f38131e060bc8d1a1ef5f4290b26acca8cefbc16150155e57f4ea81dbed57cea0e8",
    4. "privateKey": null, // 默认不返回
    5. "userName": null, //外部用户则为空
    6. "type": 2,
    7. "signUserId": "0x123",
    8. "appId": "1"
    9. }

    2.2. 导入私钥接口

    接口描述

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

    接口URL

    http://localhost:5002/WeBASE-Front/privateKey/import?privateKey={privateKey}&userName={userName}

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1私钥信息privateKeyString
    2用户名userNameString

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/privateKey/import?privateKey=8cf98bd0f37fb0984ab43ed6fc2dcdf58811522af7e4a3bedbe84636a79a501c&userName=lili

    响应参数

    1)数据格式

    1. {
    2. "address": "0x2e8ff65fb1b2ce5b0c9476b8f8beb221445f42ee",
    3. "publicKey": "0x1c7073dc185af0644464b178da932846666a858bc492450e9e94c77203428ed54e2ce45679dbb36bfed714dbe055a215dc1aaf4a75faeddce6a62b39c0158e1e",
    4. "privateKey": "8cf98bd0f37fb0984ab43ed6fc2dcdf58811522af7e4a3bedbe84636a79a501c",
    5. "userName": "lili",
    6. "type": 0
    7. }

    2.3. 获取本地公私钥列表接口

    接口描述

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/privateKey/localKeyStores

    响应参数

    1)数据格式

    1. [
    2. {
    3. "address": "0x2007e1430f41f75c850464307c0994472bd92ee0",
    4. "publicKey": "0x9bd35211855f9f8de22d8a8da7f30d35d62ab2c3d36ea5162008fcbb9faff4d83809f7033deb20049bf51e081105076ec7a09a847f852530f81e978b1eda0392",
    5. "privateKey": "42caa160cadcb635381b980ddd981171c862d3105981fe92d6db330f30615f21",
    6. "userName": "test",
    7. "type": 0
    8. },
    9. {
    10. "address": "0x2e8ff65fb1b2ce5b0c9476b8f8beb221445f42ee",
    11. "publicKey": "0x1c7073dc185af0644464b178da932846666a858bc492450e9e94c77203428ed54e2ce45679dbb36bfed714dbe055a215dc1aaf4a75faeddce6a62b39c0158e1e",
    12. "privateKey": "8cf98bd0f37fb0984ab43ed6fc2dcdf58811522af7e4a3bedbe84636a79a501c",
    13. "userName": "lili",
    14. "type": 0
    15. }
    16. ]

    2.4. 删除公私钥接口

    接口描述

    支持前置的控制台通过用户地址删除公私钥信息

    接口URL

    http://localhost:5002/WeBASE-Front/privateKey/{address}

    调用方法

    HTTP DELETE

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1用户地址addressString

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/privateKey/0x2e8ff65fb1b2ce5b0c9476b8f8beb221445f42ee

    响应参数

    1)参数表

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

    2)数据格式

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

    2.5. 导入.pem私钥用户

    接口描述

    导入.pem格式的私钥

    接口URL

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1pem文件内容pemContentString必须以——-BEGIN PRIVATE KEY——-\n开头,以\n——-END PRIVATE KEY——-\n结尾的格式
    2用户名userNameString

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/privateKey/importPem
    1. {
    2. "pemContent":"-----BEGIN PRIVATE KEY-----\nMIGEAgEAMBAGByqGSM49AgEGBSuBBAAKBG0wawIBAQQgC8TbvFSMA9y3CghFt51/\nXmExewlioX99veYHOV7dTvOhRANCAASZtMhCTcaedNP+H7iljbTIqXOFM6qm5aVs\nfM/yuDBK2MRfFbfnOYVTNKyOSnmkY+xBfCR8Q86wcsQm9NZpkmFK\n-----END PRIVATE KEY-----\n",
    3. "userName":"test222"
    4. }

    响应参数

    1)参数表

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

    2)数据格式

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

    2.6. 导入.p12私钥用户

    接口描述

    导入.p12格式的私钥

    接口URL

    http://localhost:5002/WeBASE-Front/privateKey/importP12

    调用方法

    HTTP POST | Content-type: form-data

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1p12文件p12FileMultipartFile
    2p12文件密码p12PasswordString使用base64编码的密码;缺省时默认为””,即空密码;p12无密码时,可传入空值或不传;不包含中文
    2用户名userNameString

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/privateKey/importP12

    响应参数

    1)参数表

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

    2)数据格式

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

    2.7. 导入私钥到WeBASE-Sign

    接口描述

    导入私钥到WeBASE-Sign,其中privateKey经过Base64加密

    接口URL

    调用方法

    HTTP POST | Content-type: form-data

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1用户编号signUserIdString64WeBASE-Sign中的用户编号,一般设为UUID值
    2应用编号appIdString64记录私钥所属应用,可根据业务设置
    3私钥privateKeyString经过Base64加密后的内容

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/privateKey/importWithSign
    1. {
    2. "privateKey": "OGFmNWIzMzNmYTc3MGFhY2UwNjdjYTY3ZDRmMzE4MzU4OWRmOThkMjVjYzEzZGFlMGJmODhkYjhlYzVhMDcxYw==",
    3. "appId": "app_001",
    4. "signUserId": "user_001"
    5. }

    响应参数

    1)参数表

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

    2)数据格式

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

    2.8. 对哈希签名

    接口描述

    计算HASH和签名值

    接口URL

    http://localhost:5002/WeBASE-Front/privateKey/signMessageHash

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1Sign用户IdsignUserIdString64在webase-sign创建的私钥的id
    2Hash值messageHashString

    2)数据格式

    1. {
    2. "messageHash": "0xa271b78b8e869d693f7cdfee7162d7bfb11ae7531fd50f73d86f73a05c84dd7c",
    3. "signUserId": "883cfa1d40117dd2d270aa8bb0bb33776409be8b"
    4. }

    响应参数

    1)数据格式

    1. {
    2. "v": 0,
    3. "r": "0x2a76a45bcf1113615f796cc01b23c57f81f20ce79500080bb34c7994ed04de06",
    4. "s": "0x4f111eb37720e2618d8906368c825fd3cbe89b2781cb678efafb42399594a580",
    5. "p": "0x4405f9d5d6ccff709b6543bc8ac24cbb649d3267a66db19ab8f85f3b884a8505f086c581490e7e50558879abde9c4d07fc2daab92f81c0eb4b805af3c8895cfc"
    6. }

    2.9. 导出pem私钥

    接口描述

    从本地或WeBASE-Sign导出pem私钥文件

    接口URL

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1Sign用户编号signUserIdString64非空时,导出sign的私钥
    2用户地址userAddressString若signUserId为空,则地址不能为空,导出本地私钥

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/privateKey/exportPem
    1. {
    2. "userAddress": "0x883cfa1d40117dd2d270aa8bb0bb33776409be8b"
    3. }

    响应参数

    1)参数表

    序号中文参数名类型必填说明
    1文件名ResponseEntity.headerString文件名在header中
    2文件流bodyInputStream文件的流在body中,使用pcks12方式接收

    2)数据格式

    1. headers: content-disposition: attachment;filename*=UTF-8''111_0x0421975cf4a5b27148f65de11cd9d8559a1bbbd9.pem
    2. {
    3. -----BEGIN PRIVATE KEY-----
    4. MIGNAgEAMBAGByqGSM49AgEGBSuBBAAKBHYwdAIBAQQg91Aha3x2UdpN2Sg5C5Wh
    5. 7Y8YwIYC5NTNtfQT1yp7hKWgBwYFK4EEAAqhRANCAAQ9SEdu1kLpLXVmayqax7N+
    6. Pf/ATWx5jJIJIiQF6/BIiuORZrZb/M04FlxtGyVuQjQjbYVgyjNDUilj14OlZhXo
    7. -----END PRIVATE KEY-----
    8. }

    2.10. 导出p12私钥

    接口描述

    从本地或WeBASE-Sign导出p12私钥文件

    接口URL

    http://localhost:5002/WeBASE-Front/privateKey/exportP12

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1Sign用户编号signUserIdString64非空时,导出sign的私钥
    2用户地址userAddressString若signUserId为空,则地址不能为空,导出本地私钥

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/privateKey/exportP12
    1. {
    2. "userAddress": "0x883cfa1d40117dd2d270aa8bb0bb33776409be8b"
    3. }

    响应参数

    1)参数表

    序号中文参数名类型必填说明
    1文件名ResponseEntity.headerString文件名在header中
    2文件流bodyInputStream文件的流在body中,使用pcks12方式接收

    2)数据格式

    1. headers: content-disposition: attachment;filename*=UTF-8''111_0x0421975cf4a5b27148f65de11cd9d8559a1bbbd9.p12
    2. {
    3. // 二进制流
    4. }

    2.11. 获取WeBASE-Sign私钥用户信息

    接口描述

    从WeBASE-Sign获取私钥信息

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1Sign用户编号signUserIdString64WeBASE-Sign中用户编号
    2是否导出秘钥returnPrivateKeyBoolean默认为false;true时将导出WeBASE-Sign对应私钥

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/privateKey/userInfoWithSign?signUserId=d1edf538748b4d899f251b5d746ec62f&returnPrivateKey=false

    响应参数

    1)参数表

    序号中文参数名类型必填说明
    1用户编号signUserIdStringWeBASE-Sign中的用户编号,一般为UUID值
    2应用编号appIdString记录私钥所属应用
    3私钥原文privateKeyStringreturnPrivateKey则不返回(要求WeBASE-Sign设置允许导出私钥配置)
    3私钥地址addressString
    3公钥publicKeyString
    3私钥类型encryptTypeString0-ECDSA, 1-SM2国密
    3描述descriptionString

    2)数据格式

    1. {
    2. "signUserId": "d1edf538748b4d899f251b5d746ec62f",
    3. "appId": "1",
    4. "address": "0x2b6e2f9d25bdeeca395bd743099ef50097043aaa",
    5. "publicKey": "044ddb8e92cf9dd96c1767b5e9c7e55e749304e88e28a8ec4fb7059c3388590ce83f2786510898464dfeb79771656a506e91cca6bd88c4291d5b9e284542651546",
    6. "privateKey": "",
    7. "description": null,
    8. "encryptType": 1
    9. }

    3. web3接口

    3.1. 获取块高接口

    接口描述

    获取节点最新块高

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/blockNumber

    响应参数

    1)数据格式

    1. 232

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

    接口描述

    通过块高获取块信息

    接口URL

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

    调用方法

    HTTP GET

    请求参数

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/blockByNumber/2

    响应参数

    1)数据格式

    1. {
    2. "number": 2,
    3. "hash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625",
    4. "parentHash": "0x489ee0c00527879f7e2470bde7b62e9ea30fadb242bcbd9ba582d0dee4958e2f",
    5. "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    6. "transactionsRoot": "0xade02313d3200f38dfc18cdc368241cf4c1cb7e72011edf847ec216efa43a99e",
    7. "receiptsRoot": "0xb7c4b856c9335bd345c0b022057567a2223218e7a7dab822981467b29ac1e326",
    8. "dbHash": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15",
    9. "stateRoot": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15",
    10. "sealer": "0x2",
    11. "sealerList": [
    12. "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f",
    13. "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7",
    14. "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39",
    15. "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d"
    16. ],
    17. "extraData": [],
    18. "gasLimit": "0",
    19. "gasUsed": "0",
    20. "timestamp": "1619424150450",
    21. "signatureList": [
    22. {
    23. "index": "0x1",
    24. "signature": "0xa05b5d220e41051fa80f212884d9cdda3a8973a4ac2d2dc74e42db32b459e5f595a61e30266f0e8bf7edb065ff107c6af5e6349f9ae518146dc686406ebbade165bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7"
    25. },
    26. {
    27. "index": "0x3",
    28. "signature": "0x48bb622e24b18f4eb601137d44b5d86e2c287be3aa849dce1768e87e75308ba69391e62f90d76bf84b9b6eb1509d11409f9b784bc7b052458a4596b81961fac8fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d"
    29. },
    30. {
    31. "index": "0x2",
    32. "signature": "0x3a3cc8c20c5cdbb6431ec1f749d94662670e87442debef119a4e6469ccb16a60a152d32754ab833efa513839b076c2aa1ceb7e536db3734b740e9192b10ee38695efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39"
    33. }
    34. ],
    35. "transactions": [
    36. {
    37. "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625",
    38. "blockNumber": 2,
    39. "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d",
    40. "gas": "0x419ce0",
    41. "hash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429",
    42. "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029",
    43. "nonce": "0x3460c30bd3e4e88a31d6d033b3a172859bf003258e9606fd63fb0d91f91f4e6",
    44. "to": "0x0000000000000000000000000000000000000000",
    45. "transactionIndex": "0x0",
    46. "value": "0x0",
    47. "gasPrice": "0x51f4d5c00",
    48. "blockLimit": "0x1f5",
    49. "chainId": "0x1",
    50. "groupId": "0x1",
    51. "extraData": "0x",
    52. "signature": {
    53. "r": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462b",
    54. "s": "0xd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124",
    55. "v": "0xc7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7",
    56. "signature": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462bd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124c7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7"
    57. }
    58. }
    59. ]
    60. }

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

    接口描述

    通过块hash获取块信息

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/blockByHash/0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625

    响应参数

    1)数据格式

    1. {{
    2. "number": 2,
    3. "hash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625",
    4. "parentHash": "0x489ee0c00527879f7e2470bde7b62e9ea30fadb242bcbd9ba582d0dee4958e2f",
    5. "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    6. "transactionsRoot": "0xade02313d3200f38dfc18cdc368241cf4c1cb7e72011edf847ec216efa43a99e",
    7. "receiptsRoot": "0xb7c4b856c9335bd345c0b022057567a2223218e7a7dab822981467b29ac1e326",
    8. "dbHash": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15",
    9. "stateRoot": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15",
    10. "sealer": "0x2",
    11. "sealerList": [
    12. "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f",
    13. "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7",
    14. "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39",
    15. "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d"
    16. ],
    17. "extraData": [],
    18. "gasLimit": "0",
    19. "gasUsed": "0",
    20. "timestamp": "1619424150450",
    21. "signatureList": [
    22. {
    23. "index": "0x1",
    24. "signature": "0xa05b5d220e41051fa80f212884d9cdda3a8973a4ac2d2dc74e42db32b459e5f595a61e30266f0e8bf7edb065ff107c6af5e6349f9ae518146dc686406ebbade165bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7"
    25. },
    26. {
    27. "index": "0x3",
    28. "signature": "0x48bb622e24b18f4eb601137d44b5d86e2c287be3aa849dce1768e87e75308ba69391e62f90d76bf84b9b6eb1509d11409f9b784bc7b052458a4596b81961fac8fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d"
    29. },
    30. {
    31. "index": "0x2",
    32. "signature": "0x3a3cc8c20c5cdbb6431ec1f749d94662670e87442debef119a4e6469ccb16a60a152d32754ab833efa513839b076c2aa1ceb7e536db3734b740e9192b10ee38695efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39"
    33. }
    34. ],
    35. "transactions": [
    36. {
    37. "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625",
    38. "blockNumber": 2,
    39. "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d",
    40. "gas": "0x419ce0",
    41. "hash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429",
    42. "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029",
    43. "nonce": "0x3460c30bd3e4e88a31d6d033b3a172859bf003258e9606fd63fb0d91f91f4e6",
    44. "to": "0x0000000000000000000000000000000000000000",
    45. "transactionIndex": "0x0",
    46. "value": "0x0",
    47. "gasPrice": "0x51f4d5c00",
    48. "blockLimit": "0x1f5",
    49. "chainId": "0x1",
    50. "groupId": "0x1",
    51. "extraData": "0x",
    52. "signature": {
    53. "r": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462b",
    54. "s": "0xd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124",
    55. "v": "0xc7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7",
    56. "signature": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462bd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124c7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7"
    57. }
    58. }
    59. ]
    60. }

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

    接口描述

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

    接口URL

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

    调用方法

    HTTP GET

    请求参数

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/blockTransCnt/100

    响应参数

    1)数据格式

    1. 2

    3.5. 获取PbftView接口

    接口描述

    通过调用此接口获取PbftView

    接口URL

    调用方法

    HTTP GET

    请求参数

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/pbftView

    响应参数

    1)数据格式

    1. {
    2. 160565
    3. }

    3.6. 获取交易回执接口

    接口描述

    根据交易hash获取交易回执

    接口URL

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

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/transactionReceipt/0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429

    响应参数

    2)数据格式

    1. {
    2. "transactionHash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429",
    3. "transactionIndex": "0x0",
    4. "root": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15",
    5. "blockNumber": "2",
    6. "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625",
    7. "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d",
    8. "to": "0x0000000000000000000000000000000000000000",
    9. "gasUsed": "316449",
    10. "contractAddress": "0xa8af0ee580d8af674a60341030ddbc45431bc235",
    11. "logs": [],
    12. "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    13. "status": "0x0",
    14. "statusMsg": "None",
    15. "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029",
    16. "output": "0x",
    17. "txProof": null,
    18. "receiptProof": null,
    19. "message": null,
    20. "statusOK": true
    21. }

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

    接口描述

    根据交易hash获取交易信息

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/transaction/0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429

    响应参数

    1)数据格式

    1. {
    2. "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625",
    3. "blockNumber": 2,
    4. "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d",
    5. "gas": "4300000",
    6. "hash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429",
    7. "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029",
    8. "nonce": "0x3460c30bd3e4e88a31d6d033b3a172859bf003258e9606fd63fb0d91f91f4e6",
    9. "to": "0x0000000000000000000000000000000000000000",
    10. "transactionIndex": "0x0",
    11. "value": "0x0",
    12. "gasPrice": "22000000000",
    13. "blockLimit": "0x1f5",
    14. "chainId": "0x1",
    15. "groupId": "1",
    16. "extraData": "0x",
    17. "signature": {
    18. "r": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462b",
    19. "s": "0xd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124",
    20. "v": "0xc7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7",
    21. "signature": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462bd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124c7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7"
    22. }
    23. }

    3.8. 获取web3j版本接口

    接口描述

    获取web3j版本

    接口URL

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

    调用方法

    HTTP GET

    请求参数

    1)参数表

    无入参

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/clientVersion

    响应参数

    1)参数表

    2)数据格式

    1. {
    2. "FISCO-BCOS Version": "2.7.2 gm",
    3. "Supported Version": "2.7.2",
    4. "Chain Id": "1",
    5. "Build Time": "20210201 10:03:03",
    6. "Build Type": "Linux/clang/Release",
    7. "Git Branch": "HEAD",
    8. "Git Commit Hash": "4c8a5bbe44c19db8a002017ff9dbb16d3d28e9da"
    9. }

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

    接口描述

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

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/code/0x0000000000000000000000000000000000000000/1

    响应参数

    1)数据格式

    1. {
    2. 0xxxx
    3. }

    3.10. 获取总交易数

    接口描述

    获取总交易数量

    接口URL

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

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/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 GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/transByBlockHashAndIndex/0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429/0

    响应参数

    1)数据格式

    1. {
    2. "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625",
    3. "blockNumber": 2,
    4. "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d",
    5. "gas": "4300000",
    6. "hash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429",
    7. "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029",
    8. "nonce": "0x3460c30bd3e4e88a31d6d033b3a172859bf003258e9606fd63fb0d91f91f4e6",
    9. "to": "0x0000000000000000000000000000000000000000",
    10. "transactionIndex": "0x0",
    11. "value": "0x0",
    12. "gasPrice": "22000000000",
    13. "blockLimit": "0x1f5",
    14. "chainId": "0x1",
    15. "groupId": "1",
    16. "extraData": "0x",
    17. "signature": {
    18. "r": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462b",
    19. "s": "0xd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124",
    20. "v": "0xc7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7",
    21. "signature": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462bd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124c7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7"
    22. }
    23. }

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

    接口描述

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

    接口URL

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

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/transByBlockNumberAndIndex/2/0

    响应参数

    1)数据格式

    1. {
    2. "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625",
    3. "blockNumber": 2,
    4. "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d",
    5. "gas": "4300000",
    6. "hash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429",
    7. "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029",
    8. "nonce": "0x3460c30bd3e4e88a31d6d033b3a172859bf003258e9606fd63fb0d91f91f4e6",
    9. "to": "0x0000000000000000000000000000000000000000",
    10. "transactionIndex": "0x0",
    11. "value": "0x0",
    12. "gasPrice": "22000000000",
    13. "blockLimit": "0x1f5",
    14. "chainId": "0x1",
    15. "groupId": "1",
    16. "extraData": "0x",
    17. "signature": {
    18. "r": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462b",
    19. "s": "0xd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124",
    20. "v": "0xc7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7",
    21. "signature": "0x3416723318505669cca91689b213ff08ffb96d538210a0f691cfcfa9d529462bd3642f19c228e2e86689de9efc19ecbb68378a6bb7c219984431e93d60c89124c7935c199b680452eb37911856282b9c820322fd5fdec8a06b48cc3df4e8ed7d3d66a5adcc134cca609146ec0aed12827c35df07eed96042763c0926cf4223b7"
    22. }
    23. }

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

    接口描述

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

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/consensusStatus

    响应参数

    1)数据格式

    1. {
    2. "baseConsensusInfo": {
    3. "nodeNum": "4",
    4. "consensusedBlockNumber": "233",
    5. "highestblockNumber": "232",
    6. "groupId": "1",
    7. "protocolId": "65544",
    8. "accountType": "1",
    9. "cfgErr": "false",
    10. "omitEmptyBlock": "true",
    11. "nodeId": "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d",
    12. "allowFutureBlocks": "true",
    13. "connectedNodes": "3",
    14. "currentView": "102303",
    15. "toView": "102303",
    16. "leaderFailed": "false",
    17. "highestblockHash": "0x7f0885a7188bd5c1b3f8c182e00be0e63a3b1653b12752cf8501ddac995e6efc",
    18. "leaderId": null,
    19. "leaderIdx": null,
    20. "node_index": "3",
    21. "node index": null,
    22. "max_faulty_leader": "1",
    23. "sealer.": [
    24. "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f",
    25. "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7",
    26. "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39",
    27. "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d"
    28. ]
    29. },
    30. "viewInfos": [
    31. {
    32. "nodeId": "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f",
    33. "view": "102300"
    34. },
    35. {
    36. "nodeId": "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7",
    37. "view": "102301"
    38. },
    39. {
    40. "nodeId": "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39",
    41. "view": "102302"
    42. },
    43. {
    44. "view": "102303"
    45. }
    46. ]
    47. }

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

    接口描述

    返回节点的块高、pbftview及状态。(查看nodeHeartBeat)

    接口URL

    http://localhost:5002/WeBASE-Front/{groupId}/web3/getNodeStatusList

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/getNodeStatusList

    响应参数

    1)参数表

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

    2)数据格式

    1. [
    2. {
    3. "nodeId": "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f",
    4. "blockNumber": 232,
    5. "pbftView": 101224,
    6. "status": 1,
    7. "latestStatusUpdateTime": "2021-07-08 15:42:01"
    8. },
    9. {
    10. "nodeId": "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7",
    11. "blockNumber": 232,
    12. "pbftView": 101221,
    13. "status": 1,
    14. "latestStatusUpdateTime": "2021-07-08 15:42:01"
    15. },
    16. {
    17. "nodeId": "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39",
    18. "blockNumber": 232,
    19. "pbftView": 101222,
    20. "status": 1,
    21. "latestStatusUpdateTime": "2021-07-08 15:42:01"
    22. },
    23. {
    24. "nodeId": "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d",
    25. "blockNumber": 232,
    26. "pbftView": 101225,
    27. "status": 1,
    28. "latestStatusUpdateTime": "2021-07-08 15:42:01"
    29. }
    30. ]

    3.15. 获取群组列表接口

    接口描述

    返回群组列表

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/groupList

    响应参数

    1)数据格式

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

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

    接口描述

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

    接口URL

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

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/groupPeers

    响应参数

    1)数据格式

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

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

    接口描述

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/observerList

    响应参数

    1)数据格式

    1. [ "d822165959a0ed217df6541f1a7dd38b79336ff571dd5f8f85ad76f3e7ec097e1eabd8b03e4a757fd5a9fb0eea905aded56aaf44df83c34b73acb9ab7a165010"
    2. ]

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

    接口描述

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

    接口URL

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

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/peers

    响应参数

    1)数据格式

    1. [
    2. {
    3. "NodeID": "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f",
    4. "IPAndPort": "127.0.0.1:65030",
    5. "Agency": "agencyA_son",
    6. "Topic": [],
    7. "Node": "node2"
    8. },
    9. {
    10. "NodeID": "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39",
    11. "IPAndPort": "127.0.0.1:65014",
    12. "Agency": "agencyA_son",
    13. "Topic": [],
    14. "Node": "node3"
    15. },
    16. {
    17. "NodeID": "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7",
    18. "IPAndPort": "127.0.0.1:65022",
    19. "Agency": "agencyA_son",
    20. "Topic": [
    21. "_block_notify_1",
    22. "_block_notify_2",
    23. "_block_notify_2147483647"
    24. ],
    25. "Node": "node1"
    26. }
    27. ]

    接口描述

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

    接口URL

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

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

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

    响应参数

    1)数据格式

    1. 0

    3.20. 获取共识节点接口

    接口描述

    返回群组内共识节点列表

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/sealerList

    响应参数

    1)数据格式

    3.21. 区块/交易

    接口描述

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

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/search?input=123

    响应参数

    1)数据格式

    1. {
    2. "number": 123,
    3. "hash": "0xa12a4a8d26a15fcff6f67acf94a3fb2c08d4476806009be40fe4026fd622419d",
    4. "parentHash": "0x898c6b1657d4eb26307b39f248e471498975eb820671c7540fa516e6c7b411e8",
    5. "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    6. "transactionsRoot": "0xa94acacd692cf3b23e19b429ce89c2016020b2264854fd609ba2b16f0c7d5f73",
    7. "receiptsRoot": "0x9529b51c1f7ddd178ffd4a65d146b50cfc0beb405a808677dfddd694cf555a09",
    8. "dbHash": "0x3047354b6776fd1f02911f2c4fc4aa1b215b3df53cc7504a71b5f3bfe12eca3a",
    9. "stateRoot": "0x3047354b6776fd1f02911f2c4fc4aa1b215b3df53cc7504a71b5f3bfe12eca3a",
    10. "sealer": "0x1",
    11. "sealerList": [
    12. "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f",
    13. "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7",
    14. "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39",
    15. "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d"
    16. ],
    17. "extraData": [],
    18. "gasLimit": "0",
    19. "gasUsed": "0",
    20. "timestamp": "1621928850887",
    21. "signatureList": [
    22. {
    23. "index": "0x3",
    24. "signature": "0x8549a8adddb9ff2d8d472b7a65ca414a7f10519f59e11244b9e92fed2e30f29cc272938a695ebb1ead579bdaed401b6aa31395890139abe406518471efa55d6afe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d"
    25. },
    26. {
    27. "index": "0x1",
    28. "signature": "0x0ff480d6c3fe5908c554653376492cba23cfc938bc0847298c9c8b4c140b417be1990d25c0239f9b18e24276e864e1f2ac4beab47ddf5277a767bb7c93e143ed65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7"
    29. },
    30. {
    31. "index": "0x2",
    32. "signature": "0x50aa1513c390e5e61221418aa46f8dd45e3ce6e8c0a6fa5aa75650517560589590172b1e6cc64e9ba7ab45c964ff925524cecf6c2be0a28ea11426febb69305195efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39"
    33. }
    34. ],
    35. "transactions": [
    36. {
    37. "blockHash": "0xa12a4a8d26a15fcff6f67acf94a3fb2c08d4476806009be40fe4026fd622419d",
    38. "blockNumber": 123,
    39. "from": "0x1cd8126354aa951dc8ed083ed91fd31fad1f50d8",
    40. "gas": "0x5f5e100",
    41. "hash": "0xbe858390cf0bd94f9d17c6ab5e04a7d354f9482f2568f067bdc2529a0af324db",
    42. "input": "0x25e85d16000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000803935656661666135313937373936653765646636343731393164653833663432353964376362623036306634626163353836386265343734303337663439313434643538316331356438616566396230376437386631383034316135663433633363323633353265626266353538336364323330373033353863386662613339",
    43. "nonce": "0x1479caf2ff5f1a6121beac93c85b59c36280ffe6a7f124cbc3d232021fa3307",
    44. "to": "0x0000000000000000000000000000000000001003",
    45. "transactionIndex": "0x0",
    46. "value": "0x0",
    47. "gasPrice": "0x1",
    48. "blockLimit": "0x26e",
    49. "chainId": "0x1",
    50. "groupId": "0x1",
    51. "extraData": "0x",
    52. "signature": {
    53. "r": "0x36edc104cc5c2c5c992f9804bd3415378f93c18ebc9cdeb7794c08b1c95fd7ad",
    54. "s": "0xed555fe3a192acc5ea01951f7286f93cff3471e84731a2942968a2fd9a9a14bc",
    55. "v": "0xd3a0fac51c66adf23bfccc6bb3aaa3d3623040912963ceb818ca2d8b1fb649c64bce64d99a8d9a39158b2c713101dbca10a478131dcae7e42d156e0e69455652",
    56. "signature": "0x36edc104cc5c2c5c992f9804bd3415378f93c18ebc9cdeb7794c08b1c95fd7aded555fe3a192acc5ea01951f7286f93cff3471e84731a2942968a2fd9a9a14bcd3a0fac51c66adf23bfccc6bb3aaa3d3623040912963ceb818ca2d8b1fb649c64bce64d99a8d9a39158b2c713101dbca10a478131dcae7e42d156e0e69455652"
    57. }
    58. }
    59. ]
    60. }

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

    接口描述

    获取群组内同步状态信息

    接口URL

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

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/syncStatus

    响应参数

    1)数据格式

    1. {
    2. "isSyncing": "false",
    3. "protocolId": "65545",
    4. "genesisHash": "1caec77e0ff42af4f045af2ba5503c775c33430085b246374cdd23d1c9191173",
    5. "nodeId": "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d",
    6. "blockNumber": "232",
    7. "latestHash": "7f0885a7188bd5c1b3f8c182e00be0e63a3b1653b12752cf8501ddac995e6efc",
    8. "knownHighestNumber": "232",
    9. "txPoolSize": "0",
    10. "peers": [
    11. {
    12. "nodeId": "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f",
    13. "genesisHash": "1caec77e0ff42af4f045af2ba5503c775c33430085b246374cdd23d1c9191173",
    14. "blockNumber": "232",
    15. "latestHash": "7f0885a7188bd5c1b3f8c182e00be0e63a3b1653b12752cf8501ddac995e6efc"
    16. },
    17. {
    18. "nodeId": "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7",
    19. "genesisHash": "1caec77e0ff42af4f045af2ba5503c775c33430085b246374cdd23d1c9191173",
    20. "blockNumber": "232",
    21. "latestHash": "7f0885a7188bd5c1b3f8c182e00be0e63a3b1653b12752cf8501ddac995e6efc"
    22. },
    23. {
    24. "nodeId": "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39",
    25. "genesisHash": "1caec77e0ff42af4f045af2ba5503c775c33430085b246374cdd23d1c9191173",
    26. "blockNumber": "232",
    27. "latestHash": "7f0885a7188bd5c1b3f8c182e00be0e63a3b1653b12752cf8501ddac995e6efc"
    28. }
    29. ],
    30. "knownLatestHash": "7f0885a7188bd5c1b3f8c182e00be0e63a3b1653b12752cf8501ddac995e6efc"
    31. }

    3.23. 刷新前置

    接口描述

    刷新前置的群组列表,功能与groupList类似

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/refresh

    响应参数

    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. 动态生成群组

    接口描述

    在节点上动态生成新群组的配置文件与创世块文件

    接口URL

    http://localhost:5002/WeBASE-Front/{groupId}/web3/generateGroup

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组编号groupIdint此处groupId可填写任意已有群组
    1生成群组的编号generateGroupIdint待生成新群组的id
    1共识节点列表nodeListList新群组的共识节点列表,可通过getNodeIdList获取
    1群组时间戳timestampBigInteger新群组的创世块时间戳

    2)数据格式

    1. {
    2. "generateGroupId": 5,
    3. "nodeList": [
    4. "dd7a2964007d583b719412d86dab9dcf773c61bccab18cb646cd480973de0827cc94fa84f33982285701c8b7a7f465a69e980126a77e8353981049831b550f5c",
    5. "59db64100da70db9c2911f2925bcd0c2f9a1b84f4f8bfef0f6a7edf6d511b2a79203a486c268fb97bc19636f91f71ae9dca076973a4bd551b4a8cdf6d7e7710c"
    6. ],
    7. "timestamp": 1589286309000
    8. }

    示例:

    1. curl -X POST "http://localhost:5002/WeBASE-Front/{groupId}/web3/generateGroup" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"generateGroupId\": 8, \"nodeList\": [ \"dd7a2964007d583b719412d86dab9dcf773c61bccab18cb646cd480973de0827cc94fa84f33982285701c8b7a7f465a69e980126a77e8353981049831b550f5c\" ], \"timestamp\":1589286309000}"

    响应参数

    a、成功:

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

    b、失败:

    1. {
    2. "code": 201128,
    3. "errorMessage": "group peers not connected"
    4. }

    3.25. 操作动态群组的状态

    接口描述

    启动群组、停止群组、移除群组、恢复群组、查询群组状态等操作

    创建群组后,需要对群组内每个节点分别调用start来启动群组,群组才算完全创建

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组idgroupIdint操作的群组编号
    2操作类型typeStringstart, stop, remove, recover, getStatus

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/5/web3/operateGroup/start

    响应参数

    1)数据格式

    a、成功:

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

    b、失败:

    1. {
    2. "code": 201123,
    3. "errorMessage": "group already running"
    4. }

    3.26. 获取当前节点的多个群组状态

    接口描述

    传入多个群组编号,对单个节点查询多个群组的状态

    包含五种群组状态:该节点不存在该群组”INEXISTENT”、正在停止群组”STOPPING”、群组运行中”RUNNING”、群组已停止”STOPPED”、群组已删除”DELETED”

    接口URL

    http://localhost:5002/WeBASE-Front/{groupId}/web3/queryGroupStatus

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组idgroupIdint该编号与所查询群组编号无关
    2群组id列表groupIdListList传入多个群组id

    2)数据格式

    1. {
    2. "groupIdList": [
    3. 1,2,3,4,5
    4. ]
    5. }

    示例:

    1. curl -X POST "http://localhost:5002/WeBASE-Front/{groupId}/web3/queryGroupStatus" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"groupIdList\": [ 1,2,3,4,5 ]}"

    响应参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组与状态Map-Map
    1.1群组idString群组id
    1.2群组状态String包含五种状态:”INEXISTENT”、”STOPPING”、”RUNNING”、”STOPPED”、”DELETED”

    a、成功:

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": {
    5. "1": "RUNNING",
    6. "2": "RUNNING",
    7. "3": "INEXISTENT",
    8. "4": "INEXISTENT",
    9. "5": "INEXISTENT"
    10. }
    11. }

    3.27. 获取区块的时间戳与交易量

    接口描述

    根据块高获取区块的时间戳与区块中的交易数

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组idgroupIdint操作的群组编号
    2块高blockNumberBigInteger

    2)数据格式

    1. http://localhost:5002/WeBASE-Front//1/web3/blockStat/5

    响应参数

    1)数据格式

    a、成功:

    1. {
    2. "blockNumber": 5,
    3. "timestamp": 1617715398371,
    4. "txCount": 1
    5. }

    3.28. 获取前置所连节点的配置信息

    接口描述

    返回节点的config.ini配置信息

    接口URL

    http://localhost:5002/WeBASE-Front/{groupId}/web3/nodeConfig

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/nodeConfig

    响应参数

    1)数据格式

    1. {
    2. "p2pip": "172.17.0.1",
    3. "listenip": "0.0.0.0",
    4. "rpcport": "8535",
    5. "p2pport": "30300",
    6. "channelPort": "20200",
    7. "groupDataPath": "data/",
    8. "enableStatistic": false
    9. }
    • 失败:

    节点前置的application.yml中未配置nodePath,导致无法读取节点的配置信息

    1. {
    2. "code": 0,
    3. "message": "Success",
    4. "data": {
    5. "p2pip": "null",
    6. "listenip": "null",
    7. "rpcport": "null",
    8. "p2pport": "null",
    9. "channelPort": "null",
    10. "groupDataPath": "null",
    11. "enableStatistic": false
    12. }
    13. }

    3.29. 获取前置所连节点信息

    接口描述

    返回

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/nodeInfo

    响应参数

    1)数据格式

    1. {
    2. "NodeID": "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d",
    3. "IPAndPort": "0.0.0.0:35310",
    4. "Agency": "agencyA_son",
    5. "Node": "node0",
    6. "Topic": ["_block_notify_1", "_block_notify_2"]
    7. }

    3.30. 根据块高获取区块头

    接口描述

    返回

    接口URL

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

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/blockHeaderByNumber/2

    响应参数

    1)数据格式

    1. {
    2. "number": 2,
    3. "hash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625",
    4. "parentHash": "0x489ee0c00527879f7e2470bde7b62e9ea30fadb242bcbd9ba582d0dee4958e2f",
    5. "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    6. "transactionsRoot": "0xade02313d3200f38dfc18cdc368241cf4c1cb7e72011edf847ec216efa43a99e",
    7. "receiptsRoot": "0xb7c4b856c9335bd345c0b022057567a2223218e7a7dab822981467b29ac1e326",
    8. "dbHash": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15",
    9. "stateRoot": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15",
    10. "sealer": "0x2",
    11. "sealerList": [
    12. "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f",
    13. "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7",
    14. "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39",
    15. "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d"
    16. ],
    17. "extraData": [],
    18. "gasLimit": "0",
    19. "gasUsed": "0",
    20. "timestamp": "1619424150450",
    21. "signatureList": [
    22. {
    23. "index": "0x1",
    24. "signature": "0xa05b5d220e41051fa80f212884d9cdda3a8973a4ac2d2dc74e42db32b459e5f595a61e30266f0e8bf7edb065ff107c6af5e6349f9ae518146dc686406ebbade165bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7"
    25. },
    26. {
    27. "index": "0x3",
    28. "signature": "0x48bb622e24b18f4eb601137d44b5d86e2c287be3aa849dce1768e87e75308ba69391e62f90d76bf84b9b6eb1509d11409f9b784bc7b052458a4596b81961fac8fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d"
    29. },
    30. {
    31. "index": "0x2",
    32. "signature": "0x3a3cc8c20c5cdbb6431ec1f749d94662670e87442debef119a4e6469ccb16a60a152d32754ab833efa513839b076c2aa1ceb7e536db3734b740e9192b10ee38695efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39"
    33. }
    34. ]
    35. }

    3.31. 根据区块哈希获取区块头

    接口描述

    返回

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/1/web3/blockHeaderByHash/0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625

    响应参数

    1)数据格式

    1. {
    2. "number": 2,
    3. "hash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625",
    4. "parentHash": "0x489ee0c00527879f7e2470bde7b62e9ea30fadb242bcbd9ba582d0dee4958e2f",
    5. "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    6. "transactionsRoot": "0xade02313d3200f38dfc18cdc368241cf4c1cb7e72011edf847ec216efa43a99e",
    7. "receiptsRoot": "0xb7c4b856c9335bd345c0b022057567a2223218e7a7dab822981467b29ac1e326",
    8. "dbHash": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15",
    9. "stateRoot": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15",
    10. "sealer": "0x2",
    11. "sealerList": [
    12. "06269e130f8220ebaa78e67832df0de6b4c5ee3f1b14e64ab2bae26510a4bcf997454b35067c1685d4343e6ad84b45c3b8690a858f2831a9247a97a27166ce1f",
    13. "65bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7",
    14. "95efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39",
    15. "fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d"
    16. ],
    17. "extraData": [],
    18. "gasLimit": "0",
    19. "gasUsed": "0",
    20. "timestamp": "1619424150450",
    21. "signatureList": [
    22. {
    23. "index": "0x1",
    24. "signature": "0xa05b5d220e41051fa80f212884d9cdda3a8973a4ac2d2dc74e42db32b459e5f595a61e30266f0e8bf7edb065ff107c6af5e6349f9ae518146dc686406ebbade165bc44d398d99d95a9d404aa16e4bfbc2f9ebb40f20439ddef8575a139dc3a80310cfc98a035bd59a67cc5f659f519e3e99b855f3d27f21a889c23a14036d0c7"
    25. },
    26. {
    27. "index": "0x3",
    28. "signature": "0x48bb622e24b18f4eb601137d44b5d86e2c287be3aa849dce1768e87e75308ba69391e62f90d76bf84b9b6eb1509d11409f9b784bc7b052458a4596b81961fac8fe57d7b39ed104b4fb2770ae5aad7946bfd377d0eb91ab92a383447e834c3257dec56686551d08178f2d5f40d9fad615293e46c9f5fc23cf187258e121213b1d"
    29. },
    30. {
    31. "index": "0x2",
    32. "signature": "0x3a3cc8c20c5cdbb6431ec1f749d94662670e87442debef119a4e6469ccb16a60a152d32754ab833efa513839b076c2aa1ceb7e536db3734b740e9192b10ee38695efafa5197796e7edf647191de83f4259d7cbb060f4bac5868be474037f49144d581c15d8aef9b07d78f18041a5f43c3c26352ebbf5583cd23070358c8fba39"
    33. }
    34. ]
    35. }

    4. 性能检测接口

    4.1. 获取机器配置信息

    接口描述

    获取机器配置信息

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

    无入参

    响应参数

    1)参数表

    1. {
    2. "memoryTotalSize": "8010916",
    3. "cpuAmount": "4",
    4. "memoryUsedSize": "7818176",
    5. "cpuSize": "2599",
    6. "ip": "127.0.0.1",
    7. "diskUsedSize": "313811828",
    8. "diskTotalSize": "515928320"
    9. }

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

    接口描述

    获取机器历史性能信息

    接口URL

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

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    响应参数

    1)参数表

    1. {
    2. [{
    3. "metricType": "cpu",
    4. "data": {
    5. "lineDataList": {
    6. "timestampList": [],
    7. "valueList": []
    8. },
    9. "contrastDataList": {
    10. "timestampList": [],
    11. "valueList": []
    12. }
    13. }
    14. }, {
    15. "metricType": "memory",
    16. "data": {
    17. "lineDataList": {
    18. "timestampList": null,
    19. "valueList": []
    20. },
    21. "contrastDataList": {
    22. "timestampList": null,
    23. "valueList": []
    24. }
    25. }
    26. }, {
    27. "metricType": "disk",
    28. "data": {
    29. "lineDataList": {
    30. "timestampList": null,
    31. "valueList": []
    32. },
    33. "contrastDataList": {
    34. "timestampList": null,
    35. "valueList": []
    36. }
    37. }
    38. }, {
    39. "metricType": "txbps",
    40. "data": {
    41. "lineDataList": {
    42. "timestampList": null,
    43. "valueList": []
    44. },
    45. "contrastDataList": {
    46. "timestampList": null,
    47. "valueList": []
    48. }
    49. }
    50. }, {
    51. "metricType": "rxbps",
    52. "data": {
    53. "lineDataList": {
    54. "timestampList": null,
    55. "valueList": []
    56. },
    57. "contrastDataList": {
    58. "timestampList": null,
    59. "valueList": []
    60. }
    61. }
    62. }]
    63. }
    64. }

    4.3. 监测机器性能的启停状态

    接口描述

    获取机器历史性能信息的开启或关闭状态

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    响应参数

    1)参数表

    1. {
    2. "code": 0,
    3. "message": "Sync Status is ON",
    4. "data": true
    5. }

    4.4. 管理监测机器性能的状态

    接口描述

    管理监测机器历史性能信息的状态,开启或关闭;默认状态为开启,可通过修改配置文件中constant的monitorEnable值改变监测默认开关状态

    接口URL

    http://localhost:5002/WeBASE-Front/performance/toggle

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1开关enableboolean开启为”1”, 关闭为”0”

    2)数据格式

    1. {
    2. "enable": 0
    3. }

    示例:

    1. curl -l -H "Content-type: application/json" -X POST -d '{"enable": 0}' http://127.0.0.1:5002/WeBASE-Front/performance/toggle

    响应参数

    a、关闭监测机器性能信息

    1. {
    2. "code": 0,
    3. "message": "Sync Status is OFF",
    4. "data": false
    5. }

    b、开启监测机器性能信息

    1. {
    2. "code": 0,
    3. "message": "Sync Status is ON",
    4. "data": true
    5. }

    4.5. 获取节点监控信息

    接口描述

    获取节点监控信息

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)入参示例

    1. localhost:5002/WeBASE-Front/chain?beginDate=2019-03-13T00:00:00&endDate=2019-03-13T14:34:22&contrastBeginDate=2019-03-13T00:00:00&contrastEndDate=2019-03-13T14:34:22&gap=60&groupId=1

    响应参数

    1)参数表

    序号输出参数类型备注
    1dataArray返回信息列表
    1.1Object返回信息实体
    1.1.1metricTypeString测量类型:blockHeight(块高)、pbftView(pbft视图)、pendingCount(待处理交易数量)
    1.1.2dataObject
    1.1.2.1lineDataListObject指定时间的数据
    1.1.2.1.1timestampListList时间戳列表
    1.1.2.1.2valueListList值列表
    1.1.2.2contrastDataListObject比对时间的数据
    1.1.2.2.1timestampListList时间戳列表
    1.1.2.2.2valueListList值列表

    2)出参示例

    1. [
    2. {
    3. "metricType": "blockHeight",
    4. "data": {
    5. "lineDataList": {
    6. "timestampList": [
    7. 1552406401042,
    8. 1552406701001
    9. ],
    10. "valueList": [
    11. 747309,
    12. 747309
    13. ]
    14. },
    15. "contrastDataList": {
    16. "timestampList": [
    17. 1552320005000,
    18. 1552320301001
    19. ],
    20. "valueList": [
    21. null,
    22. 747309
    23. ]
    24. }
    25. }
    26. },
    27. {
    28. "metricType": "pbftView",
    29. "data": {
    30. "lineDataList": {
    31. "timestampList": null,
    32. "valueList": [
    33. 118457,
    34. 157604
    35. ]
    36. },
    37. "contrastDataList": {
    38. "timestampList": null,
    39. "valueList": [
    40. null,
    41. 33298
    42. ]
    43. }
    44. }
    45. ]

    4.6. 检查节点进程是否存活

    接口描述

    检查节点进程是否存活

    接口URL

    http://localhost:5002/WeBASE-Front/chain/checkNodeProcess

    调用方法

    HTTP GET

    请求参数

    1)参数表

    响应参数

    1)参数表

    1. true

    4.7. 获取节点所在群组物理大小信息

    接口描述

    获取节点所在群组物理大小信息

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

    响应参数

    1)参数表

    1)出参表

    序号输出参数类型备注
    1dataArray返回信息列表
    1.1Object返回信息实体
    1.1.1groupIdInt群组id
    1.1.2groupNameString群组名
    1.1.3pathString文件路径
    1.1.4sizeLong大小(单位:KB)

    2)出参示例

    • 成功:
    1. [
    2. {
    3. "groupId": 31231,
    4. "groupName": "group31231",
    5. "path": "/data/app/nodes/127.0.0.1/node0/data/group31231",
    6. "size": 27085
    7. },
    8. {
    9. "groupId": 2,
    10. "groupName": "group2",
    11. "path": "/data/app/nodes/127.0.0.1/node0/data/group2",
    12. "size": 23542
    13. },
    14. {
    15. "groupId": 1,
    16. "groupName": "group1",
    17. "path": "/data/app/nodes/127.0.0.1/node0/data/group1",
    18. "size": 25077
    19. },
    20. {
    21. "groupId": 111,
    22. "groupName": "group111",
    23. "path": "/data/app/nodes/127.0.0.1/node0/data/group111",
    24. "size": 21552
    25. }
    26. ]

    5.1. 交易处理接口(结合WeBASE-Sign)

    接口描述

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

    当合约方法为非“constant”方法,要发送数据上链时,此接口需结合WeBASE-Sign使用。通过调用WeBASE-Sign服务的签名接口让相关用户对数据进行签名,拿回签名数据再发送上链。需要调用此接口时,工程配置文件application.yml中的配置”keyServer”需配置WeBASE-Sign服务的ip和端口,并保证WeBASE-Sign服务正常和存在相关用户。

    方法入参(funcParam)为JSON数组,多个参数以逗号分隔(参数为数组时同理),示例:

    1. function set(string s) -> ["aa,bb\"cc"] // 双引号要转义
    2. function set(uint n,bool b) -> [1,true]
    3. function set(bytes b,address[] a) -> ["0x1a",["0x7939E26070BE44E6c4Fc759Ce55C6C8b166d94BE","0xce867fD9afa64175bb50A4Aa0c17fC7C4A3C67D9"]]

    查看WeBASE-Front通过本地私钥(测试用户)交易处理接口(非WeBASE-Sign签名交易),可查看

    接口URL

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1用户编号signUserIdString64WeBASE-Sign用户编号(查询方法可不传)
    2合约名称contractNameString
    3合约地址contractAddressString
    4方法名funcNameString
    5合约编译后生成的abi文件内容contractAbiList合约中单个函数的ABI,若不存在同名函数可以传入整个合约ABI,格式:JSONArray
    6方法参数funcParamListJSON数组,多个参数以逗号分隔(参数为数组时同理),如:[“str1”,[“arr1”,”arr2”]]
    7群组IDgroupIdint默认为1
    8是否使用cns调用useCnsbool
    9cns名称cnsNameStringCNS名称,useCns为true时不能为空
    10cns版本versionStringCNS版本,useCns为true时不能为空

    2)数据格式

    1. {
    2. "groupId": "1",
    3. "signUserId": "f4975519b0274e6ca8283650a7e1bc07",
    4. "contractName": "HelloWorld",
    5. "contractPath": "/",
    6. "version": "",
    7. "funcName": "set",
    8. "funcParam": ["333"],
    9. "contractAddress": "0xe10441d9179cf0424aae808b51bc85dcbbfe1447",
    10. "contractAbi": [{
    11. "inputs": [{
    12. "internalType": "string",
    13. "name": "n",
    14. "type": "string"
    15. }],
    16. "name": "set",
    17. "outputs": [],
    18. "stateMutability": "nonpayable",
    19. "type": "function",
    20. "funcId": 2
    21. }],
    22. "useAes": false,
    23. "useCns": false,
    24. "cnsName": ""
    25. }

    示例:

    1. 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\":\"\"}"

    响应参数

    a、正确查询交易返回值信息

    1. {"Hi,Welcome!"}

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

    1. {
    2. "transactionHash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429",
    3. "transactionIndex": "0x0",
    4. "root": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15",
    5. "blockNumber": "2",
    6. "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625",
    7. "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d",
    8. "to": "0x0000000000000000000000000000000000000000",
    9. "gasUsed": "316449",
    10. "contractAddress": "0xa8af0ee580d8af674a60341030ddbc45431bc235",
    11. "logs": [],
    12. "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    13. "status": "0x0",
    14. "statusMsg": "None",
    15. "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029",
    16. "output": "0x",
    17. "txProof": null,
    18. "receiptProof": null,
    19. "message": null,
    20. "statusOK": true
    21. }

    5.2. 交易处理接口(本地签名)

    接口描述

    此接口为WeBASE-Front使用本地私钥(页面中的测试用户)进行签名

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

    方法入参(funcParam)为JSON数组,多个参数以逗号分隔(参数为数组时同理),示例:

    1. function set(string s) -> ["aa,bb\"cc"] // 双引号要转义
    2. function set(uint n,bool b) -> [1,true]
    3. function set(bytes b,address[] a) -> ["0x1a",["0x7939E26070BE44E6c4Fc759Ce55C6C8b166d94BE","0xce867fD9afa64175bb50A4Aa0c17fC7C4A3C67D9"]]

    查看WeBASE-Front通过WeBASE-Sign交易处理的接口(非本地私钥签名交易),可查看

    接口URL

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1用户地址userString用户地址,可通过/privateKey接口创建
    2合约名称contractNameString
    3合约地址contractAddressString
    4方法名funcNameString
    5合约编译后生成的abi文件内容contractAbiList合约中单个函数的ABI,若不存在同名函数可以传入整个合约ABI,格式:JSONArray
    6方法参数funcParamListJSON数组,多个参数以逗号分隔(参数为数组时同理),如:[“str1”,[“arr1”,”arr2”]],根据所调用的合约方法判断是否必填
    7群组IDgroupIdint默认为1
    8合约路径contractPathint
    9是否使用cns调用useCnsbool
    10cns名称cnsNameStringCNS名称,useCns为true时不能为空
    11cns版本versionStringCNS版本,useCns为true时不能为空

    2)数据格式

    示例:

    1. 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

    传入合约abi:

    1. {
    2. "groupId": "1",
    3. "user": "0x7bfa3539c8761978f0a2a1f7f240bde97819fb03",
    4. "contractName": "HelloWorld",
    5. "contractPath": "/",
    6. "version": "",
    7. "funcName": "set",
    8. "funcParam": ["333"],
    9. "contractAddress": "0xe10441d9179cf0424aae808b51bc85dcbbfe1447",
    10. "contractAbi": [{
    11. "inputs": [{
    12. "internalType": "string",
    13. "name": "n",
    14. "type": "string"
    15. }],
    16. "name": "set",
    17. "outputs": [],
    18. "stateMutability": "nonpayable",
    19. "type": "function",
    20. "funcId": 2
    21. }],
    22. "useAes": false,
    23. "useCns": false,
    24. "cnsName": ""
    25. }

    响应参数

    a、正确查询交易返回值信息

    1. {"Hi,Welcome!"}

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

    1. {
    2. "transactionHash": "0x69ced0162a0c3892e4eaa3091b831ac3aaeb772c062746b20891ceaf8a4fb429",
    3. "transactionIndex": "0x0",
    4. "root": "0x8cbc3f2c0e35a71738909e3b388efa6697084b05badd3a3bd3c64f0575c78c15",
    5. "blockNumber": "2",
    6. "blockHash": "0xf58f4f43b3761f4863ad366c4a7e2a812ed68df9f7bcad6b502fd544665e7625",
    7. "from": "0x9d75e0ee66cfef16897b601624b60413d988ae7d",
    8. "to": "0x0000000000000000000000000000000000000000",
    9. "gasUsed": "316449",
    10. "contractAddress": "0xa8af0ee580d8af674a60341030ddbc45431bc235",
    11. "logs": [],
    12. "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    13. "status": "0x0",
    14. "statusMsg": "None",
    15. "input": "0x608060405234801561001057600080fd5b506103e3806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063299f7f9d1461005c5780633590b49f146100ec57806362e8d6ce14610155575b600080fd5b34801561006857600080fd5b5061007161016c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100f857600080fd5b50610153600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020e565b005b34801561016157600080fd5b5061016a6102c4565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102045780601f106101d957610100808354040283529160200191610204565b820191906000526020600020905b8154815290600101906020018083116101e757829003601f168201915b5050505050905090565b7f5715c9562eaf8d524d564edb392acddefc81d8133e2fc3b8125a260b1b413fda816040518080602001828103825283818151815260200191508051906020019080838360005b83811015610270578082015181840152602081019050610255565b50505050905090810190601f16801561029d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a180600090805190602001906102c0929190610312565b5050565b6040805190810160405280600d81526020017f48656c6c6f2c20576f726c6421000000000000000000000000000000000000008152506000908051906020019061030f929190610312565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035357805160ff1916838001178555610381565b82800160010185558215610381579182015b82811115610380578251825591602001919060010190610365565b5b50905061038e9190610392565b5090565b6103b491905b808211156103b0576000816000905550600101610398565b5090565b905600a165627a7a72305820f3088deb3d14c6893440e4769f2389e9335e04faa10e6de5b4c93af15d1a34e80029",
    16. "output": "0x",
    17. "txProof": null,
    18. "receiptProof": null,
    19. "message": null,
    20. "statusOK": true
    21. }

    5.3. 已签名交易发送

    接口描述

    发送已签名的交易上链,返回交易收据;可结合/trans/convertRawTxStr/local/trans/convertRawTxStr/withSign接口组装已签名的交易

    接口URL

    http://localhost:5002/WeBASE-Front/trans/signed-transaction

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1已签名交易编码值signedStrString/trans/convertRawTxStr/local/trans/convertRawTxStr/withSign接口组装已签名的交易
    2是否同步发送syncbool
    2群组IDgroupIdint

    2)数据格式

    1. {
    2. "signedStr": "0xf9012da001071041dddc1b3c553b48c0fbefecc07f3812f5ce4004d47708f1c3342844db018405f5e10082029d94e10441d9179cf0424aae808b51bc85dcbbfe144780b8643590b49f000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000033333330000000000000000000000000000000000000000000000000000000000010180b84083bb5313e3dd7825b8b3e32d73aa8aedf9f9a8fcf435e5c37edfe4645c1af4211c12e1368024336a576f26ed624407da0b94e0bc5760514543c0b7a38fa03a7da0972843d0879ffdbdae733e8707896a532e5e1a3c7262cb84db657dd34f09111ba0786106465fe0fd2383588693cafef8934df62b188c6bb5a74eb6b9f23adaba32",
    3. "sync": true,
    4. "groupId":1
    5. }

    响应参数

    1)数据格式

    1. {
    2. "transactionHash": "0xd1234cdb673447b654874d05d4ed98be89f3cb7c5a6c12bc51e1274a03af029c",
    3. "transactionIndex": "0x0",
    4. "root": "0xeecf2b6bbb028e38e704ca88fe1d9f5e3d43197b32c3336d3273d86fb3a135f0",
    5. "blockNumber": "0xa9",
    6. "blockHash": "0x906bdf0747ba68c03e6cf73463db62fdbd8ab8debc149f890475775d7c6a8af7",
    7. "from": "0x7bfa3539c8761978f0a2a1f7f240bde97819fb03",
    8. "to": "0xe10441d9179cf0424aae808b51bc85dcbbfe1447",
    9. "gasUsed": "0x710b",
    10. "contractAddress": "0x0000000000000000000000000000000000000000",
    11. "logs": [],
    12. "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    13. "status": "0x0",
    14. "statusMsg": "None",
    15. "input": "0x3590b49f000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000033333330000000000000000000000000000000000000000000000000000000000",
    16. "output": "0x",
    17. "txProof": null,
    18. "receiptProof": null,
    19. "message": "Success",
    20. "statusOK": true
    21. }

    5.4. 已编码查询交易发送

    接口描述

    发送已编码的查询交易,返回合约的返回值;其中encodeStr字段可通过/trans/encodeFunction接口获取合约函数的编码值

    接口URL

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1合约函数编码值encodeStrString可通过/trans/encodeFunction接口获取合约函数的编码值
    2合约地址contractAddressString
    3群组IDgroupIdint默认为1
    4合约名funcNameString
    5合约abicontractAbiString
    6用户地址userAddressString

    2)数据格式

    1. {
    2. "encodeStr": "0x299f7f9d",
    3. "contractAddress": "0x2b5ad5c4795c026514f8317c7a215e218dccd6cf",
    4. "groupId":1,
    5. "funcName": "get",
    6. "contractAbi": "[{\"constant\":false,\"inputs\":[{\"name\":\"num\",\"type\":\"uint256\"}],\"name\":\"trans\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"num\",\"type\":\"uint256\"}],\"name\":\"TransEvent\",\"type\":\"event\"}]"
    7. }

    响应参数

    Object返回类型

    1. {"Hi,Welcome!"}

    5.5. Hash计算

    接口描述

    计算HASH和签名值

    接口URL

    http://localhost:5002/WeBASE-Front/trans/signMessageHash

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1用户地址userString用户地址,可通过/privateKey接口创建
    2Hash值hashString

    2)数据格式

    1. {
    2. "hash": "0xa271b78b8e869d693f7cdfee7162d7bfb11ae7531fd50f73d86f73a05c84dd7c",
    3. "user": "0x883cfa1d40117dd2d270aa8bb0bb33776409be8b"
    4. }

    响应参数

    1)数据格式

    1. {
    2. "v": 0,
    3. "r": "0x2a76a45bcf1113615f796cc01b23c57f81f20ce79500080bb34c7994ed04de06",
    4. "s": "0x4f111eb37720e2618d8906368c825fd3cbe89b2781cb678efafb42399594a580",
    5. "p": "0x4405f9d5d6ccff709b6543bc8ac24cbb649d3267a66db19ab8f85f3b884a8505f086c581490e7e50558879abde9c4d07fc2daab92f81c0eb4b805af3c8895cfc"
    6. }

    5.6. 获取签名后的交易体编码值(结合WeBASE-Sign)

    接口描述

    构造交易体RawTransaction并将交易体编码,通过传入的signUserId签名服务的用户ID,使用对应的私钥对交易提进行签名后,返回已签名的交易体编码值(十六进制字符串)

    签名后的交易的编码值可以直接通过/trans/signed-transaction接口提交到链上

    接口URL

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1用户编号signUserIdString64WeBASE-Sign用户编号,若为空则返回未签名交易提编码值
    2合约名称contractNameString
    3合约地址contractAddressString
    4方法名funcNameString
    5合约编译后生成的abi文件内容contractAbiList合约中单个函数的ABI,若不存在同名函数可以传入整个合约ABI,格式:JSONArray
    6方法参数funcParamListJSON数组,多个参数以逗号分隔(参数为数组时同理),如:[“str1”,[“arr1”,”arr2”]]
    7群组IDgroupIdint默认为1
    8是否使用cns调用useCnsbool
    9cns名称cnsNameStringCNS名称,useCns为true时不能为空
    10cns版本versionStringCNS版本,useCns为true时不能为空

    2)数据格式

    1. {
    2. "groupId": "1",
    3. "signUserId": "f4975519b0274e6ca8283650a7e1bc07",
    4. "contractName": "HelloWorld",
    5. "contractPath": "/",
    6. "version": "",
    7. "funcName": "set",
    8. "funcParam": ["333"],
    9. "contractAddress": "0xe10441d9179cf0424aae808b51bc85dcbbfe1447",
    10. "contractAbi": [{
    11. "inputs": [{
    12. "internalType": "string",
    13. "name": "n",
    14. "type": "string"
    15. }],
    16. "name": "set",
    17. "outputs": [],
    18. "stateMutability": "nonpayable",
    19. "type": "function",
    20. "funcId": 2
    21. }],
    22. "useAes": false,
    23. "useCns": false,
    24. "cnsName": ""
    25. }

    响应参数

    1. 0xf9012da002c1442b6ce974291ec317db9859e8310de46f6636d105f19fee67f10ac60b2f018405f5e10082029e94e10441d9179cf0424aae808b51bc85dcbbfe144780b8643590b49f000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000033333330000000000000000000000000000000000000000000000000000000000010180b8407d3efe268051e49350d877eaba7bbe6369a44263aec6e47fcba2ac1aff849261e833361bc67befbf4566894478c011dcae3e06818a381401751d1bf8bceecedaa01605fb8fcb546b0dc79e1da004a8323b151d1f569e10cae85a3f62bad5d7150fa0d77282eb650e0f52956693177717eb31cfddcada0681973a6aed9c46f3d8eb4d

    5.7. 获取签名后的交易体编码值(本地签名)

    接口描述

    构造交易体RawTransaction并将交易体编码,并通过传入的user地址的私钥对交易提进行签名后,返回已签名的交易体编码值(十六进制字符串)

    签名后的交易的编码值可以直接通过/trans/signed-transaction接口提交到链上

    接口URL

    http://localhost:5002/WeBASE-Front/trans/convertRawTxStr/local

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1用户地址userString用户地址,可通过/privateKey接口创建。若user为空,则返回未签名交易编码值
    2合约名称contractNameString
    3合约地址contractAddressString
    4方法名funcNameString
    5合约编译后生成的abi文件内容contractAbiList合约中单个函数的ABI,若不存在同名函数可以传入整个合约ABI,格式:JSONArray
    6方法参数funcParamListJSON数组,多个参数以逗号分隔(参数为数组时同理),如:[“str1”,[“arr1”,”arr2”]],根据所调用的合约方法判断是否必填
    7群组IDgroupIdint默认为1
    8合约路径contractPathint
    9是否使用cns调用useCnsbool
    10cns名称cnsNameStringCNS名称,useCns为true时不能为空
    11cns版本versionStringCNS版本,useCns为true时不能为空

    2)数据格式

    示例:

    1. {
    2. "user":"0x2db346f9d24324a4b0eac7fb7f3379a2422704db",
    3. "contractName":"HelloWorld",
    4. "contractAddress":"dasdfav23rf213vbcdvadf3bcdf2fc23rqde",
    5. "funcName":"set",
    6. "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"}],
    7. "funcParam":["Hi,Welcome!"],
    8. "groupId" :"1",
    9. "useCns": false
    10. }

    响应参数

    1)数据格式

    1. 0xf9012da001071041dddc1b3c553b48c0fbefecc07f3812f5ce4004d47708f1c3342844db018405f5e10082029d94e10441d9179cf0424aae808b51bc85dcbbfe144780b8643590b49f000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000033333330000000000000000000000000000000000000000000000000000000000010180b84083bb5313e3dd7825b8b3e32d73aa8aedf9f9a8fcf435e5c37edfe4645c1af4211c12e1368024336a576f26ed624407da0b94e0bc5760514543c0b7a38fa03a7da0972843d0879ffdbdae733e8707896a532e5e1a3c7262cb84db657dd34f09111ba0786106465fe0fd2383588693cafef8934df62b188c6bb5a74eb6b9f23adaba32

    5.8. 获取合约函数的编码值

    接口描述

    构造合约函数的编码值,适用于查询交易,合约函数的编码值可以直接通过/trans/query-transaction接口提交到链上

    接口URL

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1方法名funcNameString
    2合约编译后生成的abi文件内容contractAbiList合约中单个函数的ABI,若不存在同名函数可以传入整个合约ABI,格式:JSONArray
    3方法参数funcParamListJSON数组,多个参数以逗号分隔(参数为数组时同理),如:[“str1”,[“arr1”,”arr2”]],根据所调用的合约方法判断是否必填,为空则使用[]空数组代替

    2)数据格式

    示例:

    1. {
    2. "contractAbi": [{
    3. "inputs": [],
    4. "name": "get",
    5. "outputs": [{
    6. "internalType": "string",
    7. "name": "",
    8. "type": "string"
    9. }],
    10. "stateMutability": "view",
    11. "type": "function",
    12. "funcId": 1
    13. }],
    14. "contractAddress": "0xe10441d9179cf0424aae808b51bc85dcbbfe1447",
    15. "encodeStr": "0x299f7f9d",
    16. "funcName": "get",
    17. "groupId": 1,
    18. "userAddress": "0x7bfa3539c8761978f0a2a1f7f240bde97819fb03"
    19. }

    响应参数

    1)数据格式

    1. 0x299f7f9d

    6. 系统管理接口

    使用FISCO BCOS v2.5.0 与 WeBASE-Front v1.4.1 (及)以上版本将使用预编译合约中的ChainGovernance接口(从本章节接口6.13开始),详情可参考

    6.1. 查询权限接口

    6.1.1 查询权限接口

    接口描述

    根据PermissionType权限类型,查询该类权限记录列表。共支持查看六种权限的管理员列表:权限管理权限permission, 用户表管理权限userTable, 部署合约和创建用户表权限deployAndCreate, 节点管理权限node, 使用CNS权限cns, 系统参数管理权限sysConfig

    接口URL

    http://localhost:5002/WeBASE-Front/permission?groupId={groupId}&permissionType={permissionType}&pageSize={pageSize}&pageNumber={pageNumber}

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组IDgroupIdint节点所属群组ID,默认为1
    2权限类型permissionTypeString分配权限的类型
    3分页大小pageSizeint默认为10
    4分页页码pageNumberint默认为1
    5表名tableNameStringpermissionTypeuserTable时为必填
    2)数据格式
    1. http://localhost:5002/WeBASE-Front/permission?groupId=1&permissionType=cns&pageSize=5&pageNumber=1

    响应参数

    1)数据格式

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": [
    5. {
    6. "address": "0x009fb217b6d7f010f12e7876d31a738389fecd51",
    7. "table_name": "_sys_table_access_",
    8. "enable_num": "84"
    9. }
    10. ],
    11. "totalCount": 1
    12. }

    6.1.2 查询权限接口(不分页)

    接口URL

    http://localhost:5002/WeBASE-Front/permission/full?groupId={groupId}&permissionType={permissionType}

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组IDgroupIdint节点所属群组ID
    2权限类型permissionTypeString分配权限的类型
    3表名tableNameString当permissionType为userTable时不可为空

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/permission/full?groupId=1&permissionType=cns&pageSize=5&pageNumber=1

    响应参数

    1)数据格式

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": [
    5. {
    6. "address": "0x009fb217b6d7f010f12e7876d31a738389fecd51",
    7. "table_name": "_sys_table_access_",
    8. "enable_num": "84"
    9. }
    10. ],
    11. "totalCount": 1
    12. }

    6.1.3 获取权限状态列表接口(不分页)

    接口URL

    http://localhost:5002/WeBASE-Front/permission/sorted/full?groupId={groupId}

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组IDgroupIdint节点所属群组ID

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/permission/sorted/full?groupId=1

    响应参数

    1)数据格式

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": {
    5. "0x2cbca2910b650e5816b4731b097eb8985be39805": {
    6. "deployAndCreate": 1,
    7. "cns": 0,
    8. "sysConfig": 0,
    9. "node": 0
    10. },
    11. "0x79d3632a8bc9b3e823a8e475436d5aa6e0fb88a7": {
    12. "deployAndCreate": 1,
    13. "cns": 1,
    14. "sysConfig": 1,
    15. "node": 1
    16. },
    17. "0x202b4245087dbf797f954d8425459bfee3c790f8": {
    18. "deployAndCreate": 1,
    19. "cns": 1,
    20. "sysConfig": 1,
    21. "node": 1
    22. },
    23. "0x7db73896a6db5e86563af18f206405030bd569f8": {
    24. "deployAndCreate": 0,
    25. "cns": 1,
    26. "sysConfig": 0,
    27. "node": 0
    28. }
    29. },
    30. "totalCount": 4
    31. }

    6.2. 增加管理权限接口

    接口描述

    由管理员赋予外部账户地址不同类型的权限,包含六种:权限管理权限permission, 用户表管理权限userTable, 部署合约和创建用户表权限deployAndCreate, 节点管理权限node, 使用CNS权限cns, 系统参数管理权限sysConfig

    其中userTable权限还需传入相应的表明tableName

    接口URL

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组IDgroupIdint节点所属群组ID
    2权限类型permissionTypeString分配权限的类型(六种:permission, userTable, deployAndCreate, node, cns, sysConfig)
    3管理员地址fromAddressString
    4被授予权限地址addressString
    5表名tableNameString当permissionType为userTable时不可为空

    2)数据格式

    1. {
    2. "groupId": 1,
    3. "permissionType": "permission",
    4. "fromAddress": "0xd5bba8fe456fce310f529edecef902e4b63129b1",
    5. "address": "0x2357ad9d97027cd71eea1d639f1e5750fbdfd38e"

    示例:

    1. curl -l -H "Content-type: application/json" -X POST -d '{"groupId": 1, "permissionType": "permission", "fromAddress": "0xd5bba8fe456fce310f529edecef902e4b63129b1", "address": "0x2357ad9d97027cd71eea1d639f1e5750fbdfd38e"}' http://10.0.0.1:5002/WeBASE-Front/permission

    响应参数

    a、成功:

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

    b、失败:

    1. {
    2. "code": -51000,
    3. "message": "table name and address already exist"
    4. }

    6.3. 去除管理权限接口

    接口描述

    由管理员去除外部账户地址不同类型的权限,包含六种:权限管理权限permission, 用户表管理权限userTable, 部署合约和创建用户表权限deployAndCreate, 节点管理权限node, 使用CNS权限cns, 系统参数管理权限sysConfig

    其中userTable权限还需传入相应的表明tableName

    接口URL

    http://localhost:5002/WeBASE-Front/permission

    调用方法

    HTTP DELETE

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组IDgroupIdint节点所属群组ID
    2权限类型permissionTypeString分配权限的类型(六种:permission, userTable, deployAndCreate, node, cns, sysConfig)
    3管理员地址fromAddressString
    4被授予权限地址addressString
    5表名tableNameString当permissionType为userTable时不可为空

    2)数据格式

    1. {
    2. "groupId": 1,
    3. "permissionType": "permission",
    4. "fromAddress": "0xd5bba8fe456fce310f529edecef902e4b63129b1",
    5. "address": "0x2357ad9d97027cd71eea1d639f1e5750fbdfd38e"
    6. }

    示例:

    1. curl -l -H "Content-type: application/json" -X DELETE -d '{"groupId": 1, "permissionType": "permission", "fromAddress": "0xd5bba8fe456fce310f529edecef902e4b63129b1", "address": "0x2357ad9d97027cd71eea1d639f1e5750fbdfd38e"}' http://10.0.0.1:5002/WeBASE-Front/permission

    响应参数

    a、成功:

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

    b、失败:

    1. {
    2. "code": -51001,
    3. "message": "table name and address does not exist"
    4. }

    6.4. 管理用户权限状态接口

    接口描述

    管理用户权限状态,批量修改用户权限

    注:目前只支持cns、deployAndCreate、sysConfig、node四种权限管理

    接口URL

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组IDgroupIdint节点所属群组ID
    2管理员地址fromAddressString
    3被授予权限地址addressString
    4用户权限状态permissionStateObject使用{“permissionType”: 1}格式,参照下文数据格式;1代表赋予,0代表去除;支持cns、deployAndCreate、sysConfig、node四种权限

    2)数据格式

    1. {
    2. "groupId": "2",
    3. "fromAddress": "0x09fb217b6d7f010f12e7876d31a738389fecd517",
    4. "address": "0x09fb217b6d7f010f12e7876d31a738389fecd517",
    5. "permissionState": {
    6. "deployAndCreate": 1,
    7. "node": 1,
    8. "sysConfig": 1,
    9. "cns": 1
    10. }
    11. }

    示例:

    1. curl -l -H "Content-type: application/json" -X POST -d '{"groupId": "2","fromAddress": "0x09fb217b6d7f010f12e7876d31a738389fecd517","address":"0x09fb217b6d7f010f12e7876d31a738389fecd517","permissionState": {"deployAndCreate": 1,"node": 1,"sysConfig": 1,"cns": 1}}' http://localhost:5002/WeBASE-Front/permission/sorted

    响应参数

    a、成功:

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": {
    5. "node": 1,
    6. "sysConfig": 1,
    7. "cns": 1,
    8. "deployAndCreate": 1
    9. }
    10. }

    b、失败:

    1. {
    2. "code": 201202,
    3. "message": "permission denied, please check chain administrator permission"
    4. }

    6.5. 查询CNS接口

    接口描述

    根据群组id和合约名(或合约名加版本)获取CNS的list列表。

    接口URL

    http://localhost:5002/WeBASE-Front/precompiled/cns/list?groupId={groupId}&contractNameAndVersion={contractNameAndVersion}&pageSize={pageSize}&pageNumber={pageNumber}

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组IDgroupIdint节点所属群组ID
    2合约名与版本contractNameAndVersionString版本非必填,合约名与版本中间用英文冒号”:”连接,版本号最长为40,由字母数字与”.”组成。无版本参数时返回全部版本
    3分页大小pageSizeint默认为10
    4分页页码pageNumberint默认为1

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/precompiled/cns/list?groupId=1&contractNameAndVersion=HelloWorld&pageSize=5&pageNumber=1

    响应参数

    1)数据格式

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": [
    5. {
    6. "name": "HelloWorld",
    7. "version": "2d36b8ed7ed12da01ed51cc0c85c3002085b17b6",
    8. "address": "0x2d36b8ed7ed12da01ed51cc0c85c3002085b17b6",
    9. "abi": "[{\"constant\":false,\"inputs\":[{\"indexed\":false,\"name\":\"n\",\"type\":\"string\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"indexed\":false,\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"constant\":false,\"inputs\":[{\"indexed\":false,\"name\":\"name\",\"type\":\"string\"}],\"name\":\"nameEvent\",\"payable\":false,\"type\":\"event\"}]"
    10. }
    11. ],
    12. "totalCount": 1
    13. }

    6.6. 查询系统配置接口

    接口描述

    根据群组id获取系统配置SystemConfig的list列表,目前只支持tx_count_limit, tx_gas_limit两个参数。

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组IDgroupIdint节点所属群组ID
    2分页大小pageSizeint默认为10
    3分页页码pageNumberint默认为1

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/sys/config/list?groupId=1&pageSize=5&pageNumber=1

    响应参数

    1)数据格式

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": [
    5. {
    6. "id": 6,
    7. "groupId": 1,
    8. "fromAddress": "0x",
    9. "configKey": "tx_gas_limit",
    10. "configValue": "300000000"
    11. },
    12. {
    13. "id": 5,
    14. "groupId": 1,
    15. "fromAddress": "0xd0b56b4ce0e8ce5e064f896d9ad1c16b2603f285",
    16. "configKey": "tx_count_limit",
    17. "configValue": "10002"
    18. }
    19. ],
    20. "totalCount": 2
    21. }

    6.7. 设置系统配置接口

    接口描述

    系统配置管理员设置系统配置,目前只支持tx_count_limit, tx_gas_limit两个参数。

    接口URL

    http://localhost:5002/WeBASE-Front/sys/config

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组IDgroupIdint节点所属群组ID
    2管理员地址fromAddressString
    3配置的键configKeyString目前类型两种(tx_count_limit, tx_gas_limit,用户可自定义key如tx_gas_price
    4配置的值configValueStringtx_gas_limit范围为 [100000, 2147483647]

    2)数据格式

    1. {
    2. "groupId": 1,
    3. "fromAddress": "0xd5bba8fe456fce310f529edecef902e4b63129b1",
    4. "configKey": "tx_count_limit",
    5. "configValue": "1001"
    6. }

    示例:

    1. curl -l -H "Content-type: application/json" -X POST -d '{"groupId": 1, "fromAddress": "0xd5bba8fe456fce310f529edecef902e4b63129b1", "configKey": "tx_count_limit", "configValue": "1001"}' http://10.0.0.1:5002/WeBASE-Front/sys/config

    响应参数

    a、成功:

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

    b、失败:

    1. {
    2. "code": -50000,
    3. "message": "permission denied"
    4. }

    6.8. 查询节点接口(节点管理)

    接口描述

    获取节点的list列表,列表包含节点id,节点共识状态。

    注:接口返回所有的共识/观察节点(无论运行或停止),以及正在运行的游离节点

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组IDgroupIdint节点所属群组ID
    2分页大小pageSizeint默认为10
    3分页页码pageNumberint默认为1

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/precompiled/consensus/list?groupId=1&pageSize=5&pageNumber=1

    响应参数

    1)数据格式

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": [
    5. {
    6. "nodeId": "13e0f2b94cbce924cc3737385a38587939e809fb786c4fc34a6ba3ea97693bccfa173b352ac41f1dbb97e9e4910ccbec1df38ad4020cef3b2044e833188adad9",
    7. "nodeType": "sealer"
    8. },
    9. {
    10. "nodeId": "bce4b2269c25c2cdba30155396bfe90af08c3c08cff205213477683117e4243ebe26588479519e636a5d5d93545cab778435cacacc41993f28f58f60fa5ceb72",
    11. "nodeType": "sealer"
    12. },
    13. {
    14. "nodeId": "e815cc5637cb8c3274c83215c680822e4a0110d0a8315fcf03e43e8e3944edd758c8b173c4e0076f599aa1f853fa207d47cc95d201ae8d0206b71ad5aa8c3f59",
    15. "nodeType": "sealer"
    16. }
    17. ],
    18. "totalCount": 3
    19. }

    6.9. 设置节点共识状态接口(节点管理)

    接口描述

    节点管理相关接口,可用于节点三种共识状态的切换。分别是共识节点sealer, 观察节点observer, 游离节点remove

    接口URL

    http://localhost:5002/WeBASE-Front/precompiled/consensus

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组IDgroupIdint节点所属群组ID
    2管理员地址fromAddressString
    3节点类型nodeTypeString节点类型:observer,sealer,remove
    4节点IDnodeIdString节点id,从节点根目录/conf/node.id获取

    2)数据格式

    1. {
    2. "groupId": 1,
    3. "fromAddress": "0xd5bba8fe456fce310f529edecef902e4b63129b1",
    4. "nodeType": "remove",
    5. "nodeId": "224e6ee23e8a02d371298b9aec828f77cc2711da3a981684896715a3711885a3177b3cf7906bf9d1b84e597fad1e0049511139332c04edfe3daddba5ed60cffa"
    6. }

    示例:

    1. curl -l -H "Content-type: application/json" -X POST -d '{"groupId": 1, "fromAddress": "0xd5bba8fe456fce310f529edecef902e4b63129b1", "configKey": "tx_count_limit", "configValue": "1001"}' http://10.0.0.1:5002/WeBASE-Front/sys/config

    响应参数

    a、成功:

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

    b、失败:

    1. {
    2. "code": -50000,
    3. "message": "permission denied"
    4. }

    6.10. CRUD表格操作接口

    接口描述

    用于操作用户表的CRUD操作,包含create, desc, insert, update, select, remove。

    具体sql要求语法参考Fisco-bcos技术文档的 Precompiled Crud API

    接口URL

    http://localhost:5002/WeBASE-Front/precompiled/crud

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组IDgroupIdint节点所属群组ID
    2管理员地址fromAddressString
    3SQL语句sqlString包含create, desc, insert, update, select, remove,小写

    2)数据格式

    1. {
    2. "groupId": 1,
    3. "fromAddress": "0xd5bba8fe456fce310f529edecef902e4b63129b1",
    4. "sql": "desc t_demo"
    5. }

    示例:

    1. curl -l -H "Content-type: application/json" -X POST -d '{"groupId": 1, "fromAddress": "0xd5bba8fe456fce310f529edecef902e4b63129b1", "sql": "desc t_demo"}' http://10.0.0.1:5002/WeBASE-Front/precompiled/crud

    响应参数

    a、成功:

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": {
    5. "tableName": "t_demo",
    6. "key": "name",
    7. "valueFields": "item_id,item_name",
    8. "optional": "",
    9. "entry": {
    10. "fields": {}
    11. },
    12. "condition": {
    13. "conditions": {}
    14. }
    15. }
    16. }

    b、失败:

    1. {
    2. "code": 2012228,
    3. "message": "table not exists",
    4. "data": "Table not exists "
    5. }

    6.11. 合约状态管理

    接口描述

    冻结、解冻合约和授权用户操作权限,还可以查询合约状态和合约用户权限列表

    接口URL

    调用方法

    HTTP POST

    请求参数

    1)入参表

    序号输入参数类型可为空备注
    1groupIdInt群组编号
    2signUserIdStringWeBASE-Sign签名用户编号,当handleTypegetStatuslistManager时,可不传
    3contractAddressString已部署的合约地址
    4handleTypeString操作类型:freeze-冻结;unfreeze-解冻;grantManager-授权;getStatus-查询合约状态;listManager-查询合约权限列表
    5grantAddressString授权用户地址,操作类型为grantManager时需传入

    2)入参示例

    1. {
    2. "contractAddress": "0x1d518bf3fb0edceb18519808edf7ad8adeeed792",
    3. "grantAddress": "",
    4. "groupId": 1,
    5. "handleType": "freeze",
    6. "signUserId": "user1001"
    7. }

    响应参数

    1)数据格式

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

    6.12. 基于角色的权限管理

    使用FISCO BCOS v2.5.0 与 WeBASE-Front v1.4.1 (及)以上版本将使用预编译合约中的ChainGovernance接口(本章节接口6.13),详情可参考

    包含链治理委员管理、链运维管理等功能

    6.12.1. 查看链治理委员列表

    接口描述

    委员的权限包括治理投票、增删节点、冻结解冻合约、冻结解冻账号、修改链配置和增删运维账号。

    增加委员需要链治理委员会投票,有效票大于阈值才可以生效,且不重复计票

    • 委员默认的投票权重为1,默认投票生效阈值50%,若有两个委员,则需要两个委员都投票增加/撤销的委员权限,有效票/总票数=2/2=1>0.5才满足条件。
    • 投票有过期时间,根据块高,过期时间为块高超过blockLimit的10倍时过期;过期时间固定不可改。‘

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)入参表

    序号输入参数类型可为空备注
    1groupIdInt群组编号

    2)入参示例

    1. http://localhost:5002/WeBASE-Front/governance/committee/list?groupId=1

    响应参数

    1)数据格式

    1. [
    2. {
    3. "address": "0xd031e61f6dc4dedd7d77f90128ed33caafbed0af",
    4. "enable_num": "2"
    5. }
    6. ]

    6.12.2. 增加链治理委员

    接口描述

    委员的权限包括治理投票、增删节点、冻结解冻合约、冻结解冻账号、修改链配置和增删运维账号。

    增加委员需要链治理委员会投票,有效票大于阈值才可以生效,且不重复计票

    • 委员默认的投票权重为1,默认投票生效阈值50%,若有两个委员,则需要两个委员都投票增加/撤销的委员权限,有效票/总票数=2/2=1>0.5才满足条件。
    • 投票有过期时间,根据块高,过期时间为块高超过blockLimit的10倍时过期;过期时间固定不可改。‘

    接口URL

    http://localhost:5002/WeBASE-Front/governance/committee

    调用方法

    HTTP POST

    请求参数

    1)入参表

    2)入参示例

    1. {
    2. "groupId": 1,
    3. "signUserId": "user1001",
    4. "address": "0x2357ad9d97027cd71eea1d639f1e5750fbdfd38e"
    5. }

    响应参数

    1)数据格式

    透传链上返回结果

    1. {
    2. "code":0,
    3. "msg":"success"
    4. }

    6.12.3. 取消链治理委员

    接口描述

    委员的权限包括治理投票、增删节点、冻结解冻合约、冻结解冻账号、修改链配置和增删运维账号。

    增加委员需要链治理委员会投票,有效票大于阈值才可以生效,且不重复计票

    • 委员默认的投票权重为1,默认投票生效阈值50%,若有两个委员,则需要两个委员都投票增加/撤销的委员权限,有效票/总票数=2/2=1>0.5才满足条件。
    • 投票有过期时间,根据块高,过期时间为块高超过blockLimit的10倍时过期;过期时间固定不可改。‘

    接口URL

    调用方法

    HTTP DELETE

    请求参数

    1)入参表

    序号输入参数类型可为空备注
    1groupIdInt群组编号
    2signUserIdStringWeBASE-Sign签名用户编号
    3addressString待取消的链治理委员地址

    2)入参示例

    1. {
    2. "groupId": 1,
    3. "signUserId": "user1001",
    4. "address": "0x2357ad9d97027cd71eea1d639f1e5750fbdfd38e"
    5. }

    响应参数

    1)数据格式

    透传链上返回结果

    1. {
    2. "code":0,
    3. "msg":"success"
    4. }

    6.12.4. 查看链治理委员投票权重

    接口描述

    委员默认的投票权重为1

    接口URL

    http://localhost:5002/WeBASE-Front/governance/committee/weight

    调用方法

    HTTP GET

    请求参数

    1)入参表

    序号输入参数类型可为空备注
    1groupIdInt群组编号
    2addressString链治理委员地址

    2)入参示例

    1. http://localhost:5002/WeBASE-Front/governance/committee/weight?groupId=1&address=0x009fb217b6d7f010f12e7876d31a738389fecd51

    响应参数

    1)数据格式

    成功时:直接返回权重值

    1. 2

    失败时,如查询非委员用户的权重值:

    1. {
    2. "code": -52001,
    3. "msg": "address not committee"
    4. }

    6.12.5. 更新链治理委员投票权重

    接口描述

    委员默认的投票权重为1

    接口URL

    调用方法

    HTTP PUT

    请求参数

    1)入参表

    序号输入参数类型可为空备注
    1groupIdInt群组编号
    2signUserIdStringWeBASE-Sign签名用户编号
    3addressString链治理委员地址
    4weightInt权重值

    2)入参示例

    1. {
    2. "groupId": 1,
    3. "signUserId": "user1001",
    4. "address": "0x2357ad9d97027cd71eea1d639f1e5750fbdfd38e",
    5. "weight": 2
    6. }

    响应参数

    1)数据格式

    透传链上返回结果

    6.12.6. 查看链投票阈值

    接口描述

    阈值默认为50,即票数>50%

    接口URL

    http://localhost:5002/WeBASE-Front/governance/threshold

    调用方法

    HTTP GET

    请求参数

    1)入参表

    序号输入参数类型可为空备注
    1groupIdInt群组编号

    2)入参示例

    1. http://localhost:5002/WeBASE-Front/governance/threshold?groupId=1

    响应参数

    1)数据格式

    直接返回threshold值

    1. 50

    6.12.7. 更新链投票阈值

    接口描述

    阈值默认为50,即票数>50%

    接口URL

    调用方法

    HTTP PUT

    请求参数

    1)入参表

    序号输入参数类型可为空备注
    1groupIdInt群组编号
    2signUserIdStringWeBASE-Sign签名用户编号
    3addressString新的链治理委员地址
    4thresholdInt群组投票阈值

    2)入参示例

    1. {
    2. "groupId": 1,
    3. "signUserId": "user1001",
    4. "address": "0x2357ad9d97027cd71eea1d639f1e5750fbdfd38e",
    5. "threshold": 60
    6. }

    响应参数

    1)数据格式

    透传链上返回结果

    1. {
    2. "code":0,
    3. "msg":"success"
    4. }

    接口描述

    由链治理委员添加运维账号,运维账号可以部署合约、创建表、管理合约版本、冻结解冻本账号部署的合约。

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)入参表

    序号输入参数类型可为空备注
    1groupIdInt群组编号

    2)入参示例

    1. http://localhost:5002/WeBASE-Front/governance/operator/list?groupId=1

    响应参数

    1)数据格式

    1. [
    2. {
    3. "address": "0x304852a7cc6511e62c37b6e189850861e41282b0",
    4. "enable_num": "3"
    5. }
    6. ]

    6.12.9. 增加运维接口

    接口描述

    由链治理委员添加运维账号,运维账号可以部署合约、创建表、管理合约版本、冻结解冻本账号部署的合约。

    接口URL

    调用方法

    HTTP POST

    请求参数

    1)入参表

    序号输入参数类型可为空备注
    1groupIdInt群组编号
    2signUserIdStringWeBASE-Sign签名用户编号
    3addressString新的运维地址

    2)入参示例

    1. {
    2. "groupId": 1,
    3. "signUserId": "user1001",
    4. "address": "0x2357ad9d97027cd71eea1d639f1e5750fbdfd38e"
    5. }

    响应参数

    1)数据格式

    透传链上返回结果

    1. {
    2. "code":0,
    3. "msg":"success"
    4. }

    6.12.10. 取消运维接口

    接口描述

    由链治理委员添加/取消运维账号;运维账号可以部署合约、创建表、管理合约版本、冻结解冻本账号部署的合约。 据块高,过期时间为块高超过blockLimit的10倍时过期;过期时间固定不可改。

    接口URL

    http://localhost:5002/WeBASE-Front/governance/operator

    调用方法

    HTTP DELETE

    请求参数

    1)入参表

    序号输入参数类型可为空备注
    1groupIdInt群组编号
    2signUserIdStringWeBASE-Sign签名用户编号
    3addressString待取消的运维地址

    2)入参示例

    1. {
    2. "groupId": 1,
    3. "signUserId": "user1001",
    4. "address": "0x2357ad9d97027cd71eea1d639f1e5750fbdfd38e"
    5. }

    响应参数

    1)数据格式

    透传链上返回结果

    1. {
    2. "code":0,
    3. "msg":"success"
    4. }

    7. 链上事件订阅接口

    7.1. 获取出块事件的订阅信息列表

    接口描述

    获取所有订阅的出块事件配置信息

    将返回对应的id值, exchange, queue, routingKey等信息

    接口URL

    http://localhost:5002/WeBASE-Front/event/newBlockEvent/list/{groupId}/{pageNumber}/{pageSize}

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组编号groupIdint群组编号
    2页码pageNumberint同时缺省则返回全量数据
    3页大小pageSizeint同时缺省则返回全量数据

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/event/newBlockEvent/list/{groupId}/{pageNumber}/{pageSize}

    响应参数

    1)数据格式

    成功:

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": [
    5. {
    6. "id": "8aba82b570f22a750170f22bcab90000",
    7. "eventType": 1,
    8. "appId": "app2",
    9. "groupId": 1,
    10. "exchangeName": "group001",
    11. "queueName": "app2",
    12. "routingKey": "app2_block_b63",
    13. "createTime": "2020-03-19 17:42:01"
    14. }
    15. ],
    16. "totalCount": 1
    17. }

    7.2. 获取出块事件的订阅信息

    接口描述

    根据群组编号,应用编号获取该应用订阅的出块事件配置信息

    将返回对应的id值, exchange, queue, routingKey等信息

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/event/newBlockEvent/{groupId}/{appId}

    响应参数

    1)数据格式

    成功:

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": [
    5. {
    6. "id": "8aba82b570f22a750170f22bcab90000",
    7. "eventType": 1,
    8. "appId": "app2",
    9. "groupId": 1,
    10. "exchangeName": "group001",
    11. "queueName": "app2",
    12. "routingKey": "app2_block_b63",
    13. "createTime": "2020-03-19 17:42:01"
    14. }
    15. ]
    16. }

    7.3. 订阅出块事件通知

    接口描述

    订阅后将在消息队列中获取出块的事件通知

    接口URL

    http://localhost:5002/WeBASE-Front/event/newBlockEvent

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1应用编号appIdString注册事件通知的应用的唯一编号,仅支持数字字母和下划线
    2所属群组groupIdInteger
    3交换机名字exchangeNameString队列所属交换机
    4队列名queueNameString队列名,以appId作队列名

    2)数据格式

    1. {
    2. "appId": "app1",
    3. "groupId": 1,
    4. "exchangeName": "group001",
    5. "queueName": "app1"
    6. }

    响应参数

    1)数据格式

    成功:

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

    失败(如:重复订阅)

    1. {
    2. "code": 201242,
    3. "errorMessage": "This data is already in db."
    4. }

    7.4. 取消订阅出块事件通知

    接口描述

    取消在消息队列中获取出块的事件通知的订阅

    接口URL

    调用方法

    HTTP DELETE

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1数据编号idString注册事件通知数据的唯一编号,可通过GET接口获取
    2应用编号appIdString注册事件通知的应用的唯一编号
    3所属群组groupIdInteger
    4交换机名字exchangeNameString队列所属交换机
    5队列名queueNameString队列名,以appId作队列名

    2)数据格式

    1. {
    2. "id":"8aba82b5707a1f5701707a248c340000",
    3. "appId": "app1",
    4. "groupId": 1,
    5. "exchangeName": "group001",
    6. "queueName": "app1"
    7. }

    响应参数

    1)数据格式

    成功:

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

    7.5. 获取合约Event事件订阅信息列表

    接口描述

    获取所有订阅的合约Event事件配置信息

    将返回对应的id值, exchange, queue, routingKey及合约Event配置内容(fromBlock, toBlock, contractAddress..)等信息

    接口URL

    http://localhost:5002/WeBASE-Front/event/contractEvent/list/{groupId}/{pageNumber}/{pageSize}

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组编号groupIdint群组编号
    2页码pageNumberint同时缺省则返回全量数据
    3页大小pageSizeint同时缺省则返回全量数据

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/event/contractEvent/list/{groupId}/{pageNumber}/{pageSize}

    响应参数

    1)数据格式

    成功:

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": [
    5. {
    6. "id": "8aba82b57076ae09017076ae403a0001",
    7. "eventType": 2,
    8. "appId": "app1",
    9. "groupId": 1,
    10. "exchangeName": "group001",
    11. "queueName": "app1",
    12. "routingKey": "app1_event_b3c",
    13. "contractAbi": "[{\"constant\":false,\"inputs\":[{\"name\":\"n\",\"type\":\"string\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"name\",\"type\":\"string\"}],\"name\":\"SetName\",\"type\":\"event\"}]",
    14. "fromBlock": "latest",
    15. "toBlock": "latest",
    16. "contractAddress": "0x657201d59ec41d1dc278a67916f751f86ca672f7",
    17. "topicList": "SetName(string)"
    18. }
    19. ],
    20. "totalCount":1
    21. }

    7.6. 获取合约Event事件订阅信息

    接口描述

    根据群组编号,应用编号获取该应用订阅的合约Event事件配置信息

    将返回对应的id值, exchange, queue, routingKey及合约Event配置内容(fromBlock, toBlock, contractAddress..)等信息

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/event/contractEvent/{groupId}/{appId}

    响应参数

    1)数据格式

    成功:

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": [
    5. {
    6. "id": "8aba82b57076ae09017076ae403a0001",
    7. "eventType": 2,
    8. "appId": "app1",
    9. "groupId": 1,
    10. "exchangeName": "group001",
    11. "queueName": "app1",
    12. "routingKey": "app1_event_b3c",
    13. "contractAbi": "[{\"constant\":false,\"inputs\":[{\"name\":\"n\",\"type\":\"string\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"name\",\"type\":\"string\"}],\"name\":\"SetName\",\"type\":\"event\"}]",
    14. "fromBlock": "latest",
    15. "toBlock": "latest",
    16. "contractAddress": "0x657201d59ec41d1dc278a67916f751f86ca672f7",
    17. "topicList": "SetName(string)",
    18. "createTime": "2020-02-26 16:21:12"
    19. }
    20. ]
    21. }

    7.7. 订阅合约event事件通知

    接口描述

    订阅后将在消息队列中获取相应智能合约的event事件通知

    接口URL

    http://localhost:5002/WeBASE-Front/event/contractEvent

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1应用编号appIdString注册事件通知的应用的唯一编号,仅支持数字字母和下划线
    2所属群组groupIdInteger
    3交换机名字exchangeNameString队列所属交换机
    4队列名queueNameString队列名,以appId作队列名
    5合约abicontractAbiList合约的ABI,用于合约event解析
    6event起始区块fromBlockString默认latest,表示一直监听最新区块,最小值为1
    7event末区块toBlockString最小值为1,最大值为当前区块高度,需 要大于等于fromBlock;填写latest,表示一直监听最新区块
    8合约地址contractAddressString合约地址
    9合约event列表topicListListList类型,合约Event事件列表,Event参数之间不带空格

    2)数据格式

    1. {
    2. "appId": "app2",
    3. "groupId": 1,
    4. "exchangeName": "group001",
    5. "queueName": "app2",
    6. "contractAbi": [{"constant":false,"inputs":[{"name":"n","type":"string"}],"name":"set","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"get","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"name","type":"string"}],"name":"SetName","type":"event"}],
    7. "fromBlock": "latest",
    8. "toBlock": "latest",
    9. "contractAddress": "0x657201d59ec41d1dc278a67916f751f86ca672f7",
    10. "topicList": ["SetName(string)","TransferEvent(string,address)"],
    11. "createTime": "2020-02-26 16:21:12"
    12. }

    响应参数

    1)数据格式

    成功:

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

    失败(如:重复订阅)

    1. {
    2. "code": 201242,
    3. "errorMessage": "This data is already in db."
    4. }

    7.8. 取消合约Event事件通知的订阅

    接口描述

    取消在消息队列中获取合约Event事件通知的订阅

    接口URL

    调用方法

    HTTP DELETE

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1数据编号idString注册事件通知数据的唯一编号,可通过GET接口获取
    2应用编号appIdString注册事件通知的应用的唯一编号
    3所属群组groupIdInteger
    4交换机名字exchangeNameString队列所属交换机
    5队列名queueNameString队列名,以appId作队列名

    2)数据格式

    1. {
    2. "id": "8aba82b57076ae09017076ae403a0001",
    3. "appId": "app2",
    4. "groupId": 1,
    5. "exchangeName": "group001",
    6. "queueName": "app2"
    7. }

    响应参数

    1)数据格式

    成功则返回该app中剩余已订阅的合约Event事件通知:

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

    7.9. 获取历史区块EventLog

    接口描述

    同步获取历史区块中的EventLog

    接口URL

    http://localhost:5002/WeBASE-Front/event/eventLogs/list

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1所属群组groupIdInteger
    2合约地址contractAddressString已部署合约
    3合约ABIcontractAbiList
    2Topic参数topicsEventTopicParamEventTopicParam包含{String eventName,IndexedParamType indexed1,IndexedParamType indexed2,IndexedParamType indexed3},其中IndexedParamType包含{String type,String value}。eventName为包含参数类型的event名,如SetEvent(uint256,string),IndexedParamType中type为indexed参数的类型,value为eventlog需要过滤的参数值
    2开始区块fromBlockInteger始块高
    2末区块toBlockInteger末块高

    2)数据格式

    1. {
    2. "groupId": "1",
    3. "contractAbi": [],
    4. "contractAddress": "0x19fb54101fef551187d3a79ea1c87de8d0ce754e",
    5. "fromBlock": 1,
    6. "toBlock": 1,
    7. "topics": {
    8. "eventName": "SetName(uint256,string)",
    9. "indexed1": {
    10. "type": "bool",
    11. "value": true
    12. },
    13. "indexed2": {
    14. "type": "string",
    15. "value": null
    16. }
    17. }
    18. }

    响应参数

    1)数据格式

    成功:

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": [{
    5. "log": {
    6. "logIndex": 0,
    7. "transactionIndex": 0,
    8. "transactionHash": "0x67c8d9a1bc62586b9feb0c8b1127bf0030f649771db3e3d0d99cd99209851ed8",
    9. "blockHash": "0x0ca880c70a3f24dc5e6052cca4dbb50d9aa0ec973474e07d82e2f5281c54e582",
    10. "blockNumber": 71,
    11. "address": "0xd5d4fcf2a46831510f095bfb447bc945f99309f7",
    12. "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000033132330000000000000000000000000000000000000000000000000000000000",
    13. "topics": ["0x4df9dcd34ae35f40f2c756fd8ac83210ed0b76d065543ee73d868aec7c7fcf02"]
    14. }, // `org.fisco.bcos.sdk.model.EventLog`,可参考java sdk
    15. "data": ["123"]
    16. }, {
    17. "log": {
    18. "logIndex": 0,
    19. "transactionIndex": 0,
    20. "transactionHash": "0x7c27078b372cee951dd102edcbbeab6b3b799212e4337d6bfac7f723e487a1fb",
    21. "blockHash": "0x47f8456a656f226d5a4a7206790ae864ae4fb645bca625b87cf0378ecca7e742",
    22. "blockNumber": 72,
    23. "address": "0xd5d4fcf2a46831510f095bfb447bc945f99309f7",
    24. "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000033333330000000000000000000000000000000000000000000000000000000000",
    25. "topics": ["0x4df9dcd34ae35f40f2c756fd8ac83210ed0b76d065543ee73d868aec7c7fcf02"]
    26. },
    27. "data": ["333"]
    28. }],
    29. "totalCount": 1
    30. }

    7.10. 获取ABI与合约所有合约信息

    接口描述

    获取导入的ABI与IDE中已部署合约所有合约的地址、合约名字信息

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/event/listAddress/{groupId}

    响应参数

    1)数据格式

    成功:

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": [{
    5. "type": "contract",
    6. "contractAddress": "0x88156d500422a542435616e5a1e9d2df44c7fc70",
    7. "contractName": "Hello3"
    8. }, {
    9. "type": "contract",
    10. "contractAddress": "0xc2b3b552258b6016f80a070c1aa91bf9e3c48c53",
    11. "contractName": "Hello3"
    12. }, {
    13. "type": "abi",
    14. "contractAddress": "0x7a754bb46418c93b4cec7dcc6fef0676ae6a1e32",
    15. "contractName": "Hello3"
    16. }]
    17. }

    7.11. 根据地址获取ABI与合约的合约信息

    接口描述

    根据合约地址、合约类型(abicontract)获取导入的ABI与IDE中已部署合约的合约地址、合约名字信息

    接口URL

    http://localhost:5002/WeBASE-Front/event/contractInfo/{groupId}/{type}/{contractAddress}

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1所属群组groupIdInteger
    2合约类型typeString包含contract(IDE部署)和abi(ABI管理导入)两种类型
    3合约地址contractAddressString

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/event/contractInfo/{groupId}/{type}/{contractAddress}

    响应参数

    1)数据格式

    成功:

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": {
    5. "abiId": 1,
    6. "groupId": 1,
    7. "contractName": "Hello3",
    8. "contractAddress": "0x7a754bb46418c93b4cec7dcc6fef0676ae6a1e32",
    9. "contractAbi": "",
    10. "contractBin": "",
    11. "createTime": "2020-11-06 15:12:51",
    12. "modifyTime": "2020-11-06 15:12:51"
    13. }
    14. }

    8. Abi管理接口

    8.1. 获取Abi信息

    接口描述

    根据abiId获取abi信息

    接口URL

    http://localhost:5002/WeBASE-Front/abi/{abiId}

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/abi/{abiId}

    响应参数

    1)数据格式

    a、成功:

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": {
    5. "abiId": 1,
    6. "groupId": 1,
    7. "contractName": "TTT",
    8. "contractAddress": "0x3214227e87bccca63893317febadd0b51ade735e",
    9. "contractAbi": "[{\"constant\":false,\"inputs\":[{\"name\":\"n\",\"type\":\"string\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"n\",\"type\":\"string\"}],\"name\":\"setSender\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"name\",\"type\":\"string\"}],\"name\":\"SetName\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"\",\"type\":\"uint256[2]\"}],\"name\":\"EventList\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SetSender\",\"type\":\"event\"}]",
    10. "contractBin": "608060405260043610610057576000357...",
    11. "createTime": "2020-05-18 10:59:02",
    12. "modifyTime": "2020-05-18 10:59:02"
    13. }
    14. }

    8.2. 获取Abi信息分页列表

    接口描述

    获取abi信息的列表

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1群组idgroupIdint群组编号
    2页码pageNumberint
    3页大小pageSizeint

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/abi/list/{groupId}/{pageNumber}/{pageSize}

    响应参数

    1)数据格式

    a、成功:

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": [
    5. {
    6. "abiId": 1,
    7. "groupId": 1,
    8. "contractName": "TTT",
    9. "contractAddress": "0x3214227e87bccca63893317febadd0b51ade735e",
    10. "contractAbi": "[{\"constant\":false,\"inputs\":[{\"name\":\"n\",\"type\":\"string\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"n\",\"type\":\"string\"}],\"name\":\"setSender\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"name\",\"type\":\"string\"}],\"name\":\"SetName\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"\",\"type\":\"uint256[2]\"}],\"name\":\"EventList\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SetSender\",\"type\":\"event\"}]",
    11. "contractBin": "608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463fffff...29",
    12. "createTime": "2020-05-18 10:59:02",
    13. "modifyTime": "2020-05-18 10:59:02"
    14. }
    15. ],
    16. "totalCount": 1
    17. }

    8.3. 导入已部署合约的abi

    接口描述

    将其他平台已部署的合约导入到本平台进行管理

    接口URL

    http://localhost:5002/WeBASE-Front/abi

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1所属群组groupIdInteger
    2合约地址contractAddressString合约地址
    3合约名contractNameString
    4合约abicontractAbiList合约的ABI

    2)数据格式

    1. {
    2. "groupId": 1,
    3. "contractAddress": "0x3214227e87bccca63893317febadd0b51ade735e",
    4. "contractName": "HelloWorld",
    5. "contractAbi": [{"constant":false,"inputs":[{"name":"n","type":"string"}],"name":"set","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"get","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"name","type":"string"}],"name":"SetName","type":"event"}]
    6. }

    响应参数

    1)数据格式

    成功:

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

    8.4. 修改已导入的合约abi

    接口描述

    更新已导入的合约abi内容

    接口URL

    调用方法

    HTTP PUT

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1abi编号abiIdLong
    2所属群组groupIdInteger
    3合约地址contractAddressString合约地址
    4合约名contractNameString
    5合约abicontractAbiList合约的ABI

    2)数据格式

    1. {
    2. "abiId": 1,
    3. "groupId": 1,
    4. "contractAddress": "0x3214227e87bccca63893317febadd0b51ade735e",
    5. "contractName": "HelloWorld",
    6. "contractAbi": [{"constant":false,"inputs":[{"name":"n","type":"string"}],"name":"set","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"get","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"name","type":"string"}],"name":"SetName","type":"event"}]
    7. }

    响应参数

    1)数据格式

    成功:

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

    8.5. 修改合约abi

    接口描述

    删除合约abi

    接口URL

    http://localhost:5002/WeBASE-Front/abi/{abiId}

    调用方法

    HTTP DELETE

    请求参数

    1)参数表

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

    2)数据格式

    1. {
    2. "abiId": 1
    3. }

    响应参数

    1)数据格式

    成功:

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

    9.1. 获取网络统计日志数据

    接口描述

    ​ 统计日志数据存储在H2数据库,默认存储一万条,超过将不会从节点日志文件拉取新的数据。此时,获取完现有数据,可以调用8.3 删除统计日志数据进行删除,数据量少于一万条时,自动从节点日志文件拉取新的数据。

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)入参表

    序号输入参数类型可为空备注
    1groupIdInt群组编号
    2pageSizeInt条数,默认10
    3pageNumberInt页码,默认1
    4beginDateLocalDateTime开始时间(yyyy-MM-dd’T’HH:mm:ss.SSS 2019-03-13T00:00:00)
    5endDateLocalDateTime结束时间

    2)入参示例

    1. http://localhost:5002/WeBASE-Front/charging/getNetWorkData?groupId=1&pageSize=2&pageNumber=1&beginDate=2020-03-27T10:30:04&endDate=2020-03-27T17:30:04

    响应参数

    1)出参表

    序号输出参数类型备注
    1codeInt返回码,0:成功 其它:失败
    2messageString描述
    3totalCountInt总记录数
    4dataList列表
    4.1Object信息对象
    4.1.1idLong主键
    4.1.2groupIdInt群组编号
    4.1.3totalInLong总入流量(P2P_InBytes + SDK_InBytes)
    4.1.4totalOutLong总出流量(P2P_OutBytes + SDK_OutBytes)
    4.1.5timestampLong统计时间

    2)出参示例

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": [
    5. {
    6. "id": 583,
    7. "totalIn": 53837,
    8. "totalOut": 54753,
    9. "groupId": 1,
    10. "timestamp": 1585277486000
    11. },
    12. {
    13. "id": 581,
    14. "totalIn": 55128,
    15. "totalOut": 55092,
    16. "groupId": 1,
    17. "timestamp": 1585277426000
    18. }
    19. ],
    20. "totalCount": 22
    21. }

    9.2. 获取交易Gas统计日志数据

    接口描述

    ​ 统计日志数据存储在H2数据库,默认存储一万条,超过将不会从节点日志文件拉取新的数据。此时,获取完现有数据,可以调用8.3 删除统计日志数据进行删除,数据量少于一万条时,自动从节点日志文件拉取新的数据。

    接口URL

    1. http://localhost:5002/WeBASE-Front/charging/getTxGasData?groupId={groupId}&pageSize={pageSize}&pageNumber={pageNumber}&beginDate={beginDate}&endDate={endDate}&transHash={transHash}

    调用方法

    HTTP GET

    请求参数

    1)入参表

    序号输入参数类型可为空备注
    1groupIdInt群组编号
    2pageSizeInt条数,默认10
    3pageNumberInt页码,默认1
    4beginDateLocalDateTime开始时间(yyyy-MM-dd’T’HH:mm:ss.SSS 2019-03-13T00:00:00)
    5endDateLocalDateTime结束时间
    6transHashString交易hash,不为空时查询指定hash

    2)入参示例

    1. http://localhost:5002/WeBASE-Front/charging/getTxGasData?groupId=1&pageSize=2&pageNumber=1&beginDate=2020-03-27T10:30:04&endDate=2020-03-27T17:30:04

    响应参数

    1)出参表

    序号输出参数类型备注
    1codeInt返回码,0:成功 其它:失败
    2messageString描述
    3totalCountInt总记录数
    4dataList列表
    4.1Object信息对象
    4.1.1idLong主键
    4.1.2groupIdInt群组编号
    4.1.3transHashLong交易hash
    4.1.4gasUsedLong交易消耗的gas
    4.1.5timestampLong统计时间

    2)出参示例

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": [
    5. {
    6. "id": 5,
    7. "transHash": "c5e208ec70b899529e11311f1147b1ee24ab8f02301e6cdbe8252c77a89a0d4c",
    8. "gasUsed": 34949,
    9. "groupId": 1,
    10. "timestamp": 1585277499000
    11. },
    12. {
    13. "id": 4,
    14. "transHash": "d9d7800554b68c84a53e54eef8adceecca891dd0dd7e0069a3474a81d4eac440",
    15. "gasUsed": 44892,
    16. "groupId": 1,
    17. "timestamp": 1585277489000
    18. }
    19. ],
    20. "totalCount": 5
    21. }

    9.3. 删除统计日志数据

    接口描述

    ​ 统计日志数据存储在H2数据库,默认存储一万条,超过将不会从节点日志文件拉取新的数据。此时,获取完现有数据,可以调用当前接口进行删除,数据量少于一万条时,自动从节点日志文件拉取新的数据。

    接口URL

    http://localhost:5002/WeBASE-Front/charging/deleteData?groupId={groupId}&type={type}&keepEndDate={keepEndDate}

    调用方法

    HTTP DELETE

    请求参数

    1)入参表

    序号输入参数类型可为空备注
    1groupIdInt群组编号
    2typeInt删除数据类型(1-网络统计数据;2-交易gas数据)
    3keepEndDateLocalDateTime保留截止时间(yyyy-MM-dd’T’HH:mm:ss.SSS 2019-03-13T00:00:00)

    2)入参示例

    1. http://localhost:5002/WeBASE-Front/charging/deleteData?groupId=1&type=1&keepEndDate=2020-03-27T10:30:04

    响应参数

    1)出参表

    序号输出参数类型备注
    1codeInt返回码,0:成功 其它:失败
    2messageString描述
    3dataInt处理条数

    2)出参示例

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

    10. 其他接口

    10.1. 查询是否使用国密

    接口描述

    获取WeBASE-Front的encryptType,即是否使用国密版;

    接口URL

    http://localhost:5002/WeBASE-Front/encrypt

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/encrypt

    响应参数

    1)数据格式

    a、成功:

    1. {
    2. 1 // 1: 国密版,0: 非国密
    3. }

    10.2. 查询WeBASE-Front版本

    接口描述

    获取WeBASE-Front的版本号

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/version

    响应参数

    1)数据格式

    a、成功:

    1. v1.4.0

    10.3. 查询前置连接的WeBASE-Sign版本

    接口描述

    获取WeBASE-Front的所连接的WeBASE-Sign的版本号

    接口URL

    http://localhost:5002/WeBASE-Front/version/sign

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/version/sign

    响应参数

    1)数据格式

    a、成功:

    1. v1.4.0

    10.4. 查询前置包含的solidity v0.6.10文件

    接口描述

    获取WeBASE-Front的本地conf/solcjs中包含的solidity 0.6.10的js文件列表

    如需要使用solidity 0.6.10,则需要手动下载CDN中solidity的v0.6.10.js(国密v0.6.10-gm.js),并在WeBASE-Front的conf文件夹中创建solcjs文件夹,并将js文件复制到该文件夹。

    注:使用webase-front.zip安装包直接部署则不需要手动放置js文件

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/solc/list

    响应参数

    1)数据格式

    a、成功:

    1. {
    2. "code":0,
    3. "message":"success",
    4. "data":["v0.6.10.js","v0.6.10-gm.js"]
    5. }

    11. 工具类接口

    11.1. 解析Input/Output工具接口

    接口描述

    根据合约ABI,解析交易回执中返回的input/output值

    接口URL

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1解析类型decodeTypeint1-解析input,2-解析output
    2方法名methodNameStringinput或output对应的合约方法名,如set, newEvidence
    3交易输入inputString交易输入值
    4交易输出outputString交易输出值
    5合约ABIabiListList合约ABI列表

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/tool/decode

    解析output

    1. {
    2. "abiList": [{"constant":true,"inputs":[{"name":"index","type":"uint256"}],"name":"getSigner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getSigners","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getSignersSize","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"verify","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"evi","type":"string"}],"name":"newEvidence","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"}],"name":"addSignatures","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getEvidence","outputs":[{"name":"","type":"string"},{"name":"","type":"address[]"},{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"evidenceSigners","type":"address[]"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"addr","type":"address"}],"name":"newEvidenceEvent","type":"event"}],
    3. "decodeType": 1,
    4. "input": "0xa12bb1d8000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000097465737431323131320000000000000000000000000000000000000000000000",
    5. "methodName": "newEvidence",
    6. "output": "0x000000000000000000000000e9d0a146298b2454a26f43adb81f800ccf98b947"
    7. }

    响应参数

    1)数据格式

    a、成功:

    解析output,返回newEvidence方法的返回值

    1. {
    2. "[0xe9d0a146298b2454a26f43adb81f800ccf98b947]": [
    3. {
    4. "name": "",
    5. "type": "VALUE",
    6. "valueType": "ADDRESS",
    7. "numericValue": null,
    8. "bytesValue": null,
    9. "bytesLength": 0,
    10. "addressValue": {
    11. "value": "0xe9d0a146298b2454a26f43adb81f800ccf98b947",
    12. "typeAsString": "address"
    13. },
    14. "boolValue": null,
    15. "dynamicBytesValue": null,
    16. "stringValue": null,
    17. "listType": null,
    18. "listValues": null,
    19. "listLength": 0,
    20. "listValueType": null,
    21. "structFields": null,
    22. "dynamic": false
    23. }
    24. ]
    25. }

    解析input,返回input的输入值

    1. test12112

    11.2. 获取公私钥对

    接口描述

    传入私钥时,返回对应的公私钥对;不传入私钥时,返回随机私钥对

    接口URL

    http://localhost:5002/WeBASE-Front/tool/keypair

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1私钥值privateKeyString为空时,返回随机私钥对,BigInteger的HexString格式(十六进制)

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/tool/keypair
    1. {
    2. "privateKey": "a81dfd0d3b1004d6635e099aeddd0e939481081372d791b0c477bb21c663105d"
    3. }

    响应参数

    1)数据格式

    a、成功:

    1. {
    2. "privateKey": "a81dfd0d3b1004d6635e099aeddd0e939481081372d791b0c477bb21c663105d",
    3. "publicKey": "0xaa95cfddb68f6e583a204e479536ac2d6f8fba254ef08cfad82aa48b1d9eadd58314d7cbd3c0a8461b68219577ee511e84c630a0df252afa35bd86aa12f1ebff",
    4. "address": "988f01939de8797789ea4889e39a7039af9f4c11",
    5. "encryptType": 0 // 0-ecdsa, 1-sm2
    6. }

    11.3. 根据公钥获取地址

    接口描述

    根据公钥获取地址

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1公钥值publicKeyStringBigInteger的HexString格式(十六进制)

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/tool/address?publicKey=0xaa95cfddb68f6e583a204e479536ac2d6f8fba254ef08cfad82aa48b1d9eadd58314d7cbd3c0a8461b68219577ee511e84c630a0df252afa35bd86aa12f1ebff

    响应参数

    1)数据格式

    a、成功:

    1. {
    2. "publicKey": "0xaa95cfddb68f6e583a204e479536ac2d6f8fba254ef08cfad82aa48b1d9eadd58314d7cbd3c0a8461b68219577ee511e84c630a0df252afa35bd86aa12f1ebff",
    3. "address": "988f01939de8797789ea4889e39a7039af9f4c11",
    4. "encryptType": 0 // 0-ecdsa, 1-sm2
    5. }

    11.4. 获取哈希值

    接口描述

    获取哈希值

    接口URL

    http://localhost:5002/WeBASE-Front/tool/hash?input={123}&type={type}

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1输入值inputString待哈希的输入值
    2入参类型typeint默认为1,1-hexString十六进制字符串,2-UTF8字符串

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/tool/hash??input=123&type=1

    响应参数

    1)数据格式

    a、成功:

    type=1,入参为Hex String时:

    1. {
    2. "hashValue": "0x667d3611273365cfb6e64399d5af0bf332ec3e5d6986f76bc7d10839b680eb58",
    3. "encryptType": 0
    4. }

    type=2,入参为UTF8类型时:

    1. {
    2. "hashValue": "0x64e604787cbf194841e7b68d7cd28786f6c9a0a3ab9f8b0a0e87cb4387ab0107",
    3. "encryptType": 0
    4. }

    11.5. String转bytes32类型

    接口描述

    UTF8字符串或HexString字符串转为solidity中的bytes32类型

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1输入值inputString待转换的输入值
    2入参类型typeint默认为1,1-hexString十六进制字符串,2-UTF8字符串

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/tool/utf8ToHexString??input=123&type=1

    响应参数

    1)数据格式

    a、成功:

    type=1,入参为Hex String时:

    1. 0x0123000000000000000000000000000000000000000000000000000000000000

    type=2,入参为UTF8类型时:

    1. 0x3132330000000000000000000000000000000000000000000000000000000000

    11.6. UTF8字符串转十六进制

    接口描述

    UTF8字符串转为HexString十六进制(无0x开头)

    接口URL

    http://localhost:5002/WeBASE-Front/tool/utf8ToHexString?input={input}

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1输入值inputString待转换的输入值

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/tool/utf8ToHexString??input=123

    响应参数

    1)数据格式

    a、成功:

    1. 313233

    11.7. 获取指定私钥签名后的内容

    接口描述

    UTF8字符串转为HexString十六进制(无0x开头)

    接口URL

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1私钥值privateKeyString
    2待签名的值rawDataString

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/tool/signMsg
    1. {
    2. "privateKey ": "1",
    3. "rawData ": "123"
    4. }

    响应参数

    1)数据格式

    a、成功:

    1. {
    2. "signatureData": {
    3. "v": 28,
    4. "r": "igg6XONxOgnO5DBlbyZo2E12T13ZSMxdoiZBF06N6Vs=",
    5. "s": "G0mFLQfCH+5yKEEROkGLRH8FROTnSbYEYmpkEqsasxU=",
    6. "pub": null
    7. },
    8. "encryptType": 0
    9. }

    11.8. 获取.pem私钥的内容

    接口描述

    传入.pem私钥,获取其值

    接口URL

    http://localhost:5002/WeBASE-Front/tool/decodePem

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1.pem私钥文件pemFileMultipartFile

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/tool/decodePem

    form-data入参

    1. {
    2. "pemFile ":
    3. }

    响应参数

    1)数据格式

    a、成功:

    1. {
    2. "privateKey": "9b71fd37075dc2bb5d6c24145bfcbc12ae44df544cf67f067f3230ca22ccbd",
    3. "publicKey": "0x7bc349e6d8be4df636f09ece0290eb18fa3bc5fb37a79846894dcb414b5714eb50f522a6d7e9d762ad49d0718dbaca462bb4f44c81b27598b3ea6df1ef9b6fa0",
    4. "address": "4d400652406daabb315cece1e5f8b48020679aa2",
    5. "encryptType": 0
    6. }

    11.9. 获取.p12私钥的内容

    接口描述

    传入.p12私钥,获取其值

    接口URL

    调用方法

    HTTP POST

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1.p12私钥文件p12FileMultipartFile
    2.p12私钥密码p12PasswordString.p12私钥的密码默认””空字符串

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/tool/decodeP12

    form-data入参

    1. {
    2. "p12File ": ,
    3. "p12Password": ""
    4. }

    响应参数

    1)数据格式

    a、成功:

    1. {
    2. "privateKey": "9b71fd37075dc2bb5d6c24145bfcbc12ae44df544cf67f067f3230ca22ccbd",
    3. "publicKey": "0x7bc349e6d8be4df636f09ece0290eb18fa3bc5fb37a79846894dcb414b5714eb50f522a6d7e9d762ad49d0718dbaca462bb4f44c81b27598b3ea6df1ef9b6fa0",
    4. "address": "4d400652406daabb315cece1e5f8b48020679aa2",
    5. "encryptType": 0
    6. }

    12. 合约仓库

    12.1. 获取合约仓库列表

    接口描述

    返回合约仓库信息列表

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/contractStore/getContractStoreList

    响应参数

    1)数据格式

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": [
    5. {
    6. "storeId": 1,
    7. "storeName": "工具箱",
    8. "storeName_en": "Toolbox",
    9. "storeType": "1",
    10. "storeIcon": "toolboxId",
    11. "storeDesc": "工具箱中有常用的工具合约",
    12. "storeDetail": "工具箱中有常用的工具合约",
    13. "storeDesc_en": "Toolbox Contract suite",
    14. "storeDetail_en": "Toolbox Contract suite",
    15. "createTime": "2021-01-20 18:02:10",
    16. "modifyTime": "2021-01-20 18:02:10"
    17. },
    18. {
    19. "storeId": 2,
    20. "storeName": "存证应用",
    21. "storeName_en": "Evidence",
    22. "storeType": "2",
    23. "storeIcon": "evidenceId",
    24. "storeDesc": "一套区块链存证合约",
    25. "storeDetail": "一套区块链存证合约",
    26. "storeDesc_en": "Evidence Contract suite",
    27. "storeDetail_en": "Evidence Contract suite",
    28. "createTime": "2021-01-20 18:02:10",
    29. "modifyTime": "2021-01-20 18:02:10"
    30. },
    31. {
    32. "storeId": 3,
    33. "storeName": "积分应用",
    34. "storeName_en": "Points",
    35. "storeType": "3",
    36. "storeIcon": "pointsId",
    37. "storeDesc": "一套积分合约",
    38. "storeDetail": "一套积分合约",
    39. "storeDesc_en": "Points Contract suite",
    40. "storeDetail_en": "Points Contract suite",
    41. "createTime": "2021-01-20 18:02:10",
    42. "modifyTime": "2021-01-20 18:02:10"
    43. }
    44. ]
    45. }

    12.2. 根据仓库编号获取仓库信息

    接口描述

    返回合约仓库信息

    接口URL

    http://localhost:5002/WeBASE-Front/contractStore/getContractFolderById/{storeId}

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1仓库编号storeIdint

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/contractStore/getContractStoreById/1

    响应参数

    1)数据格式

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": {
    5. "storeId": 1,
    6. "storeName": "工具箱",
    7. "storeName_en": "Toolbox",
    8. "storeType": "1",
    9. "storeIcon": "toolboxId",
    10. "storeDesc": "工具箱中有常用的工具合约",
    11. "storeDetail": "工具箱中有常用的工具合约",
    12. "storeDesc_en": "Toolbox Contract suite",
    13. "storeDetail_en": "Toolbox Contract suite",
    14. "createTime": "2021-01-20 18:02:10",
    15. "modifyTime": "2021-01-20 18:02:10"
    16. }
    17. }

    12.3. 根据仓库编号获取合约文件夹信息

    接口描述

    返回合约文件夹信息

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1仓库编号storeIdint

    2)数据格式

    1. http://localhost:5002/WeBASE-Front/contractStore/getFolderItemListByStoreId/2

    响应参数

    1)数据格式

    1. {
    2. "code": 0,
    3. "message": "success",
    4. "data": [
    5. {
    6. "contractFolderId": 2,
    7. "storeId": 2,
    8. "contractFolderName": "Evidence",
    9. "contractFolderDesc": "Evidence",
    10. "contractFolderDetail": "Evidence",
    11. "contractFolderDesc_en": "Evidence",
    12. "contractFolderDetail_en": "Evidence",
    13. "createTime": "2021-01-20 18:02:10",
    14. "modifyTime": "2021-01-20 18:02:10"
    15. }
    16. }

    12.4. 根据合约文件夹编号获取合约文件夹信息

    接口描述

    返回合约文件夹信息

    接口URL

    http://localhost:5002/WeBASE-Front/contractStore/getContractFolderById/{contractFolderId}

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1合约文件夹编号contractFolderIdint

    2)数据格式

    http://localhost:5002/WeBASE-Front/contractStore/getContractFolderById/2
    

    响应参数

    1)数据格式

    {
      "code": 0,
      "message": "success",
      "data": {
        "contractFolderId": 2,
        "storeId": 2,
        "contractFolderName": "Evidence",
        "contractFolderDesc": "Evidence",
        "contractFolderDetail": "Evidence",
        "contractFolderDesc_en": "Evidence",
        "contractFolderDetail_en": "Evidence",
        "createTime": "2021-01-20 18:02:10",
        "modifyTime": "2021-01-20 18:02:10"
      }
    }
    

    12.5. 根据文件夹编号获取合约列表

    接口描述

    返回合约信息列表

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1文件夹编号folderIdint

    2)数据格式

    http://localhost:5002/WeBASE-Front/contractStore/getContractItemByFolderId/2
    

    响应参数

    1)数据格式

    {
      "code": 0,
      "message": "success",
      "data": [
        {
          "contractId": 4,
          "contractFolderId": 2,
          "contractName": "Evidence",
          "contractDesc": "Evidence",
          "contractSrc": "cHJhZ21hIHNvbGlkaXR5IF4wLjQuNDsKY29udHJhY3QgRXZpZGVuY2VTaWduZXJzRGF0YUFCSXsgZnVuY3Rpb24gdmVyaWZ5KGFkZHJlc3MgYWRkcilwdWJsaWMgY29uc3RhbnQgcmV0dXJucyhib29sKXt9CmZ1bmN0aW9uIGdldFNpZ25lcih1aW50IGluZGV4KXB1YmxpYyBjb25zdGFudCByZXR1cm5zKGFkZHJlc3Mpe30gCmZ1bmN0aW9uIGdldFNpZ25lcnNTaXplKCkgcHVibGljIGNvbnN0YW50IHJldHVybnModWludCl7fQp9Cgpjb250cmFjdCBFdmlkZW5jZXsKICAgIAogICAgc3RyaW5nIGV2aWRlbmNlOwogICAgc3RyaW5nIGV2aWRlbmNlSW5mbzsKICAgIHN0cmluZyBldmlkZW5jZUlkOwogICAgdWludDhbXSBfdjsKICAgIGJ5dGVzMzJbXSBfcjsKICAgIGJ5dGVzMzJbXSBfczsKICAgIGFkZHJlc3NbXSBzaWduZXJzOwogICAgYWRkcmVzcyBwdWJsaWMgc2lnbmVyc0FkZHI7CiAgICAKICAgICAgICBldmVudCBhZGRTaWduYXR1cmVzRXZlbnQoc3RyaW5nIGV2aSwgc3RyaW5nIGluZm8sIHN0cmluZyBpZCwgdWludDggdiwgYnl0ZXMzMiByLCBieXRlczMyIHMpOwogICAgICAgIGV2ZW50IG5ld1NpZ25hdHVyZXNFdmVudChzdHJpbmcgZXZpLCBzdHJpbmcgaW5mbywgc3RyaW5nIGlkLCB1aW50OCB2LCBieXRlczMyIHIsIGJ5dGVzMzIgcyxhZGRyZXNzIGFkZHIpOwogICAgICAgIGV2ZW50IGVycm9yTmV3U2lnbmF0dXJlc0V2ZW50KHN0cmluZyBldmksIHN0cmluZyBpbmZvLCBzdHJpbmcgaWQsIHVpbnQ4IHYsIGJ5dGVzMzIgciwgYnl0ZXMzMiBzLGFkZHJlc3MgYWRkcik7CiAgICAgICAgZXZlbnQgZXJyb3JBZGRTaWduYXR1cmVzRXZlbnQoc3RyaW5nIGV2aSwgc3RyaW5nIGluZm8sIHN0cmluZyBpZCwgdWludDggdiwgYnl0ZXMzMiByLCBieXRlczMyIHMsYWRkcmVzcyBhZGRyKTsKICAgICAgICBldmVudCBhZGRSZXBlYXRTaWduYXR1cmVzRXZlbnQoc3RyaW5nIGV2aSwgc3RyaW5nIGluZm8sIHN0cmluZyBpZCwgdWludDggdiwgYnl0ZXMzMiByLCBieXRlczMyIHMpOwogICAgICAgIGV2ZW50IGVycm9yUmVwZWF0U2lnbmF0dXJlc0V2ZW50KHN0cmluZyBldmksIHN0cmluZyBpZCwgdWludDggdiwgYnl0ZXMzMiByLCBieXRlczMyIHMsIGFkZHJlc3MgYWRkcik7CgogICAgZnVuY3Rpb24gQ2FsbFZlcmlmeShhZGRyZXNzIGFkZHIpIHB1YmxpYyBjb25zdGFudCByZXR1cm5zKGJvb2wpIHsKICAgICAgICByZXR1cm4gRXZpZGVuY2VTaWduZXJzRGF0YUFCSShzaWduZXJzQWRkcikudmVyaWZ5KGFkZHIpOwogICAgfQoKICAgICAgIGZ1bmN0aW9uIEV2aWRlbmNlKHN0cmluZyBldmksIHN0cmluZyBpbmZvLCBzdHJpbmcgaWQsIHVpbnQ4IHYsIGJ5dGVzMzIgciwgYnl0ZXMzMiBzLCBhZGRyZXNzIGFkZHIsIGFkZHJlc3Mgc2VuZGVyKSBwdWJsaWMgewogICAgICAgc2lnbmVyc0FkZHIgPSBhZGRyOwogICAgICAgaWYoQ2FsbFZlcmlmeShzZW5kZXIpKQogICAgICAgewogICAgICAgICAgIGV2aWRlbmNlID0gZXZpOwogICAgICAgICAgIGV2aWRlbmNlSW5mbyA9IGluZm87CiAgICAgICAgICAgZXZpZGVuY2VJZCA9IGlkOwogICAgICAgICAgIF92LnB1c2godik7CiAgICAgICAgICAgX3IucHVzaChyKTsKICAgICAgICAgICBfcy5wdXNoKHMpOwogICAgICAgICAgIHNpZ25lcnMucHVzaChzZW5kZXIpOwogICAgICAgICAgIG5ld1NpZ25hdHVyZXNFdmVudChldmksaW5mbyxpZCx2LHIscyxhZGRyKTsKICAgICAgIH0KICAgICAgIGVsc2UKICAgICAgIHsKICAgICAgICAgICBlcnJvck5ld1NpZ25hdHVyZXNFdmVudChldmksaW5mbyxpZCx2LHIscyxhZGRyKTsKICAgICAgIH0KICAgIH0KCiAgICAgICAgZnVuY3Rpb24gZ2V0RXZpZGVuY2VJbmZvKCkgcHVibGljIGNvbnN0YW50IHJldHVybnMoc3RyaW5nKXsKICAgICAgICAgICAgcmV0dXJuIGV2aWRlbmNlSW5mbzsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRFdmlkZW5jZSgpIHB1YmxpYyBjb25zdGFudCByZXR1cm5zKHN0cmluZyxzdHJpbmcsc3RyaW5nLHVpbnQ4W10sYnl0ZXMzMltdLGJ5dGVzMzJbXSxhZGRyZXNzW10pewogICAgICAgIHVpbnQgbGVuZ3RoID0gRXZpZGVuY2VTaWduZXJzRGF0YUFCSShzaWduZXJzQWRkcikuZ2V0U2lnbmVyc1NpemUoKTsKICAgICAgICAgYWRkcmVzc1tdIG1lbW9yeSBzaWduZXJMaXN0ID0gbmV3IGFkZHJlc3NbXShsZW5ndGgpOwogICAgICAgICBmb3IodWludCBpPSAwIDtpPGxlbmd0aCA7aSsrKQogICAgICAgICB7CiAgICAgICAgICAgICBzaWduZXJMaXN0W2ldID0gKEV2aWRlbmNlU2lnbmVyc0RhdGFBQkkoc2lnbmVyc0FkZHIpLmdldFNpZ25lcihpKSk7CiAgICAgICAgIH0KICAgICAgICByZXR1cm4oZXZpZGVuY2UsZXZpZGVuY2VJbmZvLGV2aWRlbmNlSWQsX3YsX3IsX3Msc2lnbmVyTGlzdCk7CiAgICB9CgogICAgZnVuY3Rpb24gYWRkU2lnbmF0dXJlcyh1aW50OCB2LCBieXRlczMyIHIsIGJ5dGVzMzIgcykgcHVibGljIHJldHVybnMoYm9vbCkgewogICAgICAgIGZvcih1aW50IGk9IDAgO2k8c2lnbmVycy5sZW5ndGggO2krKykKICAgICAgICB7CiAgICAgICAgICAgIGlmKG1zZy5zZW5kZXIgPT0gc2lnbmVyc1tpXSkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgaWYoIF92W2ldID09IHYgJiYgX3JbaV0gPT0gciAmJiBfc1tpXSA9PSBzKQogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgIGFkZFJlcGVhdFNpZ25hdHVyZXNFdmVudChldmlkZW5jZSxldmlkZW5jZUluZm8sZXZpZGVuY2VJZCx2LHIscyk7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgIGVycm9yUmVwZWF0U2lnbmF0dXJlc0V2ZW50KGV2aWRlbmNlLGV2aWRlbmNlSWQsdixyLHMsbXNnLnNlbmRlcik7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgIGlmKENhbGxWZXJpZnkobXNnLnNlbmRlcikpCiAgICAgICB7CiAgICAgICAgICAgIF92LnB1c2godik7CiAgICAgICAgICAgIF9yLnB1c2gocik7CiAgICAgICAgICAgIF9zLnB1c2gocyk7CiAgICAgICAgICAgIHNpZ25lcnMucHVzaChtc2cuc2VuZGVyKTsKICAgICAgICAgICAgYWRkU2lnbmF0dXJlc0V2ZW50KGV2aWRlbmNlLGV2aWRlbmNlSW5mbyxldmlkZW5jZUlkLHYscixzKTsKICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICB9CiAgICAgICBlbHNlCiAgICAgICB7CiAgICAgICAgICAgZXJyb3JBZGRTaWduYXR1cmVzRXZlbnQoZXZpZGVuY2UsZXZpZGVuY2VJbmZvLGV2aWRlbmNlSWQsdixyLHMsbXNnLnNlbmRlcik7CiAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgfQogICAgfQogICAgCiAgICBmdW5jdGlvbiBnZXRTaWduZXJzKClwdWJsaWMgY29uc3RhbnQgcmV0dXJucyhhZGRyZXNzW10pCiAgICB7CiAgICAgICAgIHVpbnQgbGVuZ3RoID0gRXZpZGVuY2VTaWduZXJzRGF0YUFCSShzaWduZXJzQWRkcikuZ2V0U2lnbmVyc1NpemUoKTsKICAgICAgICAgYWRkcmVzc1tdIG1lbW9yeSBzaWduZXJMaXN0ID0gbmV3IGFkZHJlc3NbXShsZW5ndGgpOwogICAgICAgICBmb3IodWludCBpPSAwIDtpPGxlbmd0aCA7aSsrKQogICAgICAgICB7CiAgICAgICAgICAgICBzaWduZXJMaXN0W2ldID0gKEV2aWRlbmNlU2lnbmVyc0RhdGFBQkkoc2lnbmVyc0FkZHIpLmdldFNpZ25lcihpKSk7CiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIHNpZ25lckxpc3Q7CiAgICB9Cn0=",
          "contractDesc_en": "Evidence",
          "createTime": "2021-01-20 18:02:10",
          "modifyTime": "2021-01-20 18:02:10"
        },
        {
          "contractId": 5,
          "contractFolderId": 2,
          "contractName": "EvidenceSignersData",
          "contractDesc": "EvidenceSignersData",
          "contractSrc": "cHJhZ21hIHNvbGlkaXR5IF4wLjQuNDsKaW1wb3J0ICJFdmlkZW5jZS5zb2wiOwoKY29udHJhY3QgRXZpZGVuY2VTaWduZXJzRGF0YXsKICAgICAgICBhZGRyZXNzW10gc2lnbmVyczsKCQlldmVudCBuZXdFdmlkZW5jZUV2ZW50KGFkZHJlc3MgYWRkcik7CiAgICAgICAgZnVuY3Rpb24gbmV3RXZpZGVuY2Uoc3RyaW5nIGV2aSwgc3RyaW5nIGluZm8sc3RyaW5nIGlkLHVpbnQ4IHYsIGJ5dGVzMzIgcixieXRlczMyIHMpcHVibGljIHJldHVybnMoYWRkcmVzcykKICAgICAgICB7CiAgICAgICAgICAgIEV2aWRlbmNlIGV2aWRlbmNlID0gbmV3IEV2aWRlbmNlKGV2aSwgaW5mbywgaWQsIHYsIHIsIHMsIHRoaXMsIG1zZy5zZW5kZXIpOwogICAgICAgICAgICBuZXdFdmlkZW5jZUV2ZW50KGV2aWRlbmNlKTsKICAgICAgICAgICAgcmV0dXJuIGV2aWRlbmNlOwogICAgICAgIH0KCiAgICAgICAgZnVuY3Rpb24gRXZpZGVuY2VTaWduZXJzRGF0YShhZGRyZXNzW10gZXZpZGVuY2VTaWduZXJzKXB1YmxpY3sKICAgICAgICAgICAgZm9yKHVpbnQgaT0wOyBpPGV2aWRlbmNlU2lnbmVycy5sZW5ndGg7ICsraSkgewogICAgICAgICAgICBzaWduZXJzLnB1c2goZXZpZGVuY2VTaWduZXJzW2ldKTsKCQkJfQoJCX0KCiAgICBmdW5jdGlvbiB2ZXJpZnkoYWRkcmVzcyBhZGRyKXB1YmxpYyBjb25zdGFudCByZXR1cm5zKGJvb2wpewogICAgZm9yKHVpbnQgaT0wOyBpPHNpZ25lcnMubGVuZ3RoOyArK2kpIHsKICAgICAgICBpZiAoYWRkciA9PSBzaWduZXJzW2ldKQogICAgICAgIHsKICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgfQogICAgfQogICAgcmV0dXJuIGZhbHNlOwp9CgogICAgZnVuY3Rpb24gZ2V0U2lnbmVyKHVpbnQgaW5kZXgpcHVibGljIGNvbnN0YW50IHJldHVybnMoYWRkcmVzcyl7CiAgICAgICAgdWludCBsaXN0U2l6ZSA9IHNpZ25lcnMubGVuZ3RoOwogICAgICAgIGlmKGluZGV4IDwgbGlzdFNpemUpCiAgICAgICAgewogICAgICAgICAgICByZXR1cm4gc2lnbmVyc1tpbmRleF07CiAgICAgICAgfQogICAgICAgIGVsc2UKICAgICAgICB7CiAgICAgICAgICAgIHJldHVybiAwOwogICAgICAgIH0KCiAgICB9CgogICAgZnVuY3Rpb24gZ2V0U2lnbmVyc1NpemUoKSBwdWJsaWMgY29uc3RhbnQgcmV0dXJucyh1aW50KXsKICAgICAgICByZXR1cm4gc2lnbmVycy5sZW5ndGg7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0U2lnbmVycygpIHB1YmxpYyBjb25zdGFudCByZXR1cm5zKGFkZHJlc3NbXSl7CiAgICAgICAgcmV0dXJuIHNpZ25lcnM7CiAgICB9Cgp9",
          "contractDesc_en": "EvidenceSignersData",
          "createTime": "2021-01-20 18:02:10",
          "modifyTime": "2021-01-20 18:02:10"
        }
      ]
    }
    

    12.6. 根据合约编号获取合约信息

    接口描述

    返回合约信息

    接口URL

    http://localhost:5002/WeBASE-Front/contractStore/getContractItemById/{contractId}

    调用方法

    HTTP GET

    请求参数

    1)参数表

    序号中文参数名类型最大长度必填说明
    1合约编号contractIdint

    2)数据格式

    http://localhost:5002/WeBASE-Front/contractStore/getContractItemById/2
    

    响应参数

    1)数据格式

    {
      "code": 0,
      "message": "success",
      "data": {
        "contractId": 2,
        "contractFolderId": 1,
        "contractName": "LibSafeMathForUint256Utils",
        "contractDesc": "LibSafeMathForUint256Utils",
        "contractSrc": "LyoKICogQ29weXJpZ2h0IDIwMTQtMjAxOSB0aGUgb3JpZ2luYWwgYXV0aG9yIG9yIGF1dGhvcnMuCiAqCiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAogKgogKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAogKgogKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCiAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgogKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCiAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgogKiAqLwoKcHJhZ21hIHNvbGlkaXR5IF4wLjQuMjU7CgpsaWJyYXJ5IExpYlNhZmVNYXRoRm9yVWludDI1NlV0aWxzIHsKCiAgICBmdW5jdGlvbiBhZGQodWludDI1NiBhLCB1aW50MjU2IGIpIGludGVybmFsIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHVpbnQyNTYgYyA9IGEgKyBiOwogICAgICAgIHJlcXVpcmUoYyA+PSBhLCAiU2FmZU1hdGhGb3JVaW50MjU2OiBhZGRpdGlvbiBvdmVyZmxvdyIpOwogICAgICAgIHJldHVybiBjOwogICAgfQoKICAgIGZ1bmN0aW9uIHN1Yih1aW50MjU2IGEsIHVpbnQyNTYgYikgaW50ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmVxdWlyZShiIDw9IGEsICJTYWZlTWF0aEZvclVpbnQyNTY6IHN1YnRyYWN0aW9uIG92ZXJmbG93Iik7CiAgICAgICAgdWludDI1NiBjID0gYSAtIGI7CiAgICAgICAgcmV0dXJuIGM7CiAgICB9CgogICAgZnVuY3Rpb24gbXVsKHVpbnQyNTYgYSwgdWludDI1NiBiKSBpbnRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICBpZiAoYSA9PSAwIHx8IGIgPT0gMCkgewogICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICB9CgogICAgICAgIHVpbnQyNTYgYyA9IGEgKiBiOwogICAgICAgIHJlcXVpcmUoYyAvIGEgPT0gYiwgIlNhZmVNYXRoRm9yVWludDI1NjogbXVsdGlwbGljYXRpb24gb3ZlcmZsb3ciKTsKICAgICAgICByZXR1cm4gYzsKICAgIH0KCiAgICBmdW5jdGlvbiBkaXYodWludDI1NiBhLCB1aW50MjU2IGIpIGludGVybmFsIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJlcXVpcmUoYiA+IDAsICJTYWZlTWF0aEZvclVpbnQyNTY6IGRpdmlzaW9uIGJ5IHplcm8iKTsKICAgICAgICB1aW50MjU2IGMgPSBhIC8gYjsKICAgICAgICByZXR1cm4gYzsKICAgIH0KCiAgICBmdW5jdGlvbiBtb2QodWludDI1NiBhLCB1aW50MjU2IGIpIGludGVybmFsIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJlcXVpcmUoYiAhPSAwLCAiU2FmZU1hdGhGb3JVaW50MjU2OiBtb2R1bG8gYnkgemVybyIpOwogICAgICAgIHJldHVybiBhICUgYjsKICAgIH0KCiAgICBmdW5jdGlvbiBwb3dlcih1aW50MjU2IGEsIHVpbnQyNTYgYikgaW50ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KXsKCiAgICAgICAgaWYoYSA9PSAwKSByZXR1cm4gMDsKICAgICAgICBpZihiID09IDApIHJldHVybiAxOwoKICAgICAgICB1aW50MjU2IGMgPSAxOwogICAgICAgIGZvcih1aW50MjU2IGkgPSAwOyBpIDwgYjsgaSsrKXsKICAgICAgICAgICAgYyA9IG11bChjLCBhKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gbWF4KHVpbnQyNTYgYSwgdWludDI1NiBiKSBpbnRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4gYSA+PSBiID8gYSA6IGI7CiAgICB9CgogICAgZnVuY3Rpb24gbWluKHVpbnQyNTYgYSwgdWludDI1NiBiKSBpbnRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4gYSA8IGIgPyBhIDogYjsKICAgIH0KCiAgICBmdW5jdGlvbiBhdmVyYWdlKHVpbnQyNTYgYSwgdWludDI1NiBiKSBpbnRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4gKGEgLyAyKSArIChiIC8gMikgKyAoKGEgJSAyICsgYiAlIDIpIC8gMik7CiAgICB9Cn0K",
        "contractDesc_en": "LibSafeMathForUint256Utils",
        "createTime": "2021-01-20 18:02:10",
        "modifyTime": "2021-01-20 18:02:10"
      }
    }
    

    13.1. 查询节点证书接口

    接口描述

    获取Front对应节点的Fisco证书和sdk证书(包含链证书、机构证书和节点证书)的内容;

    需要在项目配置文件中constant-nodePath配置Front连接节点的绝对路径;

    注:

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    http://localhost:5002/WeBASE-Front/cert
    

    响应参数

    1)数据格式

    a、成功:

    {
        "node": "MIICOTCCASGgAwIBAgIJAKHsAYI3TsAOMA0GCSqGSIb3DQEBCwUAMDgxEDAOBgNV\nBAMMB2FnZW5jeUExEzARBgNVBAoMCmZpc2NvLWJjb3MxDzANBgNVBAsMBmFnZW5j\neTAeFw0xOTA3MTIwMjA2MTZaFw0yOTA3MDkwMjA2MTZaMDIxDDAKBgNVBAMMA3Nk\nazETMBEGA1UECgwKZmlzY28tYmNvczENMAsGA1UECwwEbm9kZTBWMBAGByqGSM49\nAgEGBSuBBAAKA0IABJ79rSKIb97xZwByW58xH6tzoNKNLaKG7J5wxAEgAb03O2h4\nMkEMLtf/LB7tELOiyCiIEhLScprb1LjvDDt2RDGjGjAYMAkGA1UdEwQCMAAwCwYD\nVR0PBAQDAgXgMA0GCSqGSIb3DQEBCwUAA4IBAQC0u2lfclRmCszBTi2rtvMibZec\noalRC0sQPBPRb7UQhGCodxmsAT3dBUf+s4wLLrmN/cnNhq5HVObbWxzfu7gn3+IN\nyQEeqdbGdzlu1EDcaMgAz6p2W3+FG/tmx/yrNza29cYekWRL44OT5LOUPEKrJ4bJ\neOBRY4QlwZPFmM0QgP7DoKxHXldRopkmvqT4pbW51hWvPgj7KrdqwbVWzuWQuI3i\n3j3O96XZJsaDZ0+IGa5093+TsTNPfWUZzp5Kg+EyNR6Ea1evuMDNq9NAqqcd5bX9\nO9kgkb8+llO8I5ZhdnN0BuhGvv9wpsa9hW8BImOLzUBwfSVYouGCkoqlVq9X",
        "chain": "MIIDPTCCAiWgAwIBAgIJAMfvnu4d5fHdMA0GCSqGSIb3DQEBCwUAMDUxDjAMBgNV\nBAMMBWNoYWluMRMwEQYDVQQKDApmaXNjby1iY29zMQ4wDAYDVQQLDAVjaGFpbjAe\nFw0xOTA3MTIwMjA2MTZaFw0yOTA3MDkwMjA2MTZaMDUxDjAMBgNVBAMMBWNoYWlu\nMRMwEQYDVQQKDApmaXNjby1iY29zMQ4wDAYDVQQLDAVjaGFpbjCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBAMGsKT/S60cxvFS4tBLyfT0QKPLW1g3ZgMND\n03hrWp1FAnvE9htsDEgqvNLD5hKWaYcUhjQMq0WttiP/vPxkwwJkZhzWhXpdSxMR\nqKVX4BppnkT0ICm84jYSyJdNFjKvfWlBIptIfFuTUDMT+XqF/Ct756JksiUwKZRW\neRAVcYzFM4u4ZuKeaept/8Bv8Z/RlJzGI57qj5BELeA0meUagq2WoCgJrPyvbO0b\nLwogFWS4kEjv20IIdj3fTqeJlooEXtPnuegunSMQB6aIh2im74FfJ3sHuOjQDFuC\nb5ZUiyUHG6IOGCqs+Grk+/VYI16Mx+8OoGBD5koTpK8B+/aedsUCAwEAAaNQME4w\nHQYDVR0OBBYEFLTg2FsUFekx9XjIi01BrDpo0aPIMB8GA1UdIwQYMBaAFLTg2FsU\nFekx9XjIi01BrDpo0aPIMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEB\nAJmuMLhWSld8G6i3Vw21TN/d2rSRg3hNqOyycPYtdVK1YXEj4Xm91qgL8An3Kui8\njSq1S9+PstGvyh14YUw43Y1VtEPGpNVTvDtkxQ/8rs1sGHbqUxshgFMbqruxp7WH\ns0fxgn5COHEnRC4jQn02wZAk8pIjFVZLkhqdIYBtC35buHr17mXNL0S4H5cJxzPN\nk3XtKBqXedkTrEsDhR/bZ6qDDq0BcduhtKiYVPiVw9z3moLuwDb0QDM59zCexpcz\nb/w7K4lIxWqpD5tbpKSmj/3v5TCqez0Mim8/j4q29bP913KQrngnVCdCezOsPWIH\nDDoihgeRQHuz1VuGGZ259Hc=",
        "agency": "MIIDADCCAeigAwIBAgIJAJUF2Dp1a9U6MA0GCSqGSIb3DQEBCwUAMDUxDjAMBgNV\nBAMMBWNoYWluMRMwEQYDVQQKDApmaXNjby1iY29zMQ4wDAYDVQQLDAVjaGFpbjAe\nFw0xOTA3MTIwMjA2MTZaFw0yOTA3MDkwMjA2MTZaMDgxEDAOBgNVBAMMB2FnZW5j\neUExEzARBgNVBAoMCmZpc2NvLWJjb3MxDzANBgNVBAsMBmFnZW5jeTCCASIwDQYJ\nKoZIhvcNAQEBBQADggEPADCCAQoCggEBANBT4CTciIYdSeEabgJzif+CFB0y3GzG\ny+XQYtWK+TtdJWduXqhnnZiYAZs7OPGEu79Yx/bEpjEXsu2cXH0D6BHZk+wvuxG6\nezXWq5MYjCw3fQiSRWkDYoxzWgulkRyYROF1xoZeNGQssReFmCgP+pcQwRxjcq8z\nIA9iT61YxyW5nrS7xnra9uZq/EE3tsJ0ae3ax6zixCT66aV49S27cMcisS+XKP/q\nEVPxhO7SUjnzZY69MgZzNSFxCzIbapnlmYAOS26vIT0taSkoKXmIsYssga45XPwI\n7YBVCc/34kHzW9xrNjyyThMWOgDsuBqZN9xvapGSQ82Lsh7ObN0dZVUCAwEAAaMQ\nMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAu3aHxJnCZnICpHbQ\nv1Lc5tiXtAYE9aEP5cxb/cO14xY8dS+t0wiLIvyrE2aTcgImzr4BYNBm1XDt5suc\nMpzha1oJytGv79M9/WnI/BKmgUqTaaXOV2Ux2yPX9SadNcsD9/IbrV0b/hlsPd6M\nK8w7ndowvBgopei+A1NQY6jTDUKif4RxD4u5HZFWUu7pByNLFaydU4qBKVkucXOq\nxmWoupL5XrDk5o490kiz/Zgufqtb4w6oUr3lrQASAbFB3lID/P1ipi0DwX7kZwVX\nECDLYvr+eX6GbTClzn0JGuzqV4OoRo1rrRv+0tp1aLZKpCYn0Lhf6s1iw/kCeM2O\nnP9l2Q=="
    }
    

    b、失败:

    {
        "code": 201231,
        "message": "Cert file not found, please check cert path in config",
        "data": "FileNotFound, node cert(node.crt) path prefix error"
    }
    

    13.2. 获取明文SDK证书与私钥

    接口描述

    获取Front使用的sdk证书(包含链证书、sdk证书和sdk私钥)的内容

    接口URL

    http://localhost:5002/WeBASE-Front/cert/sdk

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    http://localhost:5002/WeBASE-Front/cert/sdk
    

    响应参数

    1)参数表

    序号中文参数名类型必填说明
    1MapMapkey为文件名,value为文件内容

    1)数据格式

    a、成功:

    {
      "sdk.key": "-----BEGIN PRIVATE KEY-----\nMIGEAgEAMBAGByqGSM49AgEGBSuBBAAKBG0wawIBAQQgxqr/d/VgQ0fAr/KvyAeW\nJ6bD1tqxZ5gYOdfIJiK7WOmhRANCAAT3g/OsuSAD2I/dKLWnZTbMGQ8l9WnkD/wr\npyoiQkMy1qI5/3Sj4WFKGcVu9vhsd0nLoP+y1QttYKM0m5QGcuhP\n-----END PRIVATE KEY-----\n",
      "ca.crt": "-----BEGIN CERTIFICATE-----\nMIIBsDCCAVagAwIBAgIJAPwQ7ISyofOIMAoGCCqGSM49BAMCMDUxDjAMBgNVBAMM\nBWNoYWluMRMwEQYDVQQKDApmaXNjby1iY29zMQ4wDAYDVQQLDAVjaGFpbjAgFw0y\nMTA0MDYxMjMwNDBaGA8yMTIxMDMxMzEyMzA0MFowNTEOMAwGA1UEAwwFY2hhaW4x\nEzARBgNVBAoMCmZpc2NvLWJjb3MxDjAMBgNVBAsMBWNoYWluMFYwEAYHKoZIzj0C\nAQYFK4EEAAoDQgAE6UcrK7ukGBVvBmWYwgIloM38ibqtxF2zBnM9zgU4bujjJU1Y\nCZsHGKVGuNstSOZYfYulnTtFUoHhUEyhddvql6NQME4wHQYDVR0OBBYEFBBSyZi8\nk/Hz/Q2SAin5bMnE1nOFMB8GA1UdIwQYMBaAFBBSyZi8k/Hz/Q2SAin5bMnE1nOF\nMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSAAwRQIgEpuPZypVImOtDty9p50X\njeD4wdgzHXpd3CDPui4CnZYCIQC4n+r97cCB51dPb+WjDNV5C18S2uI8LlNVj+xL\ndSweAg==\n-----END CERTIFICATE-----\n",
      "sdk.crt": "-----BEGIN CERTIFICATE-----\nMIIBeDCCAR+gAwIBAgIJAJoEtSMUsa8HMAoGCCqGSM49BAMCMDgxEDAOBgNVBAMM\nB2FnZW5jeUExEzARBgNVBAoMCmZpc2NvLWJjb3MxDzANBgNVBAsMBmFnZW5jeTAg\nFw0yMTA0MDYxMjMwNDBaGA8yMTIxMDMxMzEyMzA0MFowMTEMMAoGA1UEAwwDc2Rr\nMRMwEQYDVQQKDApmaXNjby1iY29zMQwwCgYDVQQLDANzZGswVjAQBgcqhkjOPQIB\nBgUrgQQACgNCAAT3g/OsuSAD2I/dKLWnZTbMGQ8l9WnkD/wrpyoiQkMy1qI5/3Sj\n4WFKGcVu9vhsd0nLoP+y1QttYKM0m5QGcuhPoxowGDAJBgNVHRMEAjAAMAsGA1Ud\nDwQEAwIF4DAKBggqhkjOPQQDAgNHADBEAiANbeRFiiS6mH+vcAOwV3wXd9YW/B2a\n+vrHMm6NwtliRAIgRH4gSF0XLmpVOEO21bJFDGWm9siIX0cnj0R3kNGZcB4=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIBcTCCARegAwIBAgIJANrOZ+FrVNpIMAoGCCqGSM49BAMCMDUxDjAMBgNVBAMM\nBWNoYWluMRMwEQYDVQQKDApmaXNjby1iY29zMQ4wDAYDVQQLDAVjaGFpbjAeFw0y\nMTA0MDYxMjMwNDBaFw0zMTA0MDQxMjMwNDBaMDgxEDAOBgNVBAMMB2FnZW5jeUEx\nEzARBgNVBAoMCmZpc2NvLWJjb3MxDzANBgNVBAsMBmFnZW5jeTBWMBAGByqGSM49\nAgEGBSuBBAAKA0IABIqMDvvzvTq8WW1UtJrnnsifw9/OrPsMc9CrrYBsWdwOGhdx\nfNTJA1ss+vngjrhAmWHczvbh+E1WOlDGzpCumeqjEDAOMAwGA1UdEwQFMAMBAf8w\nCgYIKoZIzj0EAwIDSAAwRQIhALsAbAQ9BDeofk4VYzYx2ZAHB1HviDp9ndvXAkLN\nsfHZAiAjViK97dDr3gxP/qHg0e8BG9ptEv7Do8caOPj33F+yOQ==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIBsDCCAVagAwIBAgIJAPwQ7ISyofOIMAoGCCqGSM49BAMCMDUxDjAMBgNVBAMM\nBWNoYWluMRMwEQYDVQQKDApmaXNjby1iY29zMQ4wDAYDVQQLDAVjaGFpbjAgFw0y\nMTA0MDYxMjMwNDBaGA8yMTIxMDMxMzEyMzA0MFowNTEOMAwGA1UEAwwFY2hhaW4x\nEzARBgNVBAoMCmZpc2NvLWJjb3MxDjAMBgNVBAsMBWNoYWluMFYwEAYHKoZIzj0C\nAQYFK4EEAAoDQgAE6UcrK7ukGBVvBmWYwgIloM38ibqtxF2zBnM9zgU4bujjJU1Y\nCZsHGKVGuNstSOZYfYulnTtFUoHhUEyhddvql6NQME4wHQYDVR0OBBYEFBBSyZi8\nk/Hz/Q2SAin5bMnE1nOFMB8GA1UdIwQYMBaAFBBSyZi8k/Hz/Q2SAin5bMnE1nOF\nMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSAAwRQIgEpuPZypVImOtDty9p50X\njeD4wdgzHXpd3CDPui4CnZYCIQC4n+r97cCB51dPb+WjDNV5C18S2uI8LlNVj+xL\ndSweAg==\n-----END CERTIFICATE-----\n"
    }
    

    13.2. 获取SDK证书与私钥压缩包

    接口描述

    获取Front使用的sdk证书(包含链证书、sdk证书和sdk私钥)的zip压缩包

    接口URL

    调用方法

    HTTP GET

    请求参数

    1)参数表

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

    2)数据格式

    http://localhost:5002/WeBASE-Front/cert/sdk/zip
    

    响应参数

    1)参数表

    序号中文参数名类型必填说明
    1文件名ResponseEntity.headerString文件名在header中
    2文件流bodyInputStream文件的流在body中

    1)数据格式

    a、成功:

    headers:  content-disposition: attachment;filename*=UTF-8''conf.zip 
    
    {
        // 二进制流
    }
    

    14. 附录

    1. 返回码信息列表

    codemessage描述
    0success成功
    101001system error系统异常
    101002param valid fail参数校验异常
    101003web3jMap of groupId is null, please call /{groupId}/web3/refresh to refresh连接当前群组失败,请调用/{groupId}/web3/refresh刷新群组
    101004groupList error for no group, web3jMap is empty群组列表为空,请检查节点共识状态
    201001groupId cannot be empty群组编号不能为空
    201002user cannot be empty用户地址不能为空
    201003useAes cannot be empty是否为加密私钥不能为空
    201004version cannot be empty合约版本不能为空
    201005funcName cannot be empty方法名不能为空
    201006abiInfo cannot be emptyabi内容不能为空
    201007bytecodeBin cannot be empty合约bin不能为空
    201008contract’s current version has been deployed该合约版本已部署
    201009contract is not deployed合约未部署
    201010save abi errorabi保存错误
    201011contract 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节点请求失败
    201023contract already exists合约已经存在
    201024contract name cannot be repeated合约名不能重复
    201025invalid contract id无效的合约编号
    201026contract has been deployed合约已部署
    201027send abiInfo fail发送abi失败
    201028bytecodeBin is null合约bin为空
    201029contractAddress is null合约地址为空
    201030contractAddress invalid合约地址无效
    201031privateKey decode fail私钥编码失败
    201032not found config of keyServer密钥服务未配置
    201033data request sign error数据请求签名异常
    201034groupId not exist群组编号不存在
    201035version and address cannot all be null合约版本和地址不能同时为空
    201036compile fail合约编译失败
    201037user name is null用户名为空
    201038user name already exists用户名已存在
    201039private key already exists私钥已存在
    201040private key not exists私钥不存在
    201041external user’s appId and signUserId cannot be empty外部用户的appId和signUserId不能为空
    201042There is no sol files in sourcesolidity文件不存在
    201043invalid group operate type群组操作类型不正确
    201044invalid data type不正确的数据类型
    201045encode string can not be empty已签名的参数内容不能为空
    201046transaction failed交易上链失败
    201050Fail to parse json链上返回值反序列化失败
    201051get consensus status fail交易上链失败
    201101groupId cannot be empty群组编号不能为空
    201102tableName cannot be empty表名不能为空
    201103permissionType cannot be empty权限类型不能为空
    201104permissionType not exists权限类型不存在
    201105from address cannot be empty管理员地址不能为空
    201106contract name cannot be empty合约名不能为空
    201107system config key cannot be empty系统配置key值不能为空
    201108system config value cannot be empty系统配置value值不能为空
    201109node id cannot be empty节点id不能为空
    201110node type cannot be empty节点类型(共识状态不能为空)
    201111Permission state cannot be all empty更新的用户权限状态不能为空
    201112contract address cannot be empty合约地址不能为空
    201113contract handle type cannot be empty合约操作类型不能为空
    201114grantAddress cannot be empty赋值的地址不能为空
    201115invalid contract handle type不正确的合约操作类型
    201116contract status handle fail合约状态修改失败
    201120group operate fail群组操作失败
    201121node internal error节点内部错误
    201122group already exists群组已存在
    201123group already running群组已运行
    201124group already stopped群组已停止
    201125group already deleted群组已删除
    201126group not found未找到群组
    201127group operate param error群组操作入参错误
    201128group peers not connected群组内节点未连接
    201129group genesis conf already exists群组创世块文件已存在
    201130group config.ini already exists群组的配置文件已存在
    201131group genesis conf not found未找到群组创世块文件
    201132group config.ini not found未找到群组的配置文件
    201133group is stopping群组正在停止
    201134group not deleted群组未删除
    201151Unsupported contract param type to encoded不支持编码的合约参数类型
    201152Unsupported contract param type to decoded不支持解码的合约参数类型
    201153unable to create instance of type, check input params无法创建该合约参数类型的实例,请检查入参
    201154contract path is exists.合约路径已存在
    201155contract path cannot be empty合约路径不能为空
    201156Write front’s sdk cert and key fail导出SDK证书私钥文件失败,写入文件失败
    201157Write private key file fail导出私钥文件失败,写入文件失败
    201200params not fit参数不符合要求
    201201address is invalid账户地址不正确
    201202permission denied, please check chain administrator permission权限不足,请检查用户
    201208unsupported for this system config key不支持设置该系统配置
    201209provide value by positive integer mode, from 100000 to 2147483647请输入正值或[100000, 2147483647]范围的值
    201210set system config value fail for params error or permission denied设置系统配置失败,请检查权限
    201211query system config value list fail获取系统配置列表失败
    201216node id is invalid节点id错误
    201217invalid node type: sealer, observer, remove节点类型(共识状态)错误:sealer, observer, remove
    201218set node consensus type fail, check permission or node’s group config file节点类型(共识状态)修改失败,请检查权限或节点群组配置文件
    201221Contract version should only contains ‘A-Z’ or ‘a-z’ or ‘0-9’ or dot markCNS合约版本号应只包含大小写字母、数字和”.”
    201222version of contract is out of length合约版本号过长
    201223cns register failcns注册失败
    201224version not exists版本不存在
    201225cns name cannot be emptycns名不能为空
    201226sql syntax errorsql语句错误
    201227crud sql fail执行sql语句失败
    201228table not exists操作的表格不存在
    201231Cert file not found, please check cert path in config配置文件中的证书地址错误,未找到证书文件
    201232Pem file format error, must surrounded by ——-XXXXX PRIVATE KEY——-pem证书格式错误,必须以”——-XXXXX PRIVATE KEY——-“开头结尾
    201233Pem file content errorpem证书内容错误
    201235p12’s password cannot be chinesep12证书密码不能是中文
    201236p12’s password not matchp12证书密码错误
    201237P12 file content errorp12证书内容错误
    201241Exchange or message queue not exists, please check mq server or mq configuration交换机或消息队列不存在,请检查mq-server运行状态及其配置
    201242Database error: data already exists in db数据库错误:该数据记录已存在于数据库中
    201243Block range error, from/toBlock must greater than 0, toBlock must be greater than fromBlock合约Event区块范围错误,from大于0,to大于from
    201244Database error: data not exists in db, please check your params该数据记录不存在,请检查参数
    201245Only support letter and digit, please check your params仅支持使用数字字母与下划线,请检查参数
    201246Register contractEvent failed, please check your param订阅合约事件失败,请检查参数格式
    201247Unregister event failed, please check mq server exchange取消订阅事件失败,请检查参数格式
    201248Contract abi invalid, please check abi合约ABI格式错误,请检查入参
    201255contract address already exists合约地址已存在
    201256abi info of this id not existsabi不存在
    201301threshold must be greater than zero链阈值必须大于0
    201302committee weight must be greater than zero链委员权重必须大于0
    201303chain governance address cannot be blank链管理委员/运维地址不能为空
    201311get event callback fail for time out获取event回调超时
    201312get event callback error获取event回调失败
    201501sdk create key pair fail and return nullsdk创建私钥对失败并返回Null
    201502pem/p12 manager get key pair error for input paramspem/p12证书获取私钥对失败,检查入参
    201503pem/p12 manager get key pair error for bc dependency errorpem/p12证书获取私钥对失败,检查bc依赖包版本
    201504sign service return error签名服务并返回异常
    201510transaction receipt status return error交易回执状态码非0x0,交易执行失败
    201511contract abi parse json error合约ABI转JSON失败
    201512call contract error for io exception调用合约的交易上链失败
    201513get transaction receipt fail for exec获取交易回执失败,返回执行错误
    201514get transaction receipt fail for time out获取交易回执失败,链上链下请求超时
    201515transaction receipt fail and parse output fail转化交易回执中output输出值失败
    201516transaction receipt fail and output is null交易回执output为空
    201517call contract constant method fail合约状态异常,调用合约constant方法失败
    201518get message’s hash fail获取哈希失败
    201521get list of manager on chain fail获取链上管理员列表失败
    201522table key length error用户表的键值长度大于最大值255
    201523crud’s param parse json errorCRUD方法的入参转Entry/Condition失败,请检查入参
    201524precompiled common transfer to json fail预编译错误码转JSON失败

    2. Precompiled Service说明

    对预编译合约接口的使用有疑惑,可以查看FISCO BCOS的PreCompiledService API说明

    查看预编译合约的solidity接口代码,可以查看FISCO BCOS的,如crud/TableFactory.sol:

    pragma solidity ^0.4.2;
    
    contract TableFactory {
        function createTable(string tableName, string key, string valueField) public returns (int);
    }
    

    查看FISCO BCOS中实现的precompild合约列表、地址分配及源码:

    Precompiled Service API 错误码

    错误码消息内容备注
    0success
    -50000permission denied
    -50001table name already exist
    -50100unknow function call
    -50101table does not exist
    -51000table name and address already exist
    -51001table name and address does not exist
    -51100invalid node IDSDK错误码
    -51101the last sealer cannot be removed
    -51102the node is not reachableSDK错误码
    -51103the node is not a group peerSDK错误码
    -51104the node is already in the sealer listSDK错误码
    -51105the node is already in the observer listSDK错误码
    -51200contract name and version already existSDK错误码
    -51201version string length exceeds the maximum limitSDK错误码
    -51300invalid configuration entry
    -51500contract name and version already exist
    -51501condition parse error
    -51502condition operation undefined
    -51600invalid ciphers
    -51700group sig failed
    -51800ring sig failed
    -51900contract frozen
    -51901contract available
    -51902contract repeat authorization
    -51903invalid contract address
    -51904table not exist
    -51905no authorized
    -52000committee member exist
    -52001committee member not exist
    -52002invalid request permission denied
    -52003invalid threshold
    -52004operator can’t be committee member
    -52005committee member can’t be operator
    -52006operator exist
    -52007operator not exist
    -52008account not exist
    -52009invalid account address
    -52010account already available
    -52011account frozen
    -52012current value is expected value

    3.调用接口遇到问题&解决方式

    Q1:合约方法入参byte32类型, java 通过HTTP+JSON调用,对应java bean 该如何对应数据类型? 报错

    {
        "code":201153,
        "data":null,
        "errorMessage":"unable to create instance of     type:org.fisco.bcos.sdk.abi.datatypes.generated.Bytes32"
    }
    

    A1:java bean对应还是由String 存储,而非byte[]。 java工程引用如下依赖

    <dependency>
        <groupId>org.fisco-bcos.java-sdk</groupId>
        <artifactId>fisco-bcos-java-sdk</artifactId>
        <version>2.7.2</version>
    </dependency>
    

    java 代码处理