From 887f8668614b630dd83afa5456c14f7842a8cddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=BF=97=E5=90=8C?= Date: Fri, 29 Jan 2021 17:37:42 +0800 Subject: [PATCH 01/11] Update RPC (#1150) * update(1/2) * update(2/2) * update * updated api.md * updated English version * updated English files Co-authored-by: Celia18305 --- .../en-us/reference/rpc/latest-version/api.md | 60 +- .../latest-version/api/calculatenetworkfee.md | 2 +- .../latest-version/api/getapplicationlog.md | 242 ++-- .../latest-version/api/getbestblockhash.md | 4 +- .../rpc/latest-version/api/getblock.md | 126 +- .../rpc/latest-version/api/getblockcount.md | 2 +- .../rpc/latest-version/api/getblockheader.md | 89 +- .../latest-version/api/getcontractstate.md | 216 ++- .../latest-version/api/getnativecontracts.md | 1247 +++++++++++++++++ .../latest-version/api/getnep17balances.md | 38 +- .../latest-version/api/getnep17transfers.md | 92 +- .../api/getnextblockvalidators.md | 42 + .../latest-version/api/getrawtransaction.md | 49 +- .../rpc/latest-version/api/getstorage.md | 12 +- .../api/gettransactionheight.md | 4 +- .../rpc/latest-version/api/getunclaimedgas.md | 12 +- .../rpc/latest-version/api/getversion.md | 13 +- .../latest-version/api/getwalletbalance.md | 14 +- .../api/getwalletunclaimedgas.md | 4 +- .../api/invokecontractverify.md | 90 ++ .../rpc/latest-version/api/invokefunction.md | 134 +- .../rpc/latest-version/api/listaddress.md | 8 +- .../rpc/latest-version/api/listplugins.md | 15 +- .../rpc/latest-version/api/openwallet.md | 8 +- .../rpc/latest-version/api/sendfrom.md | 49 +- .../rpc/latest-version/api/sendmany.md | 83 +- .../latest-version/api/sendrawtransaction.md | 2 +- .../rpc/latest-version/api/sendtoaddress.md | 48 +- .../zh-cn/reference/rpc/latest-version/api.md | 69 +- .../latest-version/api/calculatenetworkfee.md | 8 +- .../rpc/latest-version/api/closewallet.md | 1 + .../rpc/latest-version/api/dumpprivkey.md | 1 + .../latest-version/api/getapplicationlog.md | 244 ++-- .../latest-version/api/getbestblockhash.md | 4 +- .../rpc/latest-version/api/getblock.md | 131 +- .../rpc/latest-version/api/getblockcount.md | 2 +- .../rpc/latest-version/api/getblockheader.md | 91 +- .../rpc/latest-version/api/getcommittee.md | 2 +- .../latest-version/api/getcontractstate.md | 218 ++- .../latest-version/api/getnativecontracts.md | 1247 +++++++++++++++++ .../latest-version/api/getnep17balances.md | 46 +- .../latest-version/api/getnep17transfers.md | 97 +- .../api/getnextblockvalidators.md | 44 + .../latest-version/api/getrawtransaction.md | 49 +- .../rpc/latest-version/api/getstorage.md | 11 +- .../api/gettransactionheight.md | 5 +- .../rpc/latest-version/api/getunclaimedgas.md | 14 +- .../rpc/latest-version/api/getversion.md | 13 +- .../latest-version/api/getwalletbalance.md | 21 +- .../api/getwalletunclaimedgas.md | 10 +- .../rpc/latest-version/api/importprivkey.md | 2 + .../api/invokecontractverify.md | 90 ++ .../rpc/latest-version/api/invokefunction.md | 90 +- .../rpc/latest-version/api/invokescript.md | 6 +- .../rpc/latest-version/api/listaddress.md | 16 +- .../rpc/latest-version/api/listplugins.md | 15 +- .../rpc/latest-version/api/openwallet.md | 9 +- .../rpc/latest-version/api/sendfrom.md | 49 +- .../rpc/latest-version/api/sendmany.md | 83 +- .../latest-version/api/sendrawtransaction.md | 2 +- .../rpc/latest-version/api/sendtoaddress.md | 48 +- .../rpc/latest-version/api/submitblock.md | 4 +- .../rpc/latest-version/api/validateaddress.md | 2 +- 63 files changed, 4104 insertions(+), 1345 deletions(-) create mode 100644 docs/en-us/reference/rpc/latest-version/api/getnativecontracts.md create mode 100644 docs/en-us/reference/rpc/latest-version/api/getnextblockvalidators.md create mode 100644 docs/en-us/reference/rpc/latest-version/api/invokecontractverify.md create mode 100644 docs/zh-cn/reference/rpc/latest-version/api/getnativecontracts.md create mode 100644 docs/zh-cn/reference/rpc/latest-version/api/getnextblockvalidators.md create mode 100644 docs/zh-cn/reference/rpc/latest-version/api/invokecontractverify.md diff --git a/docs/en-us/reference/rpc/latest-version/api.md b/docs/en-us/reference/rpc/latest-version/api.md index bf31dbf4c..bdbd74264 100644 --- a/docs/en-us/reference/rpc/latest-version/api.md +++ b/docs/en-us/reference/rpc/latest-version/api.md @@ -2,40 +2,49 @@ Each NEO-CLI node provides an API interface for obtaining blockchain data from it, making it easy to develop blockchain applications. The interface is provided via [JSON-RPC](http://wiki.geekdream.com/Specification/json-rpc_2.0.html), and the underlying protocol uses HTTP/HTTPS for communication. -To start a node that provides an RPC service, you need to install the plugin [RpcServer](https://github.com/neo-project/neo-plugins/releases). No need to add an argument when starting Neo-CLI. +To start a node that provides an RPC service, you must install the plugin [RpcServer](https://github.com/neo-project/neo-plugins/releases). Refer to [Installing plugins](../../../node/cli/config.html#installing-plugins) for instructions. No need to add an argument when starting Neo-CLI. + +> [!Note] +> +> If the desired version of file is not found during installation, it is because the corresponding version of RpcServer plug-in has not been released yet. In that case, you can compile the project [neo-modules](https://github.com/neo-project/neo-modules) by yourself: +> +> 1. Create the folder Plugins under the directory where neo-cli.dll locates. +> 2. Put the RpcServer file you has complied in the Plugins folder and then restart Neo-CLI. ## Listening ports -After the JSON-RPC server starts, it will monitor the following ports, corresponding to the Main and Test nets: +After the JSON-RPC server is started, it will listen to the TCP port. By default it is the port 10332 of the local address (127.0.0.1), which is -For P2P and WebSocket information see [Node Introduction](../../../node/introduction.md). +``` +http://127.0.0.1:10332/ +``` -| | Main Net | Test Net | -| -------------- | -------- | -------- | -| JSON-RPC HTTPS | 10331 | 20331 | -| JSON-RPC HTTP | 10332 | 20332 | +You can modify the port in config.json in the RpcServer folder. ## Command Lists ### Blockchain -| Command | Parameter | Description | +| Method | Parameter | Description | | --------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------ | -| [getbestblockhash](api/getbestblockhash.md) | | Gets the hash of the latest block in the main chain. | +| [getbestblockhash](api/getbestblockhash.md) | | Gets the hash of the latest block in the blockchain. | | [getblock](api/getblock.md) | \ [verbose=0] | Returns the block information with the specified hash value or index. | -| [getblockcount](api/getblockcount.md) | | Gets the block count of the main chain. | +| [getblockcount](api/getblockcount.md) | | Gets the block count of the blockchain. | | [getblockhash](api/getblockhash.md) | \ | Returns the block hash with the specified index. | | [getblockheader](api/getblockheader.md) | \ [verbose=0] | Returns the information of the block header with the specified script hash or index. | +| [getcommittee](api/getcommittee.md) | | Gets the public key list of current Neo committee members. | +| [getnativecontracts](api/getnativecontracts.md) | | Gets the list of native contracts. | +| [getnextblockvalidators](api/getnextblockvalidators.md) | | Gets the validators list of the next block. | | [getcontractstate](api/getcontractstate.md) | \ | Returns information of the contract with the specified script hash. | -| [getrawmempool](api/getrawmempool.md) | [shouldGetUnverified=0] | Gets a list of unconfirmed or confirmed transactions in memory. | +| [getrawmempool](api/getrawmempool.md) | [shouldGetUnverified=0] | Gets a list of confirmed transactions in memory. If the value is 1 it gets all the transactions including both confirmed and unconfirmed transactions. | | [getrawtransaction](api/getrawtransaction.md) | \ [verbose=0] | Returns the transaction information with the specified hash value. | | [getstorage](api/getstorage.md) | \ \ | Returns the value with the contract script hash and the key. | | [gettransactionheight](api/gettransactionheight.md) | \ | Returns the transaction height with the specified transaction hash. | -| [getcommittee](api/getcommittee.md) | | Gets the public key list of current Neo committee members. | + ### Node -| Command | Parameter | Description | +| Method | Parameter | Description | | --------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------ | | [getconnectioncount](api/getconnectioncount.md) | | Gets the current connection count of the node. | | [getpeers](api/getpeers.md) | | Gets a list of nodes that are currently connected/disconnected by this node. | @@ -45,30 +54,31 @@ For P2P and WebSocket information see [Node Introduction](../../../node/introduc ### Smart Contract -| Command | Parameter | Description | +| Method | Parameter | Description | | --------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------ | +| [getunclaimedgas](api/getunclaimedgas.md) | \
| Get unclaimed gas of the specified address. | | [invokefunction](api/invokefunction.md) | \ \ \[params] \[sender] \[signers] | Invokes a smart contract with the specified script hash, passing in the method name and its params. | | [invokescript](api/invokescript.md) | \