diff --git a/docs/faq/basic.md b/docs/faq/basic.md index b957309..fd8fe3c 100644 --- a/docs/faq/basic.md +++ b/docs/faq/basic.md @@ -52,7 +52,7 @@ Since each new block is require to pass majority consensus, forks may not occur. Neo consensus nodes are elected by NEO holders. The network itself is permissionless; anyone may register as a candidate or cast a vote for a candidate. Candidates with a sufficient share of the total number of votes are elected as Neo Council members. The top 7 of these 21 Council members are the network's consensus (validator) nodes. -For more information, visit the following [link](https://docs.neo.org/docs/en-us/basic/consensus/vote_validator.html). +For more information, visit the following [link](../n3/foundation/consensus/vote_validator.md). ## How do I check the status of my transaction? diff --git a/docs/n3/develop/deploy/invoke.md b/docs/n3/develop/deploy/invoke.md index 2094a55..7c6bd95 100644 --- a/docs/n3/develop/deploy/invoke.md +++ b/docs/n3/develop/deploy/invoke.md @@ -8,7 +8,7 @@ You can query a contract details using Neo-CLI or Neo-GUI, such as the contract ### Querying using Neo-CLI -Use the RPC API [getcontractstate method](../../reference/rpc/latest-version/api/getcontractstate.md) to query the contract information. +Use the RPC API [getcontractstate method](../../reference/rpc/getcontractstate.md) to query the contract information. ### Querying using Neo-GUI @@ -31,7 +31,7 @@ You can choose one of the following ways to invoke the contract using Neo-CLI: For more information refer to [invoke](../../node/cli/cli.md#invoke). -- Use the RPC API [invokefunction](../../reference/rpc/latest-version/api/invokefunction.md) or [invokescript](../../reference/rpc/latest-version/api/invokescript.md). The former is recommended. +- Use the RPC API [invokefunction](../../reference/rpc/invokefunction.md) or [invokescript](../../reference/rpc/invokescript.md). The former is recommended. ### Invoking a contract using Neo-GUI @@ -108,7 +108,7 @@ The key statement is `Contract.Call(scriptHash, method, flags, params)`, where: ### Invocation permission -Three fields related to the contract invocation permission are defined in the contract manifest file, as shown in the following table. The wallet decides whether to give a security warning to the user based on the setting in the Groups and Trusts fields. Permissions and signature scopes determine whether contracts can be called by each other. For more information about signature scopes, refer to parameters description in [invokefunction method](../../reference/rpc/latest-version/api/invokefunction.md). +Three fields related to the contract invocation permission are defined in the contract manifest file, as shown in the following table. The wallet decides whether to give a security warning to the user based on the setting in the Groups and Trusts fields. Permissions and signature scopes determine whether contracts can be called by each other. For more information about signature scopes, refer to parameters description in [invokefunction method](../../reference/rpc/invokefunction.md). | Fields | Type | Description | | ------------- | ----------------------------- | ------------------------------------------------------------ | diff --git a/docs/n3/develop/write/basics.md b/docs/n3/develop/write/basics.md index a037f9e..e497ef8 100644 --- a/docs/n3/develop/write/basics.md +++ b/docs/n3/develop/write/basics.md @@ -24,8 +24,7 @@ namespace Helloworld public class Contract1 : SmartContract { //TODO: Replace it with your own address. - [InitialValue("NiNmXL8FjEUEs1nfX9uHFBNaenxDHJtmuB", ContractParameterType.Hash160)] - static readonly UInt160 Owner = default; + static readonly UInt160 Owner = "NiNmXL8FjEUEs1nfX9uHFBNaenxDHJtmuB"; private static bool IsOwner() => Runtime.CheckWitness(Owner); @@ -69,8 +68,7 @@ Inside the contract class, the property defined with `static readonly` or `const ```cs // Represents onwner of this contract, which is a fixed address. Usually should be the contract creator -[InitialValue("NiNmXL8FjEUEs1nfX9uHFBNaenxDHJtmuB", ContractParameterType.Hash160)] -static readonly UInt160 Owner = default; +static readonly UInt160 Owner = "NiNmXL8FjEUEs1nfX9uHFBNaenxDHJtmuB"; // A constant number private const ulong factor = 100000000; @@ -196,8 +194,8 @@ You can declare more features: [ContractSourceCode("https://github.com/neo-project/neo-devpack-dotnet/tree/master/examples/")] [ContractVersion("0.0.1")] [DisplayName("SampleNep17Token")] -[SupportedStandards("NEP-17")] -[ContractPermission("*", "onNEP17Payment")] +[SupportedStandards(NepStandard.Nep17)] +[ContractPermission(Permission.Any, "onNEP17Payment")] [ContractTrust("0x0a0b00ff00ff00ff00ff00ff00ff00ff00ff00a4")] [ManifestExtra("WebSite", "https://neo.org")] public class Contract1 : SmartContract @@ -210,7 +208,7 @@ public class Contract1 : SmartContract ``` - `DisplayName`: The name of the nef and manifest.json files generated by the compiler, and the DisplayName is also written to the name field of manifest.json. -- `SupportedStandards`: The NEP standards the contract conform to, such as NEP-17, a token standard on Neo. +- `SupportedStandards`: The NEP standards the contract conform to, such as `NepStandard.Nep17`, a token standard on Neo. - `ContractPermission` : The permission requested by the contract, and `ContractTrust` indicates which contracts trust the contract to call itself. See [invocation-permission](../deploy/invoke.md#invocation-permission). - `ContractAuthor`: The author field, which can be filled with the author's name and email address. It will output to the extra json object in manifest.json. - `ContractEmail`: The email field. It will be output to the extra json object in manifest.json. @@ -224,7 +222,9 @@ The generated manifest is as follows: ```json { "name": "SampleNep17Token", - "supportedstandards": [], + "supportedstandards": [ + "NEP-17" + ], "abi": { }, "permissions": [ diff --git a/docs/n3/develop/write/difference.md b/docs/n3/develop/write/difference.md index 54d2a14..062c424 100644 --- a/docs/n3/develop/write/difference.md +++ b/docs/n3/develop/write/difference.md @@ -57,9 +57,9 @@ using System; | | Neo Legacy | Neo N3 | | ----------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| Contract info | You need to fill in contract information such as the name, author, email, etc. when deploying the contract. | Add the contract features to the contract file, written as [C# Features](https://docs.microsoft.com/zh-cn/dotnet/csharp/programming-guide/concepts/attributes/), for example:
[ManifestExtra("Author", "Neo")]
[ManifestExtra("Email", "dev@neo.org")]
[ContractTrust("\*")]
[ContractPermission("\*", "\*")]
[SupportedStandards("NEP-17")]
[ManifestExtra("Description", "This is a contract example")]
public class Contract1 : SmartContract | +| Contract info | You need to fill in contract information such as the name, author, email, etc. when deploying the contract. | Add the contract features to the contract file, written as [C# Features](https://docs.microsoft.com/zh-cn/dotnet/csharp/programming-guide/concepts/attributes/), for example:
[ContractAuthor("core-dev", "dev@neo.org")]
[ContractEmail("dev@neo.org")]
[ContractDescription("A sample NEP-17 token")]
[ContractPermission(Permission.Any, Method.Any)]
[ContractTrust(Permission.Any)]
[SupportedStandards(NepStandard.Nep17)]
public class Contract1 : SmartContract | | Contract function | When deploying a contract, you need to declare contract features such as whether to use storage, whether it can be called dynamically, and whether to accept NEP-5 assets. | All contracts can use the storage and dynamic calls by default. You can implement the OnNEP17Payment method to accept NEP-17 assets and implement the OnNEP11Payment method to accept NEP-11 (NFT standard) assets. | -| Declare support for NEP | Code example:
public static string[] SupportedStandards()
{
string[] result = { "NEP-5", "NEP-7", "NEP-10" };
return result;
} | Directly add the feature to the contract class name `[SupportedStandards("NEP-17")]` | +| Declare support for NEP | Code example:
public static string[] SupportedStandards()
{
string[] result = { "NEP-11", "NEP-17", "NEP-24" };
return result;
} | Directly add the feature to the contract class name `[SupportedStandards(NepStandard.Nep17)]` | ### Declaration of static variables @@ -72,8 +72,7 @@ private static readonly byte[] InitialOwnerScriptHash = "AJhZmdHxW44FWMiMxD5bTiF Neo N3 ```cs -[InitialValue("NiNmXL8FjEUEs1nfX9uHFBNaenxDHJtmuB", ContractParameterType.Hash160)] -static readonly UInt160 Owner = default; +static readonly UInt160 Owner = "NiNmXL8FjEUEs1nfX9uHFBNaenxDHJtmuB"; ``` ### Methods and Events diff --git a/docs/n3/develop/write/nep11.md b/docs/n3/develop/write/nep11.md index d48dbe9..0185d67 100644 --- a/docs/n3/develop/write/nep11.md +++ b/docs/n3/develop/write/nep11.md @@ -74,12 +74,11 @@ using System; namespace Contract1 { - [SupportedStandards("NEP-11")] + [SupportedStandards(NepStandard.Nep11)] public class Contract1 : Nep11Token { //TODO: Replace it with your own address. - [InitialValue("NiNmXL8FjEUEs1nfX9uHFBNaenxDHJtmuB", ContractParameterType.Hash160)] - static readonly UInt160 Owner = default; + static readonly UInt160 Owner = "NiNmXL8FjEUEs1nfX9uHFBNaenxDHJtmuB"; private static bool IsOwner() => Runtime.CheckWitness(Owner); @@ -155,7 +154,7 @@ The base class `Nep11Token` also provides the following methods and events: ### Compatibility check -Compatibility checks will be activated for any contract that includes the `[SupportedStandards("NEP-17")]` or `[SupportedStandards("NEP-11")]` attribute. +Compatibility checks will be activated for any contract that includes the `[SupportedStandards(NepStandard.Nep17)]` or `[SupportedStandards(NepStandard.Nep11)]` attribute. The Compatibility Check reviews method names, parameters, return values, events, and similar elements to ensure they comply with the standard, and alerts about any failures in the check. ### NFT Royalty Standard diff --git a/docs/n3/develop/write/nep17.md b/docs/n3/develop/write/nep17.md index 4a98b73..889785d 100644 --- a/docs/n3/develop/write/nep17.md +++ b/docs/n3/develop/write/nep17.md @@ -286,7 +286,7 @@ The name method is moved to the manifest file, and you need to add `[DisplayName [ContractAuthor("core-dev", "dev@neo.org")] [ContractEmail("dev@neo.org")] [ContractDescription("This is a NEP17 example")] -[SupportedStandards("NEP-17")] +[SupportedStandards(NepStandard.Nep17)] public class NEP17 : Nep17Token { public override string Symbol { [Safe] get => "EXAMPLE"; } @@ -309,6 +309,6 @@ The ability of the contract to receive assets has been changed from a fixed cons ### Compatibility check -Compatibility checks will be activated for any contract that includes the `[SupportedStandards("NEP-17")]` or `[SupportedStandards("NEP-11")]` attribute. +Compatibility checks will be activated for any contract that includes the `[SupportedStandards(NepStandard.Nep17)]`, `[SupportedStandards(NepStandard.Nep11)]` or `[SupportedStandards(NepStandard.Nep24)]` attribute. The Compatibility Check reviews method names, parameters, return values, events, and similar elements to ensure they comply with the standard, and alerts about any failures in the check. diff --git a/docs/n3/exchange/client.md b/docs/n3/exchange/client.md index 3b1ee43..2a5679d 100644 --- a/docs/n3/exchange/client.md +++ b/docs/n3/exchange/client.md @@ -84,7 +84,7 @@ There are two methods to generate deposit addresses: - When the user deposit (NEO/GAS) for the first time, the program dynamically generates a NEO address. The advantage is that there is no need to generate addresses at fixed time intervals, while the disadvantage is that it's not convenient for backup. - To develop the program to dynamically generate addresses, use the RpcServer API [getnewaddress Method](../reference/rpc/latest-version/api/getnewaddress). The created address is returned. + To develop the program to dynamically generate addresses, use the RpcServer API [getnewaddress Method](../reference/rpc/getnewaddress). The created address is returned. - The exchange creates a batch of NEO addresses in advance. When the user charges (NEO/GAS) for the first time, the exchange assigns a NEO address to him or her. The advantage is the convenience to backup the wallet, while the disadvantage is the need to generate NEO addresses manually. To generate addresses in batch, run the NEO- CLI command `create address [n]`. The addresses are exported automatically to the address.txt file. diff --git a/docs/n3/exchange/gas.md b/docs/n3/exchange/gas.md index 6392f84..2c6b0ca 100644 --- a/docs/n3/exchange/gas.md +++ b/docs/n3/exchange/gas.md @@ -45,7 +45,7 @@ The following RPC method can be used to help exchanges query users' GAS informat | Method | Description | | ------------------------------------------------------------ | ------------------------------------------------------- | -| [getunclaimedgas](../reference/rpc/latest-version/api/getunclaimedgas.md) | Returns the unclaimed GAS amount in the current wallet. | +| [getunclaimedgas](../reference/rpc/getunclaimedgas.md) | Returns the unclaimed GAS amount in the current wallet. | ## Claiming GAS diff --git a/docs/n3/foundation/Wallets.md b/docs/n3/foundation/Wallets.md index cf3eab8..6a16113 100644 --- a/docs/n3/foundation/Wallets.md +++ b/docs/n3/foundation/Wallets.md @@ -369,7 +369,7 @@ Example: The full-node wallet is a complete backup of blockchain data, which saves all the onchain data and participates in p2p network, therefore it needs a large storage space. -Neo-CLI and Neo-GUI are all full-node wallet. For more information refer to [Neo node](../../node/introduction.md). +Neo-CLI and Neo-GUI are all full-node wallet. For more information refer to [Neo node](../node/introduction.md). ### SPV wallet diff --git a/docs/n3/node/cli/config.md b/docs/n3/node/cli/config.md index f257d2a..6203ae7 100644 --- a/docs/n3/node/cli/config.md +++ b/docs/n3/node/cli/config.md @@ -106,7 +106,7 @@ The following table lists all the plugins: |Plugin|Description|API Included|| |--- |--- |--- |--- | -|ApplicationLogs|Synchronizes the smart contract log with the NativeContract log (Notify)|[getapplicationlog](../../reference/rpc/latest-version/api/getapplicationlog)|Recommended| +|ApplicationLogs|Synchronizes the smart contract log with the NativeContract log (Notify)|[getapplicationlog](../../reference/rpc/getapplicationlog)|Recommended| |DBFTPlugin|dBFT consensus plugin||Mandatory when served as a consensus node| |LevelDBStore|Uses LevelDB to store the blockchain data||Mandatory| |MPTTrie|Uses LevelDB to store the MPT data||Mandatory when served as a StateRoot consensus node| @@ -115,8 +115,8 @@ The following table lists all the plugins: |RpcServer|Enables RPC for the node|[RPC API](../../reference/rpc/latest-version/api)|Mandatory| |SQLiteWallet|A SQLite-based wallet provider that supports wallet files with .db3 suffix||Optional| |StatesDumper|Exports Neo-CLI status data.||Optional| -|StateService|StateRoot consensus service plugin|[getstateroot](../../reference/rpc/latest-version/api/getstateroot) [getproof](../../reference/rpc/latest-version/api/getproof) [verifyproof](../../reference/rpc/latest-version/api/verifyproof.md) [getstateheight](../../reference/rpc/latest-version/api/getstateheight.md) |Mandatory when served as a StateRoot consensus node| -|TokensTracker|Enquiries NEP-11 and NEP-17 assets balance and transactions history of accounts through RPC|[getnep11balances](../../reference/rpc/latest-version/api/getnep11balances) [getnep11properties](../../reference/rpc/latest-version/api/getnep11properties) [getnep11transfers](../../reference/rpc/latest-version/api/getnep11transfers) [getnep17balances](../../reference/rpc/latest-version/api/getnep17balances) [getnep17transfers](../../reference/rpc/latest-version/api/getnep17transfers) |Recommended| +|StateService|StateRoot consensus service plugin|[getstateroot](../../reference/rpc/getstateroot) [getproof](../../reference/rpc/getproof) [verifyproof](../../reference/rpc/verifyproof.md) [getstateheight](../../reference/rpc/getstateheight.md) |Mandatory when served as a StateRoot consensus node| +|TokensTracker|Enquiries NEP-11 and NEP-17 assets balance and transactions history of accounts through RPC|[getnep11balances](../../reference/rpc/getnep11balances) [getnep11properties](../../reference/rpc/getnep11properties) [getnep11transfers](../../reference/rpc/getnep11transfers) [getnep17balances](../../reference/rpc/getnep17balances) [getnep17transfers](../../reference/rpc/getnep17transfers) |Recommended| You can choose one of the following ways to install plugins: diff --git a/docs/n3/reference/rpc/api.md b/docs/n3/reference/rpc/api.md new file mode 100644 index 0000000..37364e0 --- /dev/null +++ b/docs/n3/reference/rpc/api.md @@ -0,0 +1,191 @@ +# API Reference + +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 must install the plugin [RpcServer](https://github.com/neo-project/neo-modules/releases). Refer to [Installing plugins](../../node/cli/config#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 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 + +``` +http://127.0.0.1:10332/ +``` + +You can modify the port in config.json in the RpcServer folder. + +## Command Lists + +### Blockchain + +| Method | Parameter | Description | +| --------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------ | +| [getbestblockhash](getbestblockhash.md) | | Gets the hash of the latest block in the blockchain. | +| [getblock](getblock.md) | [verbose=0] | Returns the block information with the specified hash value or index. | +| [getblockcount](getblockcount.md) | | Gets the block count of the blockchain. | +| [getblockhash](getblockhash.md) | | Returns the block hash with the specified index. | +| [getblockheader](getblockheader.md) | [verbose=0] | Returns the information of the block header with the specified script hash or index. | +| [getcommittee](getcommittee.md) | | Gets the public key list of current Neo committee members. | +| [getnativecontracts](getnativecontracts.md) | | Gets the list of native contracts. | +| [getnextblockvalidators](getnextblockvalidators.md) | | Gets the validators list of the next block. | +| [getcontractstate](getcontractstate.md) | | Returns information of the contract with the specified script hash. | +| [getrawmempool](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](getrawtransaction.md) | [verbose=0] | Returns the transaction information with the specified hash value. | +| [getstorage](getstorage.md) | | Returns the value with the contract script hash and the key. | +| [gettransactionheight](gettransactionheight.md) | | Returns the transaction height with the specified transaction hash. | +| [findStorage](findStorage.md) | \ | Finds storage items by contract ID or script hash and prefix. | + + +### Node + +| Method | Parameter | Description | +| --------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------ | +| [getconnectioncount](getconnectioncount.md) | | Gets the current connection count of the node. | +| [getpeers](getpeers.md) | | Gets a list of nodes that are currently connected/disconnected by this node. | +| [getversion](getversion.md) | | Gets the version information of the node. | +| [sendrawtransaction](sendrawtransaction.md) | | Broadcasts a transaction over the network. | +| [submitblock](submitblock.md) | | Submits a new block to the network.
**Note**: Need to be a validator | + +### Smart Contract + +| Method | Parameter | Description | +| --------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------ | +| [getunclaimedgas](getunclaimedgas.md) | | Get unclaimed gas of the specified address. | +| [invokefunction](invokefunction.md) | \[params] \[sender] \[signers] | Invokes a smart contract with the specified script hash, passing in the method name and its params. | +| [invokescript](invokescript.md) | \[sender] \[signers] | Runs a script through the virtual machine and returns the results. | +| [traverseiterator](traverseiterator.md) | `` `` `` | Gets the Iterator type data. | + +### Tool + +| Method | Parameter | Description | +| --------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------ | +| [listplugins](listplugins.md) | | Returns a list of plugins loaded by the node. | +| [validateaddress](validateaddress.md) | | Verifies whether the address is a valid NEO address. | + +### Wallet + +| Method | Parameter | Description | +| --------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------ | +| [calculatenetworkfee](calculatenetworkfee.md) | | Calculates network fee for the specified transaction. | +| [closewallet](closewallet.md) | | Closes the current wallet. | +| [dumpprivkey](dumpprivkey.md) | | Exports the private key of the specified address. | +| [getnewaddress](getnewaddress.md) | | Creates a new address. | +| [getwalletbalance](getwalletbalance.md) | | Returns the balance of the corresponding asset in the wallet. | +| [getwalletunclaimedgas](getwalletunclaimedgas.md) | | Gets the amount of unclaimed GAS in the wallet. | +| [importprivkey](importprivkey.md) | | Imports the private key to the wallet. | +| [invokecontractverify](invokecontractverify.md) | \[params] \[signers] | Invokes the verification method of contract. | +| [listaddress](listaddress.md) | | Lists all the addresses in the current wallet. | +| [openwallet](openwallet.md) | | Opens the specified wallet. | +| [sendfrom](sendfrom.md) | | Transfers from the specified address to the destination address. | +| [sendmany](sendmany.md) | \[signers] | Initiates multiple transfers to multiple addresses in a transaction. | +| [sendtoaddress](sendtoaddress.md) | \[signers] | Transfers to the specified address. | + +### ApplicationLogs plugin + +| Method | Parameter | Description | +| --------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------ | +| [getapplicationlog](getapplicationlog.md) | | Returns the contract event information based on the specified txid. | + +### TokensTracker plugin + +| Method | Parameter | Description | +| --------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------ | +| [getnep11balances](getnep11balances.md) | | Returns the balance of all NEP11 assets in the specified address. | +| [getnep11properties](getnep11properties.md) | | Returns the customized properties of NEP-11 assets. | +| [getnep11transfers](getnep17transfers.md) | [timestamp] | Returns all the NEP11 transaction information occurred in the specified address. | +| [getnep17balances](getnep17balances.md) | | Returns the balance of all NEP17 assets in the specified address. | +| [getnep17transfers](getnep17transfers.md) | [timestamp] | Returns all the NEP17 transaction information occurred in the specified address. | + +### StateService plugin + +| Method | Parameter | Description | +| --------------------------------------- | ----------------------------------------------- | ------------------------------------------------------------ | +| [getstateroot](getstateroot.md) | | Queries the state root by the block height. | +| [getproof](getproof.md) | | Gets proof by querying root hash, contract hash, and storage key. | +| [verifyproof](verifyproof.md) | | Verifies using the root hash and proof, and gets the value of the storage corresponding to the key. | +| [getstateheight](getstateheight.md) | | Queries the stateroot height. | +| [getstate](getstate.md) | | Queries `state` with the `root hash`, `contract hash` and `storage key`. | +| [findstates](findstates.md) | [key] [count] | Queries `state` with the prefix of `root hash`, `contract hash` and `storage key`. | + +:::note + +For RPC API, all the return values related to the amount such as fees, NEP-17 asset balance, wallet balance, transfer amount, etc. are unsigned integer, which are automatically converted according to the asset decimal when requested by [RpcClient](https://github.com/neo-project/neo-modules/tree/master/src/RpcClient) (C# light node SDK). If you write the request by yourselves, you need to convert the amount manually. For example, if the return value is 1234560 and the asset decimal is 8, the actual amount is 0.0123456. +::: + +## GET request example + +The format of a typical JSON-RPC GET request is as follows: + +Here is an example of how to get the number of blocks in the block chain. + +Request URL: + +``` +http://127.0.0.1:10332?jsonrpc=2.0&method=getblockcount¶ms=[]&id=1 +``` + +After sending the request, you will get the following response: + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": 909129 +} +``` + +## POST request example + +The format of a typical JSON-RPC Post request is as follows: + +Here is an example of how to get the number of blocks in the block chain. + +Request URL: + +``` +http://127.0.0.1:10332 +``` + +Request Body: + +```json +{ + "jsonrpc": "2.0", + "method": "getblockcount", + "params":[], + "id": 1 +} +``` + +After sending the request, you will get the following response: + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": 909122 +} +``` + +:::note +To make sure you get the latest result synchronize your client to the latest block height before you use the API. +::: + +## Test tools + +You can use the Chrome extension in Postman to facilitate the test (Installation of the Chrome extension requires Internet connection). A test screenshot is shown below: + +![image](../../assets/api_3.jpg) + +## See also + +[C# JSON-RPC Command List](https://github.com/chenzhitong/CSharp-JSON-RPC/blob/master/json_rpc/Program.cs) diff --git a/docs/n3/reference/rpc/latest-version/api/calculatenetworkfee.md b/docs/n3/reference/rpc/calculatenetworkfee.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/calculatenetworkfee.md rename to docs/n3/reference/rpc/calculatenetworkfee.md diff --git a/docs/n3/reference/rpc/latest-version/api/closewallet.md b/docs/n3/reference/rpc/closewallet.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/closewallet.md rename to docs/n3/reference/rpc/closewallet.md diff --git a/docs/n3/reference/rpc/latest-version/api/dumpprivkey.md b/docs/n3/reference/rpc/dumpprivkey.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/dumpprivkey.md rename to docs/n3/reference/rpc/dumpprivkey.md diff --git a/docs/n3/reference/rpc/latest-version/api/findstates.md b/docs/n3/reference/rpc/findstates.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/findstates.md rename to docs/n3/reference/rpc/findstates.md diff --git a/docs/n3/reference/rpc/findstorage.md b/docs/n3/reference/rpc/findstorage.md new file mode 100644 index 0000000..c57884f --- /dev/null +++ b/docs/n3/reference/rpc/findstorage.md @@ -0,0 +1,258 @@ +# findstorage Method + +Finds storage items by contract ID or script hash and prefix. + +:::note +You must install the plugin [RpcServer](https://github.com/neo-project/neo-modules/releases) before you can invoke the method. +::: + +## Parameter Description + +- script_hash / contract_id / native_contract_name: Contract script hash or Contract ID or the native contract name. + + Such as: `-5`, `0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5`, `neotoken`. + + If you want to look up the name or ID of a native contract, you can use the [getnativecontracts](getnativecontracts.md) method. + + | Native Contract Name | ID | ScriptHash | + | -------------------- | ---- | ------------------------------------------ | + | ContractManagement | -1 | 0xfffdc93764dbaddd97c48f252a53ea4643faa3fd | + | StdLib | -2 | 0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0 | + | CryptoLib | -3 | 0x726cb6e0cd8628a1350a611384688911ab75f51b | + | LedgerContract | -4 | 0xda65b600f7124ce6c79950c1772a36403104f2be | + | NeoToken | -5 | 0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5 | + | GasToken | -6 | 0xd2a4cff31913016155e38e474a2c06d08be276cf | + | PolicyContract | -7 | 0xcc5e4edd9f5f8dba8bb65734541df7a1c081c67b | + | RoleManagement | -8 | 0x49cf4e5378ffcd4dec034fd98a174c5491e395e2 | + | OracleContract | -9 | 0xfe924b7cfe89ddd271abaf7210a80a7e11178758 | + +- The Base64-encoded storage key prefix as the second element +- Optional, start index as the third element + +## Example + +Request body: + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "method": "findstorage", + "params": [2, "AQ==", 0] +} +``` + +Response body: + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "truncated": true, + "next": 50, + "results": [ + { + "key": "AQEC", + "value": "jgg=" + }, + { + "key": "AQED", + "value": "kgI=" + }, + { + "key": "AQEF", + "value": "mQg=" + }, + { + "key": "AQEG", + "value": "zws=" + }, + { + "key": "AQEH", + "value": "Wg==" + }, + { + "key": "AQEOAAAAAAAAAA==", + "value": "AQ==" + }, + { + "key": "AQER", + "value": "UgE=" + }, + { + "key": "AQET", + "value": "Dg==" + }, + { + "key": "AQEV", + "value": "Kg==" + }, + { + "key": "AQEY", + "value": "Aw==" + }, + { + "key": "AQEv", + "value": "SA==" + }, + { + "key": "AQIC", + "value": "IDBoVQlE//8riM8rS+bOlbcW3CPCD/M/qfhv8PneRZtYIGHzUUvyv+uBcH/swZNLm/dBWtI95T7kExytNDIqat32FMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShRGsuAiTvsD1D66iKtaGZVIDmp2thTe4ezMLkbmNuifSZasJ4gVwrySlVkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAAE=", + "value": "IAt4TatO+xK4M3nHm1531ygMf7Zam/XlE+JO7tfqkBqNIHBn+/jVKcBauD7GH6o/T+Mo+3oUrp7OI4ceFyPxpKF7FMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShTr0OiYisJaeT3Cc2j5alpy40781xRnpSBx9+6wvFOEzMguWYpQKjQyACt6CmkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAAI=", + "value": "IL28o+a8U5LC/8daTy64xdeEDoTRyy7LX5Khl9IZXvtFIDkLq7jOwOQQBKBfy1JxLsADvALdsNjdLdhLWGrQmPZ4FMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShQ1YJ3FnhXQPFyGVQfhNI+lq7MZqBQHcUqL8HNRCZbZSNiqOfjjJif+YgBQOSeMBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAAM=", + "value": "IN7VDXm4N5YpCIBHYlJ2tufvbt/m1alj9RlWN78DxmddIBmmp7sZRLWoboMu4KWfzCt9rUYI6sY6GorGROAvHvLCFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShRGsuAiTvsD1D66iKtaGZVIDmp2thSBhGochL9wGt4VRnP0lGFt8B+1m3aNqGqJ9vp9AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAAQ=", + "value": "IIyThvR41WPIe/YV3XL3aeqmpQPDlYcBZ/5Ejfi2C+x9IHqzdDgkjDL5+Ku2X8ul41snoVkvLz7ccVMV3dXTrQcvFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBQAIMUiKiTkqWtyDAa4A/uNNK3Ar5JgJXoLAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAAU=", + "value": "IFmoHjRV3DcuGhSHecqACxfV5zrKP/F8yBmV42yTRb34IFKPd8XEnkcCfDXH4iZE9/lSl8fLhEENcm6B5uqb4WO0FMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAU7fGVtuqCfPIdHMM3vCDjX1H36w8GdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBQhENLe5PMUx/IVUcrNHLeA24kgkwDh9QUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAAY=", + "value": "IP1vpwxGhvznmOTSGvDJqOeRH/stVwYdWuFVSfti0MxbIIaJ3clKvFb7omb/DotN2Qf96+8f4oXOsroX5Wq1FE9ZFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAU7fGVtuqCfPIdHMM3vCDjX1H36w8GdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBTweP+chIZiJkjhf74T3OBGguV44KJ7vx0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAAc=", + "value": "IDUsx8tgPvDNk8RnBEtb2eFQ6dPR1YuM8q6PdkhzbI43ICU+zexD1HloXH7toafCkaCsWpe4I8O9G6cQAiTCQHXXFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAU7fGVtuqCfPIdHMM3vCDjX1H36w8GdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBQyB78Lyw9hZ2VhrCeyO8PClLvSviLaQZoGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAAg=", + "value": "IE69zY83FSkeRzrAbaGsN8i7rlKH3Bls2Xv+Ok38npZkIKhgzBvS7n3/4f1Rg0qrMEuX0PnrclUhI95qKfLqb/zQFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAU7fGVtuqCfPIdHMM3vCDjX1H36w8GdW5sb2NrRBSpNyfoZh1Pgs/VD32P0/OOyEk7hA4rAAAACgcAAAAKAAQAAEBCDwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAQ==", + "value": "INI2eRc3Nw88tnDMrCIqdtQ/K8nDY2KbP2dK7UxwrsrnIOo4xLoCozGabr0c5yLgqNkER+7tiCibIpElpmHA4cjRFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShRGsuAiTvsD1D66iKtaGZVIDmp2thTe4ezMLkbmNuifSZasJ4gVwrySlVkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAQE=", + "value": "IGLZai0XTwa8OrqYd8EaLEWjpXISq5R3TH0Ew1peMdDrIME/97rpwQRo5FAXmP7pzLKVEMWWoNDpD4MGz3LQOclyFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBRnpSBx9+6wvFOEzMguWYpQKjQyAACIUmp0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAQI=", + "value": "IMJrLm34OJnxvXW3G3q1J3O9m6qsvf+gCQFCaDMbK/aAIN2i3R5oUgPexnMipdWwISm1pp23DcmWfP+AC3Ol1xfZFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShRGsuAiTvsD1D66iKtaGZVIDmp2thRTFWrDso21R/ZtPiwKOwnURfEqDwAAuJ0NaVWgAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAQM=", + "value": "IGrjEllwW443Y4Hr0l/24SKhOkFlpfouRPumDvxpjYXOIOp71mnYoNFN2au7KECslu0wBw6npk/aH3tKPMY9VlnpFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBTweP+chIZiJkjhf74T3OBGguV44EGOGx0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAQQ=", + "value": "ICJnrgM85soDWXQXy7O3PPMODL1c+RTsh4aYTqP6jOIcICcDZj+2/dNR81lNCYNO0lr40D9iI6TAjmCrFZvqFVBdFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBRIcTj7FTZPGSqjRIsM6fhiUjiJHcxqAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAQU=", + "value": "IKq2EyLZgl+FpONH5jI9mfRiGPNyaeiSMtOI/7EWEzDqIPCsWZQbtoZNVEjysuUfM0CGIegIht2j1qaiDQSuWdXbFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAU7fGVtuqCfPIdHMM3vCDjX1H36w8GdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBQhENLe5PMUx/IVUcrNHLeA24kgk3/j3WsNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAQY=", + "value": "INLDA14Ygam6hCImErbWWhriVAUBhyFrC9ZQgIpZBqAsII4tBjQSeZpm2+BWIJPWdylihfwmbUEXsFsto95mq+s0FMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAU7fGVtuqCfPIdHMM3vCDjX1H36w8GdW5sb2NrShTr0OiYisJaeT3Cc2j5alpy40781xR/DJCRa3o+qrGFtWJmpTezfyNYKwDh9QUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAQc=", + "value": "ILY9mV70FO0/84XAzHg061/LitHOxl6x/BI3iZBrxmKlIMnCRfshFjTMvClMIDTFaMdnwtZSnXm7NlsmwSKxjw8IFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAU7fGVtuqCfPIdHMM3vCDjX1H36w8GdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBQqe36HO6SRjH6NISVlIRbqEv3xd+8kXncAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAQg=", + "value": "IHmwRujscwLk1UW/7A+d8dPaqw6rlTHnVqNCNs3PD7rTIN2ZNOvBCfoPrKNgQv1KTWVpE1U4brf5NFHFUE2HVdWlFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAU7fGVtuqCfPIdHMM3vCDjX1H36w8GdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBRuYui24Ms2DkqZG2JGBtW3OiPrwQDkC1QCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAg==", + "value": "IECVSSqXgJw8nO4JSDcKp80uQB4nCvxR7CRkMeuP/yT2IHxZc5XoeCPRGn1TigvZ5ZKmPZO+AO/wnYxu3NTOXMJHFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShRGsuAiTvsD1D66iKtaGZVIDmp2thTe4ezMLkbmNuifSZasJ4gVwrySlVkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAgE=", + "value": "IIjZG9callfZTNoWgrCW01EMqdpW0DC8OpkaYS8QCdywID9POIFJCYczJKs5e0lcqpIqBnqRz7tPEPKDpVKSoMIcFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBRnpSBx9+6wvFOEzMguWYpQKjQyAADh9QUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAgI=", + "value": "IENA1TdJAFeeiQYC+ydL5nFDmBylbAHBfkzdPSYKTk/0IBTvqQeHl1tz24yRM40NIiXgiOn05B6RTsnuapovOLhSFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShTr0OiYisJaeT3Cc2j5alpy40781xRTFWrDso21R/ZtPiwKOwnURfEqDx6qKwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAgM=", + "value": "IEst7ph/2E2JXHivmA2las4fsD9sbv1lCOmENItFg3gFIFXZcXDirdcxkv5BvJ40ksRDQYrG7YG54jKkDppec5GcFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShRGsuAiTvsD1D66iKtaGZVIDmp2thTeuLPKf50K8VJ9UzZMkr0XLnGOQiiOYHZ8Z4EGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAgQ=", + "value": "IGuNEtUfd3O6J2hfU2K57K1ugAIL4PtagKMonXldp5REII0sJEwm8xL9ZH54vvQb+wyCp1d93APPKHG3uxvswui9FMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBTygzezvk1enlaQAeYUP6ZPK4DAuKkqNiIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAgU=", + "value": "IBSuwZ+IcZElfH/NvvuI6ke1RMTrydSydcwdh0d9wGgjIEYuqGtgBJGKL6Zg+szspl8dyNeAW7CoUxpeAtE8U6cCFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAU7fGVtuqCfPIdHMM3vCDjX1H36w8GdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBQhENLe5PMUx/IVUcrNHLeA24kgkwA8U0wQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAgY=", + "value": "IMzOz6zUjI21WxOrEe9hFvb/R+1PaqkRWcNDRTqCgbh+IG6q2f46SNoSV0kkjrSw3MO3A4xHbmaACnqVjtwGCsPLFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAU7fGVtuqCfPIdHMM3vCDjX1H36w8GdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBTUMc/HEe6ox5C7O5kT3TXq3p+mEQB1K30AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAgc=", + "value": "IPFWY2zD7AqAviDv68WQrMA+422Vncdy7tqhU9Kr57owIIWysbc5+abZHQgQ8MUV4tum+pR+RtG/ojoV47fliFmRFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAU7fGVtuqCfPIdHMM3vCDjX1H36w8GdW5sb2NrShTr0OiYisJaeT3Cc2j5alpy40781xSYIGyoW8jdtcCvF7kCEmrbqrkGZlw3ewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAgg=", + "value": "IBcZsxvS7QVMC4ZEJBewke0nff4DsOcRSMepoamGvYAIII1vrLIcaP0wzeCabm8FuzOZp58/MZKBrL8NgefZZyKAFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAU7fGVtuqCfPIdHMM3vCDjX1H36w8GdW5sb2NrShRGsuAiTvsD1D66iKtaGZVIDmp2thQYMMAFz+MXMKvJd63kZi7JYQw6WhWEGmFAEkkOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAw==", + "value": "IOhPo6pH0zZoHB1M5psStUhFtZIwhHx85hTT0P7wx747IPdDKuK9mIzWLCa4exrpJ+4I5URy+QEKI1MB2xv38JHoFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShRGsuAiTvsD1D66iKtaGZVIDmp2thRuYui24Ms2DkqZG2JGBtW3OiPrwat+6MC+MtgCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAwE=", + "value": "IJiKaMZfFBhOOHfJXYgeSzmuNynbYRDqwwYpQ0iTjKsNILsaEgVFWe7Mh62ugGs+uvnlJ4qMDUxxtqz2RZhqiYRiFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBRghpFyOHv1S5KaeLQ4ek38FG2Bo6l5GikBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAwI=", + "value": "IOqVnkOtqc7mnO5gUmhtt1MQOuHnnmLsk1KvhXFlZrCFICIEvcjNzZ3ygUZiizXf7Sygj9LFkPg3m/c1Lup3XQg/FMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShRGsuAiTvsD1D66iKtaGZVIDmp2thR5UyqSYiWfw49ofpVt9kcgp1DpF0kXzoOpm0MDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAwM=", + "value": "IEu4IpjWqSWRjzmQXiac/YXVL+CUy8sXAVSTnTm/2FVPICROtxBSamlY+xaPt2JWMPaQo6k/gGKHca5dvoKOzVbdFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBSDDrQRmHw0hpvX3a9TaVuHbeBGASkiOZRAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAwQ=", + "value": "II7YL6PU0Ev7bitytKMRitwRlu+5+cvHVhGMBhSZkIeVIF9/Fv4SiVRBPloWFJ1snHCit7R1NLLG0IimzTg4LHs3FMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShRGsuAiTvsD1D66iKtaGZVIDmp2thR0xEEfvahF5HICZ73J2hZRjd4n5QC8OtyIKFowAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAwU=", + "value": "IGdJ8kU2oi+ZNw0yGmJwocAqcngPpxA1jihOHT03nJRsIENrnpwMy+zj712Lvngx9dJI0bJ/5H1zEW9S9ZWum3iPFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAU7fGVtuqCfPIdHMM3vCDjX1H36w8GdW5sb2NrShRGsuAiTvsD1D66iKtaGZVIDmp2thTe4ezMLkbmNuifSZasJ4gVwrySlQAA3M6GtCrQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAwY=", + "value": "IG24NGZW1uZXHcX5bD/VELS+xPW+7vz/yvcb8PfJIum8IPQodc0TEUS0QTUpN7M25+enRFu4oE+GJIUwnNjNWArxFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAU7fGVtuqCfPIdHMM3vCDjX1H36w8GdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBTUMc/HEe6ox5C7O5kT3TXq3p+mEQDxU2UAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAwc=", + "value": "IO/VS9H2+A6eX9ok2Jjq8D1X/ga8RazOJERxR9/jEgMKIJSjiwf14Pg54rOGExCKCkYdn/r8n8XD7FHXHVA4SsJhFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAU7fGVtuqCfPIdHMM3vCDjX1H36w8GdW5sb2NrShTr0OiYisJaeT3Cc2j5alpy40781xSYIGyoW8jdtcCvF7kCEmrbqrkGZkemegAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICAwg=", + "value": "IAO14gtiOkqvELUNqDS4D/5Ljrd8Px6yPgT5jN0wpsYrIJ72fQPZHZSV/4n3yI2ReSE/eM8Ir4o+aKh2U6et941aFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAU7fGVtuqCfPIdHMM3vCDjX1H36w8GdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBTYGo88P4sAbvGuSi/Shpmtfj4hxdmbBQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICBA==", + "value": "IBTNLc0fWIMDjBxvTMzcDyi0qe3HhAawYGGXr3oBdRvQIMIpNzvyBJkbHqooJhv5NXZcnEYBlkJ8Jft5GkxbEni3FMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShRGsuAiTvsD1D66iKtaGZVIDmp2thRuYui24Ms2DkqZG2JGBtW3OiPrwd+Ifnh577ZLAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICBAE=", + "value": "IEg0uV8boe8rDXsi0WT/IUeIiSIOQstWZANBtDdMXUcHIIb4gGBA0aIzUPMNOqb1DYx7nJ9rb0NtGZcZiasBe+h8FMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShSpNyfoZh1Pgs/VD32P0/OOyEk7hBRnpSBx9+6wvFOEzMguWYpQKjQyAGYMiouOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "AQICBAI=", + "value": "IEyFCuNK0agZ+zrjLajii9MdHw3eHaQUEShomOvKdN6kIP+syzQUvowLPl3Uwt526b+jOnD7xm0zVZELozNQQ7FpFMtWlFN4FJfcsGe3PZWyiALLAVU4AgAAAAAAAAAUJQ52mH2DinUxDDS/Qi6p8axMyQYGdW5sb2NrShRGsuAiTvsD1D66iKtaGZVIDmp2thSxXW3T++mGIZwaxX+F6Fgn8ufu2KTo4q3tIWwBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + ] + } +} +``` diff --git a/docs/n3/reference/rpc/latest-version/api/getapplicationlog.md b/docs/n3/reference/rpc/getapplicationlog.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getapplicationlog.md rename to docs/n3/reference/rpc/getapplicationlog.md diff --git a/docs/n3/reference/rpc/latest-version/api/getbestblockhash.md b/docs/n3/reference/rpc/getbestblockhash.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getbestblockhash.md rename to docs/n3/reference/rpc/getbestblockhash.md diff --git a/docs/n3/reference/rpc/latest-version/api/getblock.md b/docs/n3/reference/rpc/getblock.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getblock.md rename to docs/n3/reference/rpc/getblock.md diff --git a/docs/n3/reference/rpc/latest-version/api/getblockcount.md b/docs/n3/reference/rpc/getblockcount.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getblockcount.md rename to docs/n3/reference/rpc/getblockcount.md diff --git a/docs/n3/reference/rpc/latest-version/api/getblockhash.md b/docs/n3/reference/rpc/getblockhash.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getblockhash.md rename to docs/n3/reference/rpc/getblockhash.md diff --git a/docs/n3/reference/rpc/latest-version/api/getblockheader.md b/docs/n3/reference/rpc/getblockheader.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getblockheader.md rename to docs/n3/reference/rpc/getblockheader.md diff --git a/docs/n3/reference/rpc/latest-version/api/getcommittee.md b/docs/n3/reference/rpc/getcommittee.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getcommittee.md rename to docs/n3/reference/rpc/getcommittee.md diff --git a/docs/n3/reference/rpc/latest-version/api/getconnectioncount.md b/docs/n3/reference/rpc/getconnectioncount.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getconnectioncount.md rename to docs/n3/reference/rpc/getconnectioncount.md diff --git a/docs/n3/reference/rpc/latest-version/api/getcontractstate.md b/docs/n3/reference/rpc/getcontractstate.md similarity index 92% rename from docs/n3/reference/rpc/latest-version/api/getcontractstate.md rename to docs/n3/reference/rpc/getcontractstate.md index 0b1f6ff..b09ad82 100644 --- a/docs/n3/reference/rpc/latest-version/api/getcontractstate.md +++ b/docs/n3/reference/rpc/getcontractstate.md @@ -8,7 +8,23 @@ You must install the plugin [RpcServer](https://github.com/neo-project/neo-modul ## Parameter Description -script_hash / name: Contract script hash or the native contract name. +- script_hash / contract_id / native_contract_name: Contract script hash or Contract ID or the native contract name. + + Such as: `-5`, `0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5`, `neotoken`. + + If you want to look up the name or ID of a native contract, you can use the [getnativecontracts](getnativecontracts.md) method. + + | Native Contract Name | ID | ScriptHash | +| -------------------- | ---- | ------------------------------------------ | +| ContractManagement | -1 | 0xfffdc93764dbaddd97c48f252a53ea4643faa3fd | +| StdLib | -2 | 0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0 | +| CryptoLib | -3 | 0x726cb6e0cd8628a1350a611384688911ab75f51b | +| LedgerContract | -4 | 0xda65b600f7124ce6c79950c1772a36403104f2be | +| NeoToken | -5 | 0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5 | +| GasToken | -6 | 0xd2a4cff31913016155e38e474a2c06d08be276cf | +| PolicyContract | -7 | 0xcc5e4edd9f5f8dba8bb65734541df7a1c081c67b | +| RoleManagement | -8 | 0x49cf4e5378ffcd4dec034fd98a174c5491e395e2 | +| OracleContract | -9 | 0xfe924b7cfe89ddd271abaf7210a80a7e11178758 | ## Example diff --git a/docs/n3/reference/rpc/latest-version/api/getnativecontracts.md b/docs/n3/reference/rpc/getnativecontracts.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getnativecontracts.md rename to docs/n3/reference/rpc/getnativecontracts.md diff --git a/docs/n3/reference/rpc/latest-version/api/getnep11balances.md b/docs/n3/reference/rpc/getnep11balances.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getnep11balances.md rename to docs/n3/reference/rpc/getnep11balances.md diff --git a/docs/n3/reference/rpc/latest-version/api/getnep11properties.md b/docs/n3/reference/rpc/getnep11properties.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getnep11properties.md rename to docs/n3/reference/rpc/getnep11properties.md diff --git a/docs/n3/reference/rpc/latest-version/api/getnep11transfers.md b/docs/n3/reference/rpc/getnep11transfers.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getnep11transfers.md rename to docs/n3/reference/rpc/getnep11transfers.md diff --git a/docs/n3/reference/rpc/latest-version/api/getnep17balances.md b/docs/n3/reference/rpc/getnep17balances.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getnep17balances.md rename to docs/n3/reference/rpc/getnep17balances.md diff --git a/docs/n3/reference/rpc/latest-version/api/getnep17transfers.md b/docs/n3/reference/rpc/getnep17transfers.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getnep17transfers.md rename to docs/n3/reference/rpc/getnep17transfers.md diff --git a/docs/n3/reference/rpc/latest-version/api/getnewaddress.md b/docs/n3/reference/rpc/getnewaddress.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getnewaddress.md rename to docs/n3/reference/rpc/getnewaddress.md diff --git a/docs/n3/reference/rpc/latest-version/api/getnextblockvalidators.md b/docs/n3/reference/rpc/getnextblockvalidators.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getnextblockvalidators.md rename to docs/n3/reference/rpc/getnextblockvalidators.md diff --git a/docs/n3/reference/rpc/latest-version/api/getpeers.md b/docs/n3/reference/rpc/getpeers.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getpeers.md rename to docs/n3/reference/rpc/getpeers.md diff --git a/docs/n3/reference/rpc/latest-version/api/getproof.md b/docs/n3/reference/rpc/getproof.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getproof.md rename to docs/n3/reference/rpc/getproof.md diff --git a/docs/n3/reference/rpc/latest-version/api/getrawmempool.md b/docs/n3/reference/rpc/getrawmempool.md similarity index 86% rename from docs/n3/reference/rpc/latest-version/api/getrawmempool.md rename to docs/n3/reference/rpc/getrawmempool.md index cd2696b..a6cbd53 100644 --- a/docs/n3/reference/rpc/latest-version/api/getrawmempool.md +++ b/docs/n3/reference/rpc/getrawmempool.md @@ -6,6 +6,13 @@ Obtains a list of confirmed / unconfirmed transactions in memory. You must install the plugin [RpcServer](https://github.com/neo-project/neo-modules/releases) before you can invoke the method. ::: +## Parameter Description + +shouldGetUnverified: Optional. The default value is `false`. + +- `true` or `1`: include unverified transactions. +- `false` or `0`: excluding unverified transactions + ## Examples ### Example 1 - Get verified transactions diff --git a/docs/n3/reference/rpc/latest-version/api/getrawtransaction.md b/docs/n3/reference/rpc/getrawtransaction.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getrawtransaction.md rename to docs/n3/reference/rpc/getrawtransaction.md diff --git a/docs/n3/reference/rpc/latest-version/api/getstate.md b/docs/n3/reference/rpc/getstate.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getstate.md rename to docs/n3/reference/rpc/getstate.md diff --git a/docs/n3/reference/rpc/latest-version/api/getstateheight.md b/docs/n3/reference/rpc/getstateheight.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getstateheight.md rename to docs/n3/reference/rpc/getstateheight.md diff --git a/docs/n3/reference/rpc/latest-version/api/getstateroot.md b/docs/n3/reference/rpc/getstateroot.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getstateroot.md rename to docs/n3/reference/rpc/getstateroot.md diff --git a/docs/n3/reference/rpc/latest-version/api/getstorage.md b/docs/n3/reference/rpc/getstorage.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getstorage.md rename to docs/n3/reference/rpc/getstorage.md diff --git a/docs/n3/reference/rpc/latest-version/api/gettransactionheight.md b/docs/n3/reference/rpc/gettransactionheight.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/gettransactionheight.md rename to docs/n3/reference/rpc/gettransactionheight.md diff --git a/docs/n3/reference/rpc/latest-version/api/getunclaimedgas.md b/docs/n3/reference/rpc/getunclaimedgas.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getunclaimedgas.md rename to docs/n3/reference/rpc/getunclaimedgas.md diff --git a/docs/n3/reference/rpc/latest-version/api/getversion.md b/docs/n3/reference/rpc/getversion.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getversion.md rename to docs/n3/reference/rpc/getversion.md diff --git a/docs/n3/reference/rpc/latest-version/api/getwalletbalance.md b/docs/n3/reference/rpc/getwalletbalance.md similarity index 93% rename from docs/n3/reference/rpc/latest-version/api/getwalletbalance.md rename to docs/n3/reference/rpc/getwalletbalance.md index 7aa5815..e57548d 100644 --- a/docs/n3/reference/rpc/latest-version/api/getwalletbalance.md +++ b/docs/n3/reference/rpc/getwalletbalance.md @@ -19,7 +19,7 @@ For example, NEO is 0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5 Gas is 0xd2a4cff31913016155e38e474a2c06d08be276cf -You can query asset ID using the [CLI command](../../../../node/cli/cli.md) `list asset` or using the blockchain browser. +You can query asset ID using the [CLI command](../../node/cli/cli.md) `list asset` or using the blockchain browser. ## Example diff --git a/docs/n3/reference/rpc/latest-version/api/getwalletunclaimedgas.md b/docs/n3/reference/rpc/getwalletunclaimedgas.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/getwalletunclaimedgas.md rename to docs/n3/reference/rpc/getwalletunclaimedgas.md diff --git a/docs/n3/reference/rpc/latest-version/api/importprivkey.md b/docs/n3/reference/rpc/importprivkey.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/importprivkey.md rename to docs/n3/reference/rpc/importprivkey.md diff --git a/docs/n3/reference/rpc/latest-version/api/invokecontractverify.md b/docs/n3/reference/rpc/invokecontractverify.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/invokecontractverify.md rename to docs/n3/reference/rpc/invokecontractverify.md diff --git a/docs/n3/reference/rpc/latest-version/api/invokefunction.md b/docs/n3/reference/rpc/invokefunction.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/invokefunction.md rename to docs/n3/reference/rpc/invokefunction.md diff --git a/docs/n3/reference/rpc/latest-version/api/invokescript.md b/docs/n3/reference/rpc/invokescript.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/invokescript.md rename to docs/n3/reference/rpc/invokescript.md diff --git a/docs/n3/reference/rpc/latest-version/api.md b/docs/n3/reference/rpc/latest-version/api.md deleted file mode 100644 index b743d14..0000000 --- a/docs/n3/reference/rpc/latest-version/api.md +++ /dev/null @@ -1,190 +0,0 @@ -# API Reference - -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 must install the plugin [RpcServer](https://github.com/neo-project/neo-modules/releases). Refer to [Installing plugins](../../../node/cli/config#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 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 - -``` -http://127.0.0.1:10332/ -``` - -You can modify the port in config.json in the RpcServer folder. - -## Command Lists - -### Blockchain - -| Method | Parameter | Description | -| --------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------ | -| [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 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 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. | - - -### Node - -| 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. | -| [getversion](api/getversion.md) | | Gets the version information of the node. | -| [sendrawtransaction](api/sendrawtransaction.md) | | Broadcasts a transaction over the network. | -| [submitblock](api/submitblock.md) | | Submits a new block to the network.
**Note**: Need to be a validator | - -### Smart Contract - -| 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) | \[sender] \[signers] | Runs a script through the virtual machine and returns the results. | -| [traverseiterator](api/traverseiterator.md) | `` `` `` | Gets the Iterator type data. | - -### Tool - -| Method | Parameter | Description | -| --------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------ | -| [listplugins](api/listplugins.md) | | Returns a list of plugins loaded by the node. | -| [validateaddress](api/validateaddress.md) | | Verifies whether the address is a valid NEO address. | - -### Wallet - -| Method | Parameter | Description | -| --------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------ | -| [calculatenetworkfee](api/calculatenetworkfee.md) | | Calculates network fee for the specified transaction. | -| [closewallet](api/closewallet.md) | | Closes the current wallet. | -| [dumpprivkey](api/dumpprivkey.md) | | Exports the private key of the specified address. | -| [getnewaddress](api/getnewaddress.md) | | Creates a new address. | -| [getwalletbalance](api/getwalletbalance.md) | | Returns the balance of the corresponding asset in the wallet. | -| [getwalletunclaimedgas](api/getwalletunclaimedgas.md) | | Gets the amount of unclaimed GAS in the wallet. | -| [importprivkey](api/importprivkey.md) | | Imports the private key to the wallet. | -| [invokecontractverify](api/invokecontractverify.md) | \[params] \[signers] | Invokes the verification method of contract. | -| [listaddress](api/listaddress.md) | | Lists all the addresses in the current wallet. | -| [openwallet](api/openwallet.md) | | Opens the specified wallet. | -| [sendfrom](api/sendfrom.md) | | Transfers from the specified address to the destination address. | -| [sendmany](api/sendmany.md) | \[signers] | Initiates multiple transfers to multiple addresses in a transaction. | -| [sendtoaddress](api/sendtoaddress.md) | \[signers] | Transfers to the specified address. | - -### ApplicationLogs plugin - -| Method | Parameter | Description | -| --------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------ | -| [getapplicationlog](api/getapplicationlog.md) | | Returns the contract event information based on the specified txid. | - -### TokensTracker plugin - -| Method | Parameter | Description | -| --------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------ | -| [getnep11balances](api/getnep11balances.md) | | Returns the balance of all NEP11 assets in the specified address. | -| [getnep11properties](api/getnep11properties.md) | | Returns the customized properties of NEP-11 assets. | -| [getnep11transfers](api/getnep17transfers.md) | [timestamp] | Returns all the NEP11 transaction information occurred in the specified address. | -| [getnep17balances](api/getnep17balances.md) | | Returns the balance of all NEP17 assets in the specified address. | -| [getnep17transfers](api/getnep17transfers.md) | [timestamp] | Returns all the NEP17 transaction information occurred in the specified address. | - -### StateService plugin - -| Method | Parameter | Description | -| --------------------------------------- | ----------------------------------------------- | ------------------------------------------------------------ | -| [getstateroot](api/getstateroot.md) | | Queries the state root by the block height. | -| [getproof](api/getproof.md) | | Gets proof by querying root hash, contract hash, and storage key. | -| [verifyproof](api/verifyproof.md) | | Verifies using the root hash and proof, and gets the value of the storage corresponding to the key. | -| [getstateheight](api/getstateheight.md) | | Queries the stateroot height. | -| [getstate](api/getstate.md) | | Queries `state` with the `root hash`, `contract hash` and `storage key`. | -| [findstates](api/findstates.md) | [key] [count] | Queries `state` with the prefix of `root hash`, `contract hash` and `storage key`. | - -:::note - -For RPC API, all the return values related to the amount such as fees, NEP-17 asset balance, wallet balance, transfer amount, etc. are unsigned integer, which are automatically converted according to the asset decimal when requested by [RpcClient](https://github.com/neo-project/neo-modules/tree/master/src/RpcClient) (C# light node SDK). If you write the request by yourselves, you need to convert the amount manually. For example, if the return value is 1234560 and the asset decimal is 8, the actual amount is 0.0123456. -::: - -## GET request example - -The format of a typical JSON-RPC GET request is as follows: - -Here is an example of how to get the number of blocks in the block chain. - -Request URL: - -``` -http://127.0.0.1:10332?jsonrpc=2.0&method=getblockcount¶ms=[]&id=1 -``` - -After sending the request, you will get the following response: - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": 909129 -} -``` - -## POST request example - -The format of a typical JSON-RPC Post request is as follows: - -Here is an example of how to get the number of blocks in the block chain. - -Request URL: - -``` -http://127.0.0.1:10332 -``` - -Request Body: - -```json -{ - "jsonrpc": "2.0", - "method": "getblockcount", - "params":[], - "id": 1 -} -``` - -After sending the request, you will get the following response: - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": 909122 -} -``` - -:::note -To make sure you get the latest result synchronize your client to the latest block height before you use the API. -::: - -## Test tools - -You can use the Chrome extension in Postman to facilitate the test (Installation of the Chrome extension requires Internet connection). A test screenshot is shown below: - -![image](../../../assets/api_3.jpg) - -## See also - -[C# JSON-RPC Command List](https://github.com/chenzhitong/CSharp-JSON-RPC/blob/master/json_rpc/Program.cs) diff --git a/docs/n3/reference/rpc/latest-version/api/listaddress.md b/docs/n3/reference/rpc/listaddress.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/listaddress.md rename to docs/n3/reference/rpc/listaddress.md diff --git a/docs/n3/reference/rpc/latest-version/api/listplugins.md b/docs/n3/reference/rpc/listplugins.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/listplugins.md rename to docs/n3/reference/rpc/listplugins.md diff --git a/docs/n3/reference/rpc/latest-version/api/openwallet.md b/docs/n3/reference/rpc/openwallet.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/openwallet.md rename to docs/n3/reference/rpc/openwallet.md diff --git a/docs/n3/reference/rpc/latest-version/api/sendfrom.md b/docs/n3/reference/rpc/sendfrom.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/sendfrom.md rename to docs/n3/reference/rpc/sendfrom.md diff --git a/docs/n3/reference/rpc/latest-version/api/sendmany.md b/docs/n3/reference/rpc/sendmany.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/sendmany.md rename to docs/n3/reference/rpc/sendmany.md diff --git a/docs/n3/reference/rpc/latest-version/api/sendrawtransaction.md b/docs/n3/reference/rpc/sendrawtransaction.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/sendrawtransaction.md rename to docs/n3/reference/rpc/sendrawtransaction.md diff --git a/docs/n3/reference/rpc/latest-version/api/sendtoaddress.md b/docs/n3/reference/rpc/sendtoaddress.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/sendtoaddress.md rename to docs/n3/reference/rpc/sendtoaddress.md diff --git a/docs/n3/reference/rpc/latest-version/api/submitblock.md b/docs/n3/reference/rpc/submitblock.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/submitblock.md rename to docs/n3/reference/rpc/submitblock.md diff --git a/docs/n3/reference/rpc/latest-version/api/traverseiterator.md b/docs/n3/reference/rpc/traverseiterator.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/traverseiterator.md rename to docs/n3/reference/rpc/traverseiterator.md diff --git a/docs/n3/reference/rpc/latest-version/api/validateaddress.md b/docs/n3/reference/rpc/validateaddress.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/validateaddress.md rename to docs/n3/reference/rpc/validateaddress.md diff --git a/docs/n3/reference/rpc/latest-version/api/verifyproof.md b/docs/n3/reference/rpc/verifyproof.md similarity index 100% rename from docs/n3/reference/rpc/latest-version/api/verifyproof.md rename to docs/n3/reference/rpc/verifyproof.md diff --git a/docs/n3/reference/scapi/framework/native/ContractManagement/GetContractHashes.md b/docs/n3/reference/scapi/framework/native/ContractManagement/GetContractHashes.md index d53c628..fe5d9b8 100644 --- a/docs/n3/reference/scapi/framework/native/ContractManagement/GetContractHashes.md +++ b/docs/n3/reference/scapi/framework/native/ContractManagement/GetContractHashes.md @@ -67,7 +67,7 @@ Response body: } ``` -Invoke again from RPC to get the specific value of the iterator. For more information, refer to the command [traverseiterator](../../../../rpc/latest-version/api/traverseiterator.md). +Invoke again from RPC to get the specific value of the iterator. For more information, refer to the command [traverseiterator](../../../../rpc/traverseiterator.md). ```json { diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/faq/basic.md b/i18n/zh/docusaurus-plugin-content-docs/current/faq/basic.md index 85aa1fe..d0f13c8 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/faq/basic.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/faq/basic.md @@ -30,7 +30,7 @@ Neo 使用 一种改进的拜占庭容错机制 (dBFT),可以对由 𝑛 ## 如何成为 Neo 的共识节点? 成为共识节点有什么激励吗? -Neo 的共识节点由 Neo 持有者投票选出。详细信息可参考 [这里](https://docs.neo.org/docs/zh-cn/basic/consensus/vote_validator.html);所有交易的网络费会作为奖励发给当前打包交易出块的共识节点。 +Neo 的共识节点由 Neo 持有者投票选出。详细信息可参考 [这里](../n3/foundation/consensus/vote_validator.md);所有交易的网络费会作为奖励发给当前打包交易出块的共识节点。 ## 有哪些 Neo 的区块链浏览器可以使用? @@ -46,7 +46,7 @@ NEP-17 标准是 Neo N3 的通证标准,它取代了以前的 NEP-5,表示 ## 如何在 Neo-CLI 中查看 NEP-17 资产? -想要看到 NEP-17 资产,需要使用 RPC 的 [getnep17balances](../../docs/zh-cn/reference/rpc/latest-version/api/getnep17balances.md) 方法或 Neo-CLI 的 [balanceof](../../docs/zh-cn/node/cli/cli.html#balanceof) 方法。 +想要看到 NEP-17 资产,需要使用 RPC 的 [getnep17balances](../n3/reference/rpc/getnep17balances.md) 方法或 Neo-CLI 的 [balanceof](../../docs/zh-cn/node/cli/cli.html#balanceof) 方法。 ## NEP-6 是什么? diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/faq/dev.md b/i18n/zh/docusaurus-plugin-content-docs/current/faq/dev.md index 1ee778a..8dd16d9 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/faq/dev.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/faq/dev.md @@ -8,10 +8,8 @@ 要搭建私链,有以下方法可供选择: -- [单节点模式快速搭建](../../docs/zh-cn/develop/network/private-chain/solo.md) -- [在本地主机搭建私有链](../../docs/zh-cn/develop/network/private-chain/private-chain2.md) - -还可以参见 [社区文章](../../articles/zh-cn/index.md),学习更多私链搭建方法。 +- [单节点模式快速搭建](../n3/develop/network/private-chain/solo.md) +- [在本地主机搭建私有链](../n3/develop/network/private-chain/private-chain2.md) ## 可以使用哪些语言开发智能合约? diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/n3/Advances/Oracles.md b/i18n/zh/docusaurus-plugin-content-docs/current/n3/Advances/Oracles.md index bbd0e30..4b69604 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/n3/Advances/Oracles.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/n3/Advances/Oracles.md @@ -4,7 +4,7 @@ Neo Oracle Service 是 Neo N3 内置的链外数据访问服务,它允许用户在智能合约中构建对外部数据源的访问请求,并由委员会指定的可信Oracle节点获取数据后,将其传入回调函数中继续执行相关智能合约逻辑。 -![img](https://docs.neo.org/docs/zh-cn/advanced/assets/oracle.png) +![img](assets/oracle.png) ## 关键机制 diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/n3/develop/deploy/deploy.md b/i18n/zh/docusaurus-plugin-content-docs/current/n3/develop/deploy/deploy.md index 1c2f465..124fb90 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/n3/develop/deploy/deploy.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/n3/develop/deploy/deploy.md @@ -14,7 +14,7 @@ 智能合约的部署是通过交易调用 API 来部署。通常的做法是通过 Neo-CLI 或 Neo-GUI 的智能合约发布功能来部署合约。 -部署智能合约以及调用智能合约均会产生费用,详情请参见 [系统手续费](../../reference/fees.md)。 +部署智能合约以及调用智能合约均会产生费用,详情请参见 [系统手续费](../../fees.md)。 ## 准备工作 在开始部署之前,请确认您已经完成以下工作: diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/n3/develop/deploy/invoke.md b/i18n/zh/docusaurus-plugin-content-docs/current/n3/develop/deploy/invoke.md index fd3434b..6611b51 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/n3/develop/deploy/invoke.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/n3/develop/deploy/invoke.md @@ -8,7 +8,7 @@ ### 使用 Neo-CLI 查询 -使用RPC API [getcontractstate 方法](../../reference/rpc/latest-version/api/getcontractstate.md) 查询合约详情。 +使用RPC API [getcontractstate 方法](../../reference/rpc/getcontractstate.md) 查询合约详情。 ### 使用 Neo-GUI 查询 @@ -31,7 +31,7 @@ Neo-GUI 中会更直观地显示合约信息,也能查看 manifest 和 nef 文 详情请参考 [invoke](../../node/cli/cli.md#invoke) 命令。 -- 使用 RPC API [invokefunction](../../reference/rpc/latest-version/api/invokefunction.md) 或 [invokescript](../../reference/rpc/latest-version/api/invokescript.md) 来调用合约。推荐使用 invokefunction 方法。 +- 使用 RPC API [invokefunction](../../reference/rpc/invokefunction.md) 或 [invokescript](../../reference/rpc/invokescript.md) 来调用合约。推荐使用 invokefunction 方法。 ### 使用 Neo-GUI 调用 @@ -105,13 +105,13 @@ public class Contract1 : SmartContract - method:被调用合约的方法,如 name 、 balanceOf 、 transfer 等,字符串类型。 -- flags:调用合约方法时允许的权限,参考 ([CallFlags 枚举](https://docs.neo.org/docs/zh-cn/reference/scapi/framework/services/CallFlags.html#%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E))。 +- flags:调用合约方法时允许的权限,参考 ([CallFlags 枚举](../../reference/scapi/framework/services/callflags.md))。 - params:被调用合约的方法的参数列表,数组类型。 ### 权限相关字段 -在合约的 Manifest 文件中定义了三个与权限相关的字段,参见下表。通过 Groups 和 Trusts 字段,钱包会根据合约之间是否可信,或者合约是否在同一组中来决定是否给用户安全警告。而 Permissions 和签名作用域决定了合约之间能否互相调用。关于签名作用域,请参考 [invokefunction 方法](../../reference/rpc/latest-version/api/invokefunction.md) 的参数说明。 +在合约的 Manifest 文件中定义了三个与权限相关的字段,参见下表。通过 Groups 和 Trusts 字段,钱包会根据合约之间是否可信,或者合约是否在同一组中来决定是否给用户安全警告。而 Permissions 和签名作用域决定了合约之间能否互相调用。关于签名作用域,请参考 [invokefunction 方法](../../reference/rpc/invokefunction.md) 的参数说明。 | 字段 | 类型 | 说明 | | ------------- | ----------------------------- | ------------------------------------------------------------ | diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/n3/develop/write/basics.md b/i18n/zh/docusaurus-plugin-content-docs/current/n3/develop/write/basics.md index 6c0bc9f..6bee9b9 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/n3/develop/write/basics.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/n3/develop/write/basics.md @@ -198,7 +198,7 @@ public class Contract1 : SmartContract `SupportedStandards` 表示合约符合的 NEP 标准,比如 `NEP-17` 是 Neo 上的代币标准。 -`ContractPermission` 表示合约申请的权限,`ContractTrust` 表示合约信任哪些合约调用自己。参考 [权限相关字段](../deploy/invoke.html#权限相关字段)。 +`ContractPermission` 表示合约申请的权限,`ContractTrust` 表示合约信任哪些合约调用自己。参考 [权限相关字段](../deploy/invoke.md#权限相关字段)。 也可以添加其它字段,如: diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/n3/exchange/client.md b/i18n/zh/docusaurus-plugin-content-docs/current/n3/exchange/client.md index af8150c..37250c0 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/n3/exchange/client.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/n3/exchange/client.md @@ -52,7 +52,7 @@ Neo-CLI 提供以下功能: 如果想启动节点的同时开启 RPC API,务必在部署节点时正确安装 RpcServer 插件。 - 要查看更多 API 信息,请参阅 [API 参考](../reference/rpc/latest-version/api.md)。 + 要查看更多 API 信息,请参阅 [API 参考](../reference/rpc/api.md)。 - 提供 NEP17 资产的交易信息。 @@ -79,7 +79,7 @@ Neo-CLI 钱包支持两种格式的钱包, sqlite 钱包(格式为.db3)和 - 用户第一次充值(NEO/GAS)时,程序动态创建 NEO 地址,优点:无需人工定期创建地址;缺点:不方便备份钱包。 - 要动态创建地址,可以使用 RpcServer API 的 [getnewaddress 方法](../reference/rpc/latest-version/api/getnewaddress.md) 实现。程序会返回创建的地址。 + 要动态创建地址,可以使用 RpcServer API 的 [getnewaddress 方法](../reference/rpc/getnewaddress.md) 实现。程序会返回创建的地址。 - 交易所提前创建一批 NEO 地址,并在用户第一次充值(NEO/GAS)时,给用户分配一个 NEO 地址。优点:方便备份钱包;缺点:当地址不足时需要人工创建 NEO 地址。 diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/n3/exchange/deploynode.md b/i18n/zh/docusaurus-plugin-content-docs/current/n3/exchange/deploynode.md index 2ce9a74..60622b0 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/n3/exchange/deploynode.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/n3/exchange/deploynode.md @@ -12,7 +12,7 @@ sidebar_position: 1 ## 安装插件 -一些附加功能被独立封装在插件中用以调用,提升了节点的安全性,稳定性和灵活性。关于插件的详细信息,请参见 [安装插件](../node/cli/config.html/#安装插件)。 +一些附加功能被独立封装在插件中用以调用,提升了节点的安全性,稳定性和灵活性。关于插件的详细信息,请参见 [安装插件](../node/cli/config.md/#安装插件)。 交易所需要在[这里]( https://github.com/neo-project/neo-modules/releases/)下载安装以下插件,以保证 API 的正常使用和自动读取离线包的完整性: diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/n3/exchange/gas.md b/i18n/zh/docusaurus-plugin-content-docs/current/n3/exchange/gas.md index 077d979..536e4cb 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/n3/exchange/gas.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/n3/exchange/gas.md @@ -36,7 +36,7 @@ GAS(缩写符号 GAS)代表了 Neo 区块链的使用权。只要获得 NEO 快照间隔越短,计算越精确。如果快照时间间隔不均匀,可以采用加权平均算法。 :::note - 在 NEO N3 中,由于交易所用户无法参与投票,所以固定收益为计算提取的 GAS 总量的10%。具体可见[GAS 分配规则](https://docs.neo.org/docs/zh-cn/basic/governance.html#gas-%E5%88%86%E9%85%8D%E8%A7%84%E5%88%99)。 + 在 NEO N3 中,由于交易所用户无法参与投票,所以固定收益为计算提取的 GAS 总量的10%。具体可见[GAS 分配规则](../foundation/governance.md)。 ::: ## RPC 方法 @@ -45,7 +45,7 @@ GAS(缩写符号 GAS)代表了 Neo 区块链的使用权。只要获得 NEO | 方法 | 描述 | | ------------------------------------------------------------ | --------------------------------------- | -| [getunclaimedgas](../reference/rpc/latest-version/api/getunclaimedgas.md) | 显示当前钱包内所有地址生成的 GAS 数量。 | +| [getunclaimedgas](../reference/rpc/getunclaimedgas.md) | 显示当前钱包内所有地址生成的 GAS 数量。 | ## 交易所提取 GAS diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/n3/exchange/transaction.md b/i18n/zh/docusaurus-plugin-content-docs/current/n3/exchange/transaction.md index 26f0b9d..e9261bd 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/n3/exchange/transaction.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/n3/exchange/transaction.md @@ -24,7 +24,7 @@ NetworkFee = VerificationCost + tx.size * FeePerByte ## 系统费 -系统费是根据 NeoVM 要执行的指令计算得出的费用,有关每个操作指令的费用,请参考[系统费用](../reference/fees.md)。Neo N3 中取消了每笔交易 10 GAS 的免费额度,系统费用总额受合约脚本的指令数量和指令类型影响,计算公式如下: +系统费是根据 NeoVM 要执行的指令计算得出的费用,有关每个操作指令的费用,请参考[系统费用](../fees.md)。Neo N3 中取消了每笔交易 10 GAS 的免费额度,系统费用总额受合约脚本的指令数量和指令类型影响,计算公式如下: ``` SystemFee = InvocationCost = The sum of all executed opcode fee @@ -313,7 +313,7 @@ symbol ### 调用 getapplicationlog -使用 [getapplicationlog](../reference/rpc/latest-version/api/getapplicationlog.md) 这个 API 来获取交易信息。 +使用 [getapplicationlog](../reference/rpc/getapplicationlog.md) 这个 API 来获取交易信息。 正确安装 ApplicationLogs 插件并启动 Neo-CLI 节点后,可以看到在neo-cli 根目录下生成了一个 ApplicationLogs 文件夹,完整的合约日志会记录到该目录下,每笔 NEP-17 交易会记录在 leveldb 文件中,通过 API 来读取。 diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/n3/foundation/governance.md b/i18n/zh/docusaurus-plugin-content-docs/current/n3/foundation/governance.md index ee8c4f8..1409ed9 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/n3/foundation/governance.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/n3/foundation/governance.md @@ -75,7 +75,7 @@ Neo N3 的委员会成员的数量为 21 个。每 21 个区块高度为一个 E ## 相关参考 -[治理 API](../reference/govapi/index.md) +[治理 API](../reference/governance_api/index.md) [Neo 治理页面](https://neo.org/gov) diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/n3/node/cli/config.md b/i18n/zh/docusaurus-plugin-content-docs/current/n3/node/cli/config.md index 595bcd0..6124e88 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/n3/node/cli/config.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/n3/node/cli/config.md @@ -103,17 +103,17 @@ Neo-CLI 在执行过程中会访问配置文件 `config.json`。启动 Neo-CLI |插件|描述|包含 API|| |--- |--- |--- |--- | -| ApplicationLogs | 同步智能合约和 NativeContract 的日志(Notify) | [getapplicationlog](https://github.com/neo-project/docs/blob/cad14667651edfccad1eec508ab2af80889d6762/docs/zh-cn/reference/rpc/latest-version/api/getapplicationlog.html) | 推荐 | +| ApplicationLogs | 同步智能合约和 NativeContract 的日志(Notify) | [getapplicationlog](../../reference/rpc/getapplicationlog.md) | 推荐 | | DBFTPlugin | dBFT 共识插件 | | 作为共识节点时必选 | | LevelDBStore | 区块链数据使用 LevelDB 存储引擎 | | 必选 | | MPTTrie | 使用 LevelDB 存储 MPT 数据 | | 作为 StateRoot 共识节点时必选 | | OracleService | Oracle 服务插件 | | 作为 Oracle 服务节点时必选 | | RocksDBStore | 区块链数据使用 RocksDBStore 存储引擎 | | 和 LevelDBStore 二选一 | -| RpcServer | 提供节点的 RPC 功能 | [RPC API](https://github.com/neo-project/docs/blob/cad14667651edfccad1eec508ab2af80889d6762/docs/zh-cn/reference/rpc/latest-version/api.html#命令列表) | 必选 | +| RpcServer | 提供节点的 RPC 功能 | [RPC API](../../reference/rpc/rpc.md#命令列表) | 必选 | | SQLiteWallet | 提供基于SQLite的.db3钱包功能 | | 可选 | | StatesDumper | 导出 Neo-CLI 状态数据 | | 可选 | -| StateService | StateRoot 共识服务插件 | [getstateroot](https://github.com/neo-project/docs/blob/cad14667651edfccad1eec508ab2af80889d6762/docs/zh-cn/reference/rpc/latest-version/api/getstateroot.html) [getproof](https://github.com/neo-project/docs/blob/cad14667651edfccad1eec508ab2af80889d6762/docs/zh-cn/reference/rpc/latest-version/api/getproof.html) [verifyproof](https://github.com/neo-project/docs/blob/cad14667651edfccad1eec508ab2af80889d6762/docs/zh-cn/reference/rpc/latest-version/api/verifyproof.html) [getstateheight](https://github.com/neo-project/docs/blob/cad14667651edfccad1eec508ab2af80889d6762/docs/zh-cn/reference/rpc/latest-version/api/getstateheight.html) | 作为 StateRoot 共识节点时必选 | -| TokensTracker | 提供NEP-11、NEP-17余额及交易历史的RPC查询功能。 | [getnep11balances](https://github.com/neo-project/docs/blob/cad14667651edfccad1eec508ab2af80889d6762/docs/zh-cn/reference/rpc/latest-version/api/getnep11balances.html) [getnep11properties](https://github.com/neo-project/docs/blob/cad14667651edfccad1eec508ab2af80889d6762/docs/zh-cn/reference/rpc/latest-version/api/getnep11properties.html) [getnep11transfers](https://github.com/neo-project/docs/blob/cad14667651edfccad1eec508ab2af80889d6762/docs/zh-cn/reference/rpc/latest-version/api/getnep11transfers.html) [getnep17balances](https://github.com/neo-project/docs/blob/cad14667651edfccad1eec508ab2af80889d6762/docs/zh-cn/reference/rpc/latest-version/api/getnep17balances.html) [getnep17transfers](https://github.com/neo-project/docs/blob/cad14667651edfccad1eec508ab2af80889d6762/docs/zh-cn/reference/rpc/latest-version/api/getnep17transfers.html) | 推荐 | +| StateService | StateRoot 共识服务插件 | [getstateroot](../../reference/rpc/getstateroot.md) [getproof](../../reference/rpc/getproof.md) [verifyproof](../../reference/rpc/verifyproof.md) [getstateheight](../../reference/rpc/getstateheight.md) | 作为 StateRoot 共识节点时必选 | +| TokensTracker | 提供NEP-11、NEP-17余额及交易历史的RPC查询功能。 | [getnep11balances](../../reference/rpc/getnep11balances.md) [getnep11properties](../../reference/rpc/getnep11properties.md) [getnep11transfers](../../reference/rpc/getnep11transfers.md) [getnep17balances](../../reference/rpc/getnep17balances.md) [getnep17transfers](../../reference/rpc/getnep17transfers.md) | 推荐 | 安装插件有两种方式: diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/n3/node/gui/blockchain.md b/i18n/zh/docusaurus-plugin-content-docs/current/n3/node/gui/blockchain.md index 8f41d0b..cfb0b71 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/n3/node/gui/blockchain.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/n3/node/gui/blockchain.md @@ -4,7 +4,7 @@ ## 区块 -区块(Block)是区块链的最基本的单位,是一种逻辑结构。数据通过区块,永久记录在区块链网络上。关于区块的基本概念请参考 [区块 ](../../basic/concept/blockchain/block.md)。 +区块(Block)是区块链的最基本的单位,是一种逻辑结构。数据通过区块,永久记录在区块链网络上。关于区块的基本概念请参考 [区块 ](../../foundation/blocks.md)。 ### 查看区块列表 @@ -45,7 +45,7 @@ - **交易体**:显示交易的基本信息,如所在区块、大小、时间戳等,以及交易的转账记录和交易的见证人。 - **交易日志**:显示交易中智能合约的执行日志,包括 NEP-17 转账是否成功等信息。 -关于交易的基本概念请参考 [交易](../../basic/concept/transaction.md)。 +关于交易的基本概念请参考 [交易](../../foundation/transactions.md)。 ## 资产 diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/n3/reference/governance_api/index.md b/i18n/zh/docusaurus-plugin-content-docs/current/n3/reference/governance_api/index.md index 2c5f808..5c380d0 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/n3/reference/governance_api/index.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/n3/reference/governance_api/index.md @@ -10,8 +10,8 @@ | 方法 | 参数 | 费用(GAS) | | ---- | ------------------------------------ | ---- | -| [`RegisterCandidate`](scapi/framework/native/Neo/RegisterCandidate.md) | ECPoint publicKey | 可调,初始0.00001 | -| [`UnregisterCandidate`](scapi/framework/native/Neo/UnregisterCandidate.md) | ECPoint publicKey | 0.00065536 (CpuFee) | +| [`RegisterCandidate`](../scapi/framework/native/Neo/RegisterCandidate.md) | ECPoint publicKey | 可调,初始0.00001 | +| [`UnregisterCandidate`](../scapi/framework/native/Neo/UnregisterCandidate.md) | ECPoint publicKey | 0.00065536 (CpuFee) | :::note 注册/注销候选人均需要验证候选人地址的签名,即只有候选人自己才能执行注册/注销操作。 @@ -25,13 +25,13 @@ | 方法 | 参数 | 费用(GAS) | | ---- | ------------------------------------ | ---- | -| [`Vote`](scapi/framework/native/Neo/Vote.md) | UInt160 account, byte[] voteTo | 0.00065536 (CpuFee) | +| [`Vote`](../scapi/framework/native/Neo/Vote.md) | UInt160 account, byte[] voteTo | 0.00065536 (CpuFee) | 由于账户NEO余额会随交易而不断变化,而且投票和注册的候选人也在不断变化,因此在每个区块都会根据以上变化更新候选人及相应投票结果。 | 方法 | 参数 | 费用(GAS) | | ---- | ------------------------------------ | ---- | -| [`GetCandidates`](scapi/framework/native/Neo/GetCandidates.md) | null | 0 | +| [`GetCandidates`](../scapi/framework/native/Neo/GetCandidates.md) | null | 0 | ## 委员会 @@ -72,13 +72,13 @@ | 方法 | 参数 | 费用(GAS) | 合约 | | ---- | ------------------------------------ | ---- | ---- | -| [`GetDesignatedByRole`](scapi/framework/native/RoleManagement/GetDesignatedByRole.md) | Role role, uint index | 0.00032768 (CpuFee) | RoleManagement | -| [`GetFeePerByte`](scapi/framework/native/Policy/GetFeePerByte.md) | null | 0.00032768 (CpuFee) | PolicyContract | +| [`GetDesignatedByRole`](../scapi/framework/native/RoleManagement/GetDesignatedByRole.md) | Role role, uint index | 0.00032768 (CpuFee) | RoleManagement | +| [`GetFeePerByte`](../scapi/framework/native/Policy/GetFeePerByte.md) | null | 0.00032768 (CpuFee) | PolicyContract | | GetExecFeeFactor | null | 0.00032768 (CpuFee) | PolicyContract | | GetStoragePrice | null | 0.00032768 (CpuFee) | PolicyContract | -| [`IsBlocked`](scapi/framework/native/Policy/IsBlocked.md) | UInt160 account | 0.00032768 (CpuFee) | PolicyContract | +| [`IsBlocked`](../scapi/framework/native/Policy/IsBlocked.md) | UInt160 account | 0.00032768 (CpuFee) | PolicyContract | | GetPrice | null | 0.00032768 (CpuFee) | OracleContract | -| [`GetGasPerBlock`](scapi/framework/native/Neo/GetGasPerBlock.md) | null | 0.00032768 (CpuFee) | NeoToken | +| [`GetGasPerBlock`](../scapi/framework/native/Neo/GetGasPerBlock.md) | null | 0.00032768 (CpuFee) | NeoToken | | GetRegisterPrice | null | 0.00032768 (CpuFee) | NeoToken | | GetMinimumDeploymentFee | null | 0.00032768 (CpuFee) | ContractManagement | @@ -90,7 +90,7 @@ | 方法 | 参数 | 费用(GAS) | 返回结果 | | ---- | ------------------------------------ | ---- | ---- | -| [`GetCommittee`](scapi/framework/native/Neo/GetCommittee.md) | null | 0.04194304 (CpuFee) | 返回当前委员会(`Array`) | +| [`GetCommittee`](../scapi/framework/native/Neo/GetCommittee.md) | null | 0.04194304 (CpuFee) | 返回当前委员会(`Array`) | ## 共识节点 @@ -104,7 +104,7 @@ | 方法 | 参数 | 费用(GAS) | 返回结果 | | ---- | ------------------------------------ | ---- | ---- | -| [`GetNextBlockValidators`](scapi/framework/native/Neo/GetNextBlockValidators.md) | null | 0.04194304 (CpuFee) | 返回下个块(正在持久化的块)的共识节点(`Array`) | +| [`GetNextBlockValidators`](../scapi/framework/native/Neo/GetNextBlockValidators.md) | null | 0.04194304 (CpuFee) | 返回下个块(正在持久化的块)的共识节点(`Array`) | ## Token分配 @@ -118,14 +118,14 @@ NEO及GAS均为[Nep17](https://github.com/neo-project/proposals/blob/master/nep- | 方法 | 参数 | 费用(GAS) | 作用 | | ---- | ------------------------------------ | ---- | ---- | -| [`symbol`](govapi/symbol.md) | null | 0 | 返回Token标志(String) | -| [`decimals`](govapi/decimals.md) | null | 0 | 返回Token精度(UInt) | -| [`TotalSupply`](scapi/framework/native/Neo/TotalSupply.md) | null | 0.00032768 (CpuFee) | 返回Token当前流通量(BigInteger) | -| [`BalanceOf`](scapi/framework/native/Neo/BalanceOf.md) | UInt160 account | 0.00032768 (CpuFee) | 返回该账户的余额(BigInteger) | -| [`Transfer`](scapi/framework/native/Neo/Transfer.md) | UInt160 from, UInt160 to, BigInteger amount | 0.00131072 (CpuFee) + 0.0000005 (StorageFee) | 将指定数额的Token从from转往to,注意这里需要校验from的签名,方法调用者是否为from,to是否能够收款,以及from余额是否充足 | +| symbol | null | 0 | 返回Token标志(String) | +| decimals | null | 0 | 返回Token精度(UInt) | +| [`TotalSupply`](../scapi/framework/native/Neo/TotalSupply.md) | null | 0.00032768 (CpuFee) | 返回Token当前流通量(BigInteger) | +| [`BalanceOf`](../scapi/framework/native/Neo/BalanceOf.md) | UInt160 account | 0.00032768 (CpuFee) | 返回该账户的余额(BigInteger) | +| [`Transfer`](../scapi/framework/native/Neo/Transfer.md) | UInt160 from, UInt160 to, BigInteger amount | 0.00131072 (CpuFee) + 0.0000005 (StorageFee) | 将指定数额的Token从from转往to,注意这里需要校验from的签名,方法调用者是否为from,to是否能够收款,以及from余额是否充足 | NEO扩展的合约方法如下: | 方法 | 参数 | 费用(GAS) | 返回结果 | | ---- | ------------------------------------ | ---- | ---- | -| [`UnclaimedGas`](scapi/framework/native/Neo/UnclaimedGas.md) | UInt160 account, uint end | 0.00131072 (CpuFee) | 返回该账户到指定高度未提取的GAS(uint) | \ No newline at end of file +| [`UnclaimedGas`](../scapi/framework/native/Neo/UnclaimedGas.md) | UInt160 account, uint end | 0.00131072 (CpuFee) | 返回该账户到指定高度未提取的GAS(uint) | \ No newline at end of file diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/n3/reference/rpc/api.md b/i18n/zh/docusaurus-plugin-content-docs/current/n3/reference/rpc/api.md new file mode 100644 index 0000000..1a31b6b --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/n3/reference/rpc/api.md @@ -0,0 +1,182 @@ +# API 参考 + +每个 Neo-CLI 节点都可选的提供了一套 API 接口,用于从该节点获取区块链数据,使得开发区块链应用变得十分方便。接口通过 [JSON-RPC](http://wiki.geekdream.com/Specification/json-rpc_2.0.md) 的方式提供,底层使用 HTTP/HTTPS 协议进行通讯。 + +要启用 RPC服务,你需要安装 [RpcServer 插件](https://github.com/neo-project/neo-modules/releases),可参考 [安装插件](../../../node/cli/config.md#安装插件) 进行安装。启动 Neo-CLI 时无需添加参数。 + +:::note + 如果安装时找不到对应版本的文件,则表示当前未发布对应版本的 RpcServer 插件,开发者可以自行编译 [neo-modules](https://github.com/neo-project/neo-modules) 项目: +::: +> +> 1. 在 neo-cli.dll 所在的目录新建 Plugins 文件夹 +> 2. 将编译后的 RpcServer 文件放到 Plugins 文件夹中,然后重新启动 Neo-CLI。 + +## 监听端口 + +JSON-RPC 服务器启动后,会监听 TCP 端口,默认为本地地址(127.0.0.1)的 10332 端口,即 + +``` +http://127.0.0.1:10332/ +``` + +如需更改可修改 RpcServer 文件夹中的 config.json 配置文件。 + +## 命令列表 + +### 区块链 + +| 方法 | 参数 | 说明 | +| ------------------------------------------------------- | ---------------------------- | ------------------------------------------------------------ | +| [getbestblockhash](getbestblockhash.md) | | 获取当前链中高度最大的区块的散列 | +| [getblock](getblock.md) | `\` [verbose=0] | 根据指定的哈希或索引,返回对应的区块信息 | +| [getblockcount](getblockcount.md) | | 获取当前链中区块的数量 | +| [getblockhash](getblockhash.md) | `\` | 根据指定的索引,返回对应区块的散列值 | +| [getblockheader](getblockheader.md) | `\` [verbose=0] | 根据指定的哈希或索引,返回对应的区块头信息 | +| [getcommittee](getcommittee.md) | | 获取委员会成员公钥列表 | +| [getnativecontracts](getnativecontracts.md) | | 获得原生合约的列表 | +| [getnextblockvalidators](getnextblockvalidators.md) | | 获得下个区块的验证人列表 | +| [getcontractstate](getcontractstate.md) | `\` | 根据合约脚本散列,查询合约信息 | +| [getrawmempool](getrawmempool.md) | [shouldGetUnverified=0] | 获取内存中已确认的交易列表,如果参数为1,则获取内存中所有的交易列表(包括已确认和未确认交易) | +| [getrawtransaction](getrawtransaction.md) | `\` [verbose=0] | 根据指定的散列值,返回对应的交易信息 | +| [getstorage](getstorage.md) | `\` `\` | 根据合约脚本散列和存储的 key,返回存储的 value | +| [gettransactionheight](gettransactionheight.md) | `\` | 根据交易哈希获取交易所在的区块高度 | + +### 节点 + +| 方法 | 参数 | 说明 | +| ----------------------------------------------- | ------ | ------------------------------------------ | +| [getconnectioncount](getconnectioncount.md) | | 获取节点当前的连接数 | +| [getpeers](getpeers.md) | | 获得节点当前已连接/未连接的节点列表 | +| [getversion](getversion.md) | | 获取节点的版本信息 | +| [sendrawtransaction](sendrawtransaction.md) | `\` | 广播交易 | +| [submitblock](submitblock.md) | `\` | 提交新的区块
**注意**:需要成为共识节点 | + +### 智能合约 + +| 方法 | 参数 | 说明 | +| --------------------------------------- | --------------------------------------- | ---------------------------------------------- | +| [getunclaimedgas](getunclaimedgas.md) | `\
` | 查询指定地址未获取的 gas | +| [invokefunction](invokefunction.md) | `\` `\` \[params] \[sender] \[signers] | 用指定的哈希调用智能合约,传入方法名及参数 | +| [invokescript](invokescript.md) | `\