CLI Command Reference
Open the command line, navigate to the directory where Neo-CLI is located, and enter the following code to start the command line Neo node.
dotnet neo-cli.dll
This section will introduce all the commands in the command line node. You can manipulate your node with commands for creating a wallet, importing and exporting of private key, transferring, starting consensus, etc.
#
OverviewThe following tables list all the commands. You can also enter help
in the command line to view them all.
All the commands described in this document conform with these conventions:
<>
indicate a parameter.[]
is for optional parameters.|
separates multiple parameters where any one of them can be used at your choice.=
indicates the default value of the optional parameter without an input.
#
Console commandsCommand | Description |
---|---|
version | Shows the current Neo-CLI version |
help [plugin-name] | Help menu, which can also show plugin related commands. |
parse <value> | Convert the input string into various supported data format |
clear | Clear screen |
exit | Exit program |
#
Wallet commandsCommand | Parameters | Description |
---|---|---|
create wallet | <path> | Creates a wallet file. |
delete address | <address> | Delete an address from wallet. |
open wallet | <path> | Opens a wallet file. |
close wallet | Closes the current wallet. | |
upgrade wallet | <path> | Upgrades old wallet files. |
The commands listed in the table below requires you to open the wallet before invoking.
Command | Parameters | Description |
---|---|---|
change password | Changes the wallet password | |
list address | lists all the accounts in the wallet. | |
list asset | Lists all assets in the wallet. | |
list key | Lists all public keys in your wallet. | |
show gas | Lists all the GAS in your wallet. | |
create address | [count=1] | Creates address / batch create address |
import key | <wifOrFile> | Imports a private key / bulk import of private keys. |
export key | [path=null] [scriptHash=null] | Exports private keys. |
import multisigaddress | <m> <publicKeys> | Creates a multi-signature contract. |
import watchonly | <addressOrFile> | Imports the watch-only address (e.g. contract address) |
send | <id> <alias> <address> <amount> [from=null] [data=null] [signerAccounts=null] | Sends assets to the specified address. |
sign | <jsonObjectToSign> | Signs the transaction. The parameter is the json string that records the transaction information. |
cancel | <txid> [sender=null][signerAccounts=null] | Cancel unconfirmed transactions (in memory pool) |
#
Contract commandsCommand | Parameters | Description |
---|---|---|
deploy | <nefFilePath> [manifestFile] | Deploys a contract |
invoke | <scripthash> <operation> [contractParameters=null] [sender=null] [signerAccounts=null] [maxGas=20] | Invokes a contract |
update | <scriptHash> <filePath> <manifestPath> <sender> [signerAccounts=null] | Upgrade a contract |
#
Node commandsCommand | Parameters | Description |
---|---|---|
show state | Displays the current status of blockchain synchronization. | |
show pool | [verbose=False] | Displays the transactions in the memory pool (These transactions are in the state of zero confirmation). |
#
Nep17 commandsCommand | Parameters | Description |
---|---|---|
balanceof | <tokenHash> <address> | Queries the balance of specified token at the specified address |
decimals | <tokenHash> | Queries the precision of specified token |
name | <tokenHash> | Queries the name of specified token |
totalsupply | <tokenHash> | Queries the total supply of specified token |
transfer | <tokenHash> <to> <amount> [from=null] [data=null] [signersAccounts=null] | Invokes the transfer method to transfer the specified token |
#
Native contract commandsCommand | Parameters | Description |
---|---|---|
list nativecontract | Lists all the native contract names and scripthash |
#
Network commandsCommand | Parameters | Description |
---|---|---|
relay | <jsonObjectToSign> | Broadcasts the transaction. The parameter is the json string that records the transaction information. |
broadcast addr | <payload IP address> <port> | Broadcasts the IP address of the node |
broadcast block | <block hash \| block height> | Broadcasts a block |
broadcast getblocks | <block hash> | Broadcasts the getblocks request |
broadcast getdata | <inventory type> <payload> | Broadcasts the getdata request |
broadcast getheaders | <block index> | Broadcasts the getheaders request |
broadcast inv | <inventory type> <payload> | Broadcasts the inventory data |
broadcast transaction | <transaction hash> | Broadcasts a transaction |
#
Plugin commandsCommand | Parameters | Description |
---|---|---|
plugins | Lists loaded plugins | |
install | [Plugin name] | Installs the specified plugin |
uninstall | [Plugin name] | Uninstalls the specified plugin |
dump storage | <key> | Exports all or the specified state data. This command requires installation of the StatesDumper plugin. |
start consensus | Starts consensus. This command requires installation of the DBFTPlugin plugin. | |
start oracle | Starts Oracle. This command requires installation of the OracleService plugin. | |
stop oracle | Stops Oracle. This command requires installation of the OracleService plugin. | |
state root | <index> | Queries the state root with index. This command requires installation of the StateService plugin. |
state height | Queries the state height. This command requires installation of the StateService plugin. | |
get proof | <rootHash> <scriptHash> <key> | Gets proof with root hash, contract hash, and storage key. |
verify proof | <rootHash> <proof> | Verifies with root hash and proof. |
#
Voting commandsCommand | Parameters | Description |
---|---|---|
get accountstate | <address> | Gets the latest voting information of the specified account |
get candidates | Gets candidates' public keys and votes | |
get committee | Gets the committee member's public key | |
get next validators | Gets the next validator's public key | |
register candidate | <account> [maxGas=1010] | Registers the candidate |
unregister candidate | <account> | Unregisters the candidate |
vote | <senderAccount> <publicKey> | Votes for candidates |
unvote | <senderAccount> | Cancel the voting |
#
Block CommandsCommand | Parameters | Description |
---|---|---|
export blocks | <start> [block count] [export path] | Exports the blockchain data from the specified block height. The exported data can be used for offline synchronization. |
show block | <indexOrHash> | Output block details via block height or block hash. |
show contract | <nameOrHash> | Output contract details by contract name or contract hash. |
show tx | <hash> | Output transaction details via transaction hash. |
#
Log CommandsCommand | Description |
---|---|
console log on | Turn on consensus logging output |
console log off | Turn off consensus logging output |
#
Command Description#
parseConverts the input string into various supported data formats.
#
Syntaxparse
<value>
#
Exampleneo> parse NcphtjgTye3c3ZL5J5nDZhsf3UJMGAjd7oAddress to ScriptHash 0x55df8d4950eba5aef9d4d4d2610f827fcd4a7bb9Address to Base64 uXtKzX+CD2HS1NT5rqXrUEmN31U=String to Hex String 4e637068746a675479653363335a4c354a356e445a68736633554a4d47416a64376fString to Base64 TmNwaHRqZ1R5ZTNjM1pMNUo1bkRaaHNmM1VKTUdBamQ3bw==neo> parse AHVYXVTcKw==Base64 to Big Integer 12345678900000000String to Hex String 41485659585654634b773d3dString to Base64 QUhWWVhWVGNLdz09neo> parse 0x55df8d4950eba5aef9d4d4d2610f827fcd4a7bb9ScriptHash to Address NcphtjgTye3c3ZL5J5nDZhsf3UJMGAjd7oHex String to Big Integer 490249589479789641828817600658206854216357149625String to Hex String 307835356466386434393530656261356165663964346434643236313066383237666364346137626239String to Base64 MHg1NWRmOGQ0OTUwZWJhNWFlZjlkNGQ0ZDI2MTBmODI3ZmNkNGE3YmI5
If you see messy codes that is because some data types cannot be converted. You can also use https://neo.org/converter to convert.
#
create walletCreates a wallet file in the .db3 or .json format. A wallet password is required to be specified during the process.
#
Syntax create wallet <path>
#
Exampleneo> create wallet test.jsonpassword: *password: * Address: NRq91uUULStNMBmsgFQpQVe18YUcwo1rTK Pubkey: 02e7ada69ebe8f730c871ea999185a5238c80ab91abe86bfb26fdac5ebb8ae6613ScriptHash: 0x19d69593a368ba01b2aac8dc0a67d7b675e1e640
The wallet file is generated under the neo-cli root directory. If you want to set other path, you need to create the folder in advance.
#
delete addressDelete an address from wallet.
#
Syntax delete address <address>
#
Exampleneo> delete address NL4zw2c1MdaXYmGt4NWTPXFcyuNjCQrpNLWarning: Irrevocable operation!Are you sure to delete account NL4zw2c1MdaXYmGt4NWTPXFcyuNjCQrpNL? (no|yes): yesAddress 0xde6b70cbd0989167094b60b474e8f6658233b501 deleted.
#
open walletOpens the wallet file at the specified path. The wallet password is required to be entered when opening the wallet.
#
Syntax open wallet <path>
#
Exampleneo> open wallet test.jsonpassword: *
#
change passwordChanges the wallet password.
#
Syntax change password
#
Exampleneo> change passwordpassword: ***New password: ***Re-Enter Password: ***Password changed successfully
#
upgrade walletUpgrades the old .db3 wallet file into the .json format.
#
Syntax upgrade wallet <path>
#
Exampleneo> upgrade wallet test.db3Wallet file upgrade complete. New wallet file has been auto-saved at: test.json
#
show gaslists all the unclaimed GAS in the current wallet.
#
Syntaxshow gas
#
Exampleneo> show gasunclaimed gas: 16.7367406
note
This command does not show the GAS that has been claimed. Use list asset
instead.
On Neo N3, The GAS in an account is claimed automatically every time when the number of Neo in the account changes.
#
create addressCreates a new address. One can also enter create address 100
to create 100 new addresses in batches; Addresses are automatically exported to the address.txt file.
#
Syntaxcreate address [n]
#
Parametersn
: Number of addresses to create. n is an integer and defaults to 1.
#
Exampleneo> create address 3The file 'address.txt' already exists, do you want to overwrite it? (yes|no): yes[3/3]Export addresses to address.txt
#
balanceofQueries the balance of specified token at the specified address
#
Syntax balanceof <tokenHash> <address>
#
ParameterstokenHash
: The token hashaddress
: The address to query
#
Exampleneo> balanceof 0xd2c270ebfc2a1cdd3e470014a4dff7c091f699ec NcphtjgTye3c3ZL5J5nDZhsf3UJMGAjd7oInvoking script with: '0c14b97b4acd7f820f61d2d4d4f9aea5eb50498ddf5511c00c0962616c616e63654f660c14ec99f691c0f7dfa41400473edd1c2afceb70c2d241627d5b52'VM State: HALTGas Consumed: 0.0373876Result Stack: [{"type":"Integer","value":"1998380000000000"}]
{{$Token Name}} balance: 19983800
#
decimalsQueries the precision of specified token
#
Syntax decimals <tokenHash>
#
ParameterstokenHash
: The token hash
#
Exampleneo> decimals 0xd2c270ebfc2a1cdd3e470014a4dff7c091f699ecInvoking script with: '10c00c08646563696d616c730c14ec99f691c0f7dfa41400473edd1c2afceb70c2d241627d5b52'VM State: HALTGas Consumed: 0.0125075Result Stack: [{"type":"Integer","value":"8"}]Result : 8
#
nameQueries the name of specified token
#
Syntax name <tokenHash>
#
ParameterstokenHash
: The token hash
#
Exampleneo> name 0xd2a4cff31913016155e38e474a2c06d08be276cfResult: GasToken
neo> name gasResult: GasToken
#
totalsupplyQueries the total supply of specified token
#
Syntax totalsupply <tokenHash>
#
ParameterstokenHash
: The token hash
#
Exampleneo> totalsupply 0xd2a4cff31913016155e38e474a2c06d08be276cfInvoking script with: 'wh8MC3RvdGFsU3VwcGx5DBTPduKL0AYsSkeO41VhARMZ88+k0kFifVtS'VM State: HALTGas Consumed: 0.019671Result Stack: [{"type":"Integer","value":"5200017313646450"}]Result: 52000173.1364645
neo> totalsupply neoInvoking script with: 'wh8MC3RvdGFsU3VwcGx5DBT1Y+pAvCg9TQ4FxI6jBbPyoHNA70FifVtS'VM State: HALTGas Consumed: 0.019671Result Stack: [{"type":"Integer","value":"100000000"}]Result: 100000000
#
transferInvokes the transfer method to transfer the specified token.
#
Syntax transfer <tokenHash> <to> <amount> [from=null] [data=null] [signersAccounts=null]
#
ParameterstokenHash
: The token hashto
: The address you transfer the token toamount
: The amount to transferfrom
: The address you transfer the token fromdata
:The additional parameter. The default value is null.signersAccounts
: The signer's address
#
Exampleneo> transfer 0xd2c270ebfc2a1cdd3e470014a4dff7c091f699ec Nhe4mzfQRoKojkXhqxJHjANvBMT7BYAXDv 6000 NNU67Fvdy3LEQTM374EJ9iMbCRxVExgM8Y transferdata NNU67Fvdy3LEQTM374EJ9iMbCRxVExgM8YRelay tx(no|yes): ySigned and relayed transaction with hash=0x0d82a59ca2106c93e6383893d86a098d1a9fbf950c091772c61790880acc78c5
#
list nativecontractLists all the native contract names and scripthash.
#
Syntax list nativecontract
#
Exampleneo> list nativecontract ContractManagement 0xfffdc93764dbaddd97c48f252a53ea4643faa3fd StdLib 0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0 CryptoLib 0x726cb6e0cd8628a1350a611384688911ab75f51b LedgerContract 0xda65b600f7124ce6c79950c1772a36403104f2be NeoToken 0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5 GasToken 0xd2a4cff31913016155e38e474a2c06d08be276cf PolicyContract 0xcc5e4edd9f5f8dba8bb65734541df7a1c081c67b RoleManagement 0x49cf4e5378ffcd4dec034fd98a174c5491e395e2 OracleContract 0xfe924b7cfe89ddd271abaf7210a80a7e11178758 NameService 0x7a8fcf0392cd625647907afa8e45cc66872b596b
#
get accountstateGets the latest voting information of the specific account, including the address it voted, the amount of votes cast and the block height at the time of voting.
#
Syntax get accountstate <address>
#
Parameteraddress
:The address you want to query the voting information.
#
Exampleneo> get accountstate NNz4ppADL3mke7HT8RvRr5nX8zTAbNdWjvInvoking script with: 'DBQhrr+TO5ru/CWrG+m3Gq80Ff3tORHAHwwPZ2V0QWNjb3VudFN0YXRlDBT1Y+pAvCg9TQ4FxI6jBbPyoHNA70FifVtS'VM State: HALTGas Consumed: 0.0202833Result Stack: [{"type":"Struct","value":[{"type":"Integer","value":"900"},{"type":"Integer","value":"9774"},{"type":"ByteString","value":"AsNeyvySxknpefBTobcD9O\u002BQiieFUIdCtmzAWZvxQPA4"}]}]
Voted: NNuEErrm2qpLyoWUxtEy7Sgxh1cm71Ngb6Amount: 900Block: 9774
#
get candidatesGets candidates' public keys and votes
#
Syntax get candidates
#
Exampleneo> get candidatesInvoking script with: '10c00c0d67657443616e646964617465730c1425059ecb4878d3a875f91c51ceded330d4575fde41627d5b52'VM State: HALTGas Consumed: 1.0100757
Candidates:02344389a36dfc3e95e05ea2adc28cf212c0651418cfcf39e69d19d18b567b221d 49900000
#
get committeeGets the committee member's public key
#
Syntax get committee
#
Exampleneo> get committeeInvoking script with: '10c00c0c676574436f6d6d69747465650c1425059ecb4878d3a875f91c51ceded330d4575fde41627d5b52'VM State: HALTGas Consumed: 1.0100757
Committee:02344389a36dfc3e95e05ea2adc28cf212c0651418cfcf39e69d19d18b567b221d
#
get next validatorsGets the next validator's public key
#
Syntax get next validators
#
Exampleneo> get next validatorsInvoking script with: '10c00c166765744e657874426c6f636b56616c696461746f72730c1425059ecb4878d3a875f91c51ceded330d4575fde41627d5b52'VM State: HALTGas Consumed: 1.0100757
Next validators:02344389a36dfc3e95e05ea2adc28cf212c0651418cfcf39e69d19d18b567b221d
#
register candidateRegisters the candidate
#
Syntax register candidate <account> [maxGas=1010]
#
Parametersaccount
: The account to register candidate
maxGas
: The maximum GAS can be consumed. Default is 1010, where the registration fee is 1000 GAS.
#
Exampleneo> register candidate NUNtEBBbJkmPrmhiVSPN6JuM7AcE8FJ5sEInvoking script with: 'DCECSVwDcw3pu71X7c2DqNv8jNiqsw75XuAGjy+ko6bkt/YRwB8MEXJlZ2lzdGVyQ2FuZGlkYXRlDBT1Y+pAvCg9TQ4FxI6jBbPyoHNA70FifVtS'VM State: HALTGas Consumed: 1000.0104529Result Stack: [{"type":"Boolean","value":true}]relay tx(no|yes): ySigned and relayed transaction with hash=0xc30ecd2e30d2d3347e389dbdb205c6a38a663819ff8b473ad11b03e035c67bb5
#
unregister candidateUnregisters the candidate
#
Syntax unregister candidate <account>
#
Parametersaccount
: The account to unregister candidate
#
Exampleneo> unregister candidate NUNtEBBbJkmPrmhiVSPN6JuM7AcE8FJ5sEInvoking script with: 'DCECSVwDcw3pu71X7c2DqNv8jNiqsw75XuAGjy+ko6bkt/YRwB8ME3VucmVnaXN0ZXJDYW5kaWRhdGUMFPVj6kC8KD1NDgXEjqMFs/Kgc0DvQWJ9W1I='VM State: HALTGas Consumed: 0.0301137Result Stack: [{"type":"Boolean","value":true}]Relay tx(no|yes): yesSigned and relayed transaction with hash=0xa799e315956e120a51bf5b5804d9518754a844bbe4dadef3efd37ac3d15a6305
#
voteVotes for candidates
#
Syntax vote <senderAccount> <publicKey>
#
ParameterssenderAccount
: The account used to votepublickey
: The public key of the account you vote for
#
Exampleneo> vote Nhiuh11SHF4n9FE6G5LuFHHYc7Lgws9U1z 02344389a36dfc3e95e05ea2adc28cf212c0651418cfcf39e69d19d18b567b221dInvoking script with: '0c2102344389a36dfc3e95e05ea2adc28cf212c0651418cfcf39e69d19d18b567b221d0c14ef3b46067f2f47b2f7f0442aa2372085d08708ef12c00c04766f74650c1425059ecb4878d3a875f91c51ceded330d4575fde41627d5b52'VM State: HALTGas Consumed: 5.0100793Evaluation Stack: [{"type":"Boolean","value":true}]
relay tx(no|yes): ySigned and relayed transaction with hash=0x8083633ecc4827b7967ba8b0a30f02992dc524e4a5356accebdf080e9cd26df2
#
unvoteCancel the voting
#
Syntax unvote <senderAccount>
#
ParametersenderAccount
: The account to unvote
#
Exampleneo> unvote 0x39edfd1534af1ab7e91bab25fcee9a3b93bfae21Invoking script with: 'CwwUIa6/kzua7vwlqxvptxqvNBX97TkSwB8MBHZvdGUMFPVj6kC8KD1NDgXEjqMFs/Kgc0DvQWJ9W1I='VM State: HALTGas Consumed: 0.030114Result Stack: [{"type":"Boolean","value":true}]Relay tx(no|yes): ySigned and relayed transaction with hash=0x78f83fd1e0607f078fa0964a97b9972d3f4844191f6702c1750ff6d532cd5019
#
export keyExports private key of the address to the specified file. The command also requires the verification of the wallet password.
#
Syntax export key [address] [path]
#
Parametersaddress
: Address to export private key.path
: Path to the file used to store the private key.
#
ExampleExports the key to the console:
neo> export keypassword: ********L4HoTTfKfzjV8tdWv6vRaMY1cBQbsVc4euGqhPW9Mf8z6993fgMHL3raEwVsJHzovTXfgVG1HWxzmH4Zm3vMia8byszhVrvbJ38YnsXvKywrMAnBWRXUAb4Aq76ZoCCqDvGNL9nidjVwWwDr3DbMPwg1RPBLKwhNLC9rULxJmevqwYbQzJhYNvaCDPyAUAm7EkHrW5kQwLYfxTFG
Exports the key to the specified file:
neo> export key key1.txtpassword: ********
neo> export key key2.txt NPpH6FxNaVXZCrsecNWEHGLwMe87UkPdm5password: ********
#
import keyImports a private key, or a file with a number of private keys.
#
Syntax import key <wif | path>
#
Parameterswif | path
: The key to import or the file path.
#
Exampleneo> import key L4q37aCJzjEXhAUJ6npdxbjGGbyTXuWhpgYxkb2NWPmzXv4DdxiDAddress: NPpH6FxNaVXZCrsecNWEHGLwMe87UkPdm5 Pubkey: 02ff249d06faaf0b5ba865e1531bfabe07f89aef39ab59082e3bc140be0318055d
neo> import key key1.txt
If there is a specified file, the file is in the private key format. Refer to export key key.txt output.
#
import multisigaddressCreates a multi-party signed address.
#
Syntaximport multisigaddress m pubkeys...
#
Parametersm
: m is the minimal number of signatures. For example, creating a multi-party signed address with two public keys, m can be 1 or 2.pubkeys
: Public keys of multiple parties involved.
#
Exampleneo> import multisigaddress 2 03fadbc9b25d1b6827124665c50801e602240c9d8ebdda2bae49de6683f8f86af9 02ff249d06faaf0b5ba865e1531bfabe07f89aef39ab59082e3bc140be0318055dMultisig. Addr.: NN58k4Ei4nUzWxrgksHZPantyuDxWgouod
#
import watchonlyImports the watch-only address, e.g contract account.
#
Syntaximport watchonly scriptHash
#
ParametersaddressOrFile
:account address, hash, contract hash, or files storing these data
#
Exampleneo> import watchonly 0xbfe215933f29b29dacf0e8383722a62974ac8aa6Address: Nb6ZUp9h5aCKkNADpdUD5TbuJGP6wyRvE8
#
sendTransfers the asset to the specified address. The command requires the verification of the wallet password.
#
Syntaxsend <id | alias> <address> <amount> [from=null] [data=null] [signerAccounts=null]
#
Parametersid | alias
: asset ID or asset abbreviations, e.g. neo, gasaddress
: address to transfer assets toamount
: transfer amountfrom
: address to transfer assets fromdata
: the additional transaction information, which defaults to null.signerAccounts
: signer's address
#
ExampleTransfer 100 Neo to the address Ni5iS2XHazKZtXfzLJbdyDk8UUcGBZGePR:
neo> send 0xd2a4cff31913016155e38e474a2c06d08be276cf Ni5iS2XHazKZtXfzLJbdyDk8UUcGBZGePR 100password: *TXID: 0xf8b9824808c037893525a60f2f8d4ec034dffe8ac17d4142ff889e2e712d8df1
If you are not sure of the asset ID, you can enter list asset
to view all assets in the wallet.
In above example, we can also replace the asset ID with asset abbreviation, as shown below:
neo> send gas Ni5iS2XHazKZtXfzLJbdyDk8UUcGBZGePR 100password: *TXID: 0xea2454d0210aefff406097e03abd2137dc416617adac6f23842ca1914d001419
When withdrawing assets from a multi-signed address, multiple signatures are required. A json string is returned requiring signatures, as shown below:
neo> send neo NdJ5Nbs7gvmjDmqraVCJy8nPQxue1e5LK1 10password: *SignatureContext:{"type":"Neo.Network.P2P.Payloads.Transaction","hex":"AFhJmTC0i5cAAAAAAHwNhQAAAAAA12oAAAK\u002BqHRB6GdCJbuT4Xv76Od/eEbFVAD4JGXeIikja1DoxoxIKrkYu6bW7AEAVwsaDBS\u002BqHRB6GdCJbuT4Xv76Od/eEbFVAwU\u002BCRl3iIpI2tQ6MaMSCq5GLum1uwUwB8MCHRyYW5zZmVyDBT1Y\u002BpAvCg9TQ4FxI6jBbPyoHNA70FifVtSOQ==","items":{"0x54c546787fe7e8fb7be193bb254267e84174a8be":{"script":"DCECF5VDAAGEeB5UR7Pw\u002B6zmZOqSt\u002BMSJ8jnG8Tnza/M245BdHR2qg==","parameters":[{"type":"Signature","value":"gyzhpmI0KRkAJmd8cWtv7PdFLRlS\u002BHqykL0oH/S84Te4DGwRd9ja/TfKW2\u002BHTSrdfUdnN/K8CF0kf0UywcTKCw=="}],"signatures":{"02179543000184781e5447b3f0fbace664ea92b7e31227c8e71bc4e7cdafccdb8e":"gyzhpmI0KRkAJmd8cWtv7PdFLRlS\u002BHqykL0oH/S84Te4DGwRd9ja/TfKW2\u002BHTSrdfUdnN/K8CF0kf0UywcTKCw=="}},"0xecd6a6bb18b92a488cc6e8506b232922de6524f8":{"script":"FQwhAwIkKx3O1j4b9\u002BsUh29\u002B8Ca3lWf5xb6D3hlD3Rhewo5oDCECDfiFi2b/TXsKamjRHd7cx9kNKmT/os0IfExdq/QVC0AMIQIXlUMAAYR4HlRHs/D7rOZk6pK34xInyOcbxOfNr8zbjgwhAl6ElJA7k9w2nwiivX4iH1dMddlnVZHwSQfLqdruuD0QDCEDhBXQvo3BK2HT47drmPRk36t/3e50Jxw14t5iS7UQI6YMIQPJscicbi1KvWKaLbi30DrO1RilZ5O8kPSYXvftPxtIGgwhA\u002BirUYbh3qvNEOwOUJ3tT/\u002Bt5v3fU0rD4FBiaLrj/USmF0F7zmyl","parameters":[{"type":"Signature"},{"type":"Signature"},{"type":"Signature"},{"type":"Signature"},{"type":"Signature"}],"signatures":{"02179543000184781e5447b3f0fbace664ea92b7e31227c8e71bc4e7cdafccdb8e":"/3oqPLUuFig8B66JNnlyVsA9klLm10LLA5sV/oDr9uzCAPh\u002BDL0yJWx2PfEd\u002BIWijBk/re90CHyJ3w1WkB71eQ=="}}}}
When withdrawing assets from a contract, from
is the contract hash and the signer account must contain the contract hash and verify account, for example:
neo> send 0x70e2301955bf1e74cbb31d18c2f96972abadb328 NZttvm9tAhMjyxZATvqN9WFYkHYMNaXD6C 0.000002 0x436b18e7b624c0323b090141a89e79a3ab588b6a transferdata 0x436b18e7b624c0323b090141a89e79a3ab588b6a NNU67Fvdy3LEQTM374EJ9iMbCRxVExgM8Ypassword: *TXID: 0x174bab85eb004a07ae5b411f23cb6d3128346f9249305a768c286707938b4727
#
signThis command is used to sign ContractParametersContext. The translation can be broadcasted only after signing is completed.
#
Syntaxsign <jsonObjectToSign>
#
ParametersjsonObjectToSign
: The json string that records the transaction information.
#
Exampleneo> sign {"type":"Neo.Network.P2P.Payloads.Transaction","hex":"AFhJmTC0i5cAAAAAAHwNhQAAAAAA12oAAAK\u002BqHRB6GdCJbuT4Xv76Od/eEbFVAD4JGXeIikja1DoxoxIKrkYu6bW7AEAVwsaDBS\u002BqHRB6GdCJbuT4Xv76Od/eEbFVAwU\u002BCRl3iIpI2tQ6MaMSCq5GLum1uwUwB8MCHRyYW5zZmVyDBT1Y\u002BpAvCg9TQ4FxI6jBbPyoHNA70FifVtSOQ==","items":{"0x54c546787fe7e8fb7be193bb254267e84174a8be":{"script":"DCECF5VDAAGEeB5UR7Pw\u002B6zmZOqSt\u002BMSJ8jnG8Tnza/M245BdHR2qg==","parameters":[{"type":"Signature","value":"gyzhpmI0KRkAJmd8cWtv7PdFLRlS\u002BHqykL0oH/S84Te4DGwRd9ja/TfKW2\u002BHTSrdfUdnN/K8CF0kf0UywcTKCw=="}],"signatures":{"02179543000184781e5447b3f0fbace664ea92b7e31227c8e71bc4e7cdafccdb8e":"gyzhpmI0KRkAJmd8cWtv7PdFLRlS\u002BHqykL0oH/S84Te4DGwRd9ja/TfKW2\u002BHTSrdfUdnN/K8CF0kf0UywcTKCw=="}},"0xecd6a6bb18b92a488cc6e8506b232922de6524f8":{"script":"FQwhAwIkKx3O1j4b9\u002BsUh29\u002B8Ca3lWf5xb6D3hlD3Rhewo5oDCECDfiFi2b/TXsKamjRHd7cx9kNKmT/os0IfExdq/QVC0AMIQIXlUMAAYR4HlRHs/D7rOZk6pK34xInyOcbxOfNr8zbjgwhAl6ElJA7k9w2nwiivX4iH1dMddlnVZHwSQfLqdruuD0QDCEDhBXQvo3BK2HT47drmPRk36t/3e50Jxw14t5iS7UQI6YMIQPJscicbi1KvWKaLbi30DrO1RilZ5O8kPSYXvftPxtIGgwhA\u002BirUYbh3qvNEOwOUJ3tT/\u002Bt5v3fU0rD4FBiaLrj/USmF0F7zmyl","parameters":[{"type":"Signature"},{"type":"Signature"},{"type":"Signature"},{"type":"Signature"},{"type":"Signature"}],"signatures":{"02179543000184781e5447b3f0fbace664ea92b7e31227c8e71bc4e7cdafccdb8e":"/3oqPLUuFig8B66JNnlyVsA9klLm10LLA5sV/oDr9uzCAPh\u002BDL0yJWx2PfEd\u002BIWijBk/re90CHyJ3w1WkB71eQ=="}}}}Signed Output:{"type":"Neo.Network.P2P.Payloads.Transaction","hex":"AFhJmTC0i5cAAAAAAHwNhQAAAAAA12oAAAK\u002BqHRB6GdCJbuT4Xv76Od/eEbFVAD4JGXeIikja1DoxoxIKrkYu6bW7AEAVwsaDBS\u002BqHRB6GdCJbuT4Xv76Od/eEbFVAwU\u002BCRl3iIpI2tQ6MaMSCq5GLum1uwUwB8MCHRyYW5zZmVyDBT1Y\u002BpAvCg9TQ4FxI6jBbPyoHNA70FifVtSOQ==","items":{"0x54c546787fe7e8fb7be193bb254267e84174a8be":{"script":"DCECF5VDAAGEeB5UR7Pw\u002B6zmZOqSt\u002BMSJ8jnG8Tnza/M245BdHR2qg==","parameters":[{"type":"Signature","value":"gyzhpmI0KRkAJmd8cWtv7PdFLRlS\u002BHqykL0oH/S84Te4DGwRd9ja/TfKW2\u002BHTSrdfUdnN/K8CF0kf0UywcTKCw=="}],"signatures":{"02179543000184781e5447b3f0fbace664ea92b7e31227c8e71bc4e7cdafccdb8e":"gyzhpmI0KRkAJmd8cWtv7PdFLRlS\u002BHqykL0oH/S84Te4DGwRd9ja/TfKW2\u002BHTSrdfUdnN/K8CF0kf0UywcTKCw=="}},"0xecd6a6bb18b92a488cc6e8506b232922de6524f8":{"script":"FQwhAwIkKx3O1j4b9\u002BsUh29\u002B8Ca3lWf5xb6D3hlD3Rhewo5oDCECDfiFi2b/TXsKamjRHd7cx9kNKmT/os0IfExdq/QVC0AMIQIXlUMAAYR4HlRHs/D7rOZk6pK34xInyOcbxOfNr8zbjgwhAl6ElJA7k9w2nwiivX4iH1dMddlnVZHwSQfLqdruuD0QDCEDhBXQvo3BK2HT47drmPRk36t/3e50Jxw14t5iS7UQI6YMIQPJscicbi1KvWKaLbi30DrO1RilZ5O8kPSYXvftPxtIGgwhA\u002BirUYbh3qvNEOwOUJ3tT/\u002Bt5v3fU0rD4FBiaLrj/USmF0F7zmyl","parameters":[{"type":"Signature","value":"QYZ4LuSpqSWZ8RzowvPZ8U0o3HjwhPlDf2jmOV3Rglq4Rm4KvMpIqfmuLdrEkecHe1MSP1AcEvE/c2FhdZ98UQ=="},{"type":"Signature","value":"DhhX8mwnLRVVU9hRjdGJ/Pdq10ytpn8xJUOXWqy3I8cE/Midc6s3dvzMt1QH\u002BPn2xDGjkzNNcczI34reE\u002BaCpA=="},{"type":"Signature","value":"/3oqPLUuFig8B66JNnlyVsA9klLm10LLA5sV/oDr9uzCAPh\u002BDL0yJWx2PfEd\u002BIWijBk/re90CHyJ3w1WkB71eQ=="},{"type":"Signature","value":"cUmlfjxdWmPTSpHsJHqr8lLllclJNGroOmStMLXzOI4fcO3D5/JKru/rU/OC029il\u002B8sVteUmL0rEaLnldKMrQ=="},{"type":"Signature","value":"T0PQ9vQNDtDnpa3f9UtN3\u002B22SOFbVG8NBwvu3tq6YchsMbF4OmlBFtNa\u002BZuqT3fxP0r/naAYgnwHMDG8DXAeSQ=="}],"signatures":{"02179543000184781e5447b3f0fbace664ea92b7e31227c8e71bc4e7cdafccdb8e":"/3oqPLUuFig8B66JNnlyVsA9klLm10LLA5sV/oDr9uzCAPh\u002BDL0yJWx2PfEd\u002BIWijBk/re90CHyJ3w1WkB71eQ==","0302242b1dced63e1bf7eb14876f7ef026b79567f9c5be83de1943dd185ec28e68":"T0PQ9vQNDtDnpa3f9UtN3\u002B22SOFbVG8NBwvu3tq6YchsMbF4OmlBFtNa\u002BZuqT3fxP0r/naAYgnwHMDG8DXAeSQ==","020df8858b66ff4d7b0a6a68d11ddedcc7d90d2a64ffa2cd087c4c5dabf4150b40":"cUmlfjxdWmPTSpHsJHqr8lLllclJNGroOmStMLXzOI4fcO3D5/JKru/rU/OC029il\u002B8sVteUmL0rEaLnldKMrQ==","025e8494903b93dc369f08a2bd7e221f574c75d9675591f04907cba9daeeb83d10":"DhhX8mwnLRVVU9hRjdGJ/Pdq10ytpn8xJUOXWqy3I8cE/Midc6s3dvzMt1QH\u002BPn2xDGjkzNNcczI34reE\u002BaCpA==","038415d0be8dc12b61d3e3b76b98f464dfab7fddee74271c35e2de624bb51023a6":"QYZ4LuSpqSWZ8RzowvPZ8U0o3HjwhPlDf2jmOV3Rglq4Rm4KvMpIqfmuLdrEkecHe1MSP1AcEvE/c2FhdZ98UQ=="}}}}
The signed json string is returned. If the signature is complete, you can broadcast the transaction using the command relay
.
#
cancelCancel unconfirmed transactions (in memory pool). Only transactions in the memory pool can be canceled, e.g. if you send two identical transactions, you can cancel one of them in a short time (before the consensus node confirms it).
#
Syntaxcancel <txid> [sender=null] [signerAccounts=null]
#
Exampleneo> cancel 0x38d11429a6d34d2ed86213a2a020eece795f48e569b5d05a0ef3616778b03a78Network fee: 0.01232521 Total fee: 0.01232521 GASRelay tx? (no|yes): yesSigned and relayed transaction with hash:0x26bb0b2c052aa545500e4e982028c0ca782f7e66e256908637f506c8c740e1c0
#
deployDeploys a contract on the blockchain.
#
Syntaxdeploy <nefFilePath> [manifestFile]
#
ParametersnefFilePath
: Path to the executable file (.nef) of NeoVM.manifestFile
: Path to the file manifest.json, which records each interface information and configuration content of the contract.
#
Exampleneo> deploy Template.nef Template.manifest.json Script hash: 0x1e5ce27b9af630aed82bc94695fa8d424cdbe5c6Gas Consumed: 100000000
Signed and relayed transaction with hash=0xab6dd63ea36a7c95580b241f34ba756e62c767813be5d53e02a983f4e561d284
#
invokeInvokes a contract.
#
Syntaxinvoke <scriptHash> <operation> [contractParameters=null] [sender=null] [signerAccounts=null][maxGas]
#
Parametersscripthash
: Contract hash to invoke.command
: Method name in the contract, which can be followed by input parameters separated by space.contractParameters
: Parameters to invoke. You need to pass in JSON-formatted string. For ByteArray type, encode it with Base64 in advance.For example, the address
NfKA6zAixybBHHpmaPYPDywoqDaKzfMPf9
can be converted to the hexadecimal big-endian script hash0xe4b0b6fa65a399d7233827502b178ece1912cdd4
or the Base64-encoded script hash1M0SGc6OFytQJzgj15mjZfq2sOQ=
. The JSON-formatted parameters are:[{"type":"ByteArray","value":"1M0SGc6OFytQJzgj15mjZfq2sOQ="}][{"type":"Hash160","value":"0xe4b0b6fa65a399d7233827502b178ece1912cdd4"}]
sender
: Transaction sender, i.e. the GAS payment account.signerAccounts
: An array of co-signed addresses and only supports standard accounts (single address). After filling in Neo-CLI will append signatures of all addresses in the array to the invocation transaction.maxGas
: The maximum GAS can be consumed.
#
Example 1Input:
invoke 0xb7f4d011241ec13db16c0e3484bdd5dd9a536f26 symbol
Output:
Invoking script with: '10c00c046e616d650c14f9f81497c3f9b62ba93f73c711d41b1eeff50c2341627d5b52'VM State: HALTGas Consumed: 0.0103609Evaluation Stack: [{"type":"ByteArray","value":"VG9rZW5TeW1ib2w="}]
relay tx(no|yes):
VM State
: there are two states:HALT
: the virtual machine executes successfully.FAULT
: the virtual machine exits during execution due to an exception.
Gas Consumed
: the system fees consumed for smart contract invocation.Evaluation Stack
: shows the result of contract execution, where the value is encoded with Base64.
Input:
invoke 0x230cf5ef1e1bd411c7733fa92bb6f9c39714f8f9 balanceOf [{"type":"ByteArray","value":"1M0SGc6OFytQJzgj15mjZfq2sOQ="}]
Output:
Invoking script with: '0c14d4cd1219ce8e172b50273823d799a365fab6b0e411c00c0962616c616e63654f660c14f9f81497c3f9b62ba93f73c711d41b1eeff50c2341627d5b52'VM State: HALTGas Consumed: 0.0355309Evaluation Stack: [{"type":"Integer","value":"9999999900000000"}]
relay tx(no|yes): no
Output:
invoke 0x230cf5ef1e1bd411c7733fa92bb6f9c39714f8f9 balanceOf [{"type":"Hash160","value":"0xe4b0b6fa65a399d7233827502b178ece1912cdd4"}]
or
invoke 0x230cf5ef1e1bd411c7733fa92bb6f9c39714f8f9 balanceOf [{"type":"Hash160","value":"d4cd1219ce8e172b50273823d799a365fab6b0e4"}]
Output:
Invoking script with: '0c14d4cd1219ce8e172b50273823d799a365fab6b0e411c00c0962616c616e63654f660c14f9f81497c3f9b62ba93f73c711d41b1eeff50c2341627d5b52'VM State: HALTGas Consumed: 0.0355309Evaluation Stack: [{"type":"Integer","value":"9999999900000000"}]
relay tx(no|yes): no
#
Example 3Input:
neo> invoke 0x70e2301955bf1e74cbb31d18c2f96972abadb328 transfer [{"type":"Hash160","value":"0x436b18e7b624c0323b090141a89e79a3ab588b6a"},{"type":"Hash160","value":"0xb4ba98beea38621dd96a9804384db24451b1cff2"},{"type":"Integer","value":"1"}] 0x436b18e7b624c0323b090141a89e79a3ab588b6a 0x436b18e7b624c0323b090141a89e79a3ab588b6a NNU67Fvdy3LEQTM374EJ9iMbCRxVExgM8Y
Output:
Invoking script with: '110c14f2cfb15144b24d3804986ad91d6238eabe98bab40c146a8b58aba3799ea84101093b32c024b6e7186b4313c00c087472616e736665720c14bcaf41d684c7d4ad6ee0d99da9707b9d1f0c8e6641627d5b52'VM State: HALTGas Consumed: 0.0900796Result Stack: [{"type":"Boolean","value":true}]Relay tx(no|yes): no
note
After entering the invoke command, the node invokes the operation
method, and passes operation
and contractParameters
as arguments. If operation
and contractParameters
are not processed in the contract, the expected result will not be returned.
#
updateUpgrades a contract.
#
Syntaxupdate <scriptHash> <filePath> <manifestPath> <sender> [signerAccounts=null]
#
ParametersscriptHash
: hash of the contract to updatenefFilePath
: File path to the NeoVM executable file nef.manifestFile
: Path of the manifest.json file which records all the contract interfaces and configuration. If not specified, the manifest.json with the same name as nef will be automatically matched.sender
: The transaction sender that pays for GASsignerAccounts
: An array of co-signed addresses and only supports standard accounts (single address). After filling in Neo-CLI will append signatures of all addresses in the array to the invocation transaction.
#
Exampleupdate 0x3096fb5cd0a2a95b29e8e92692f0be77c4cce06f NEP17.nef NEP17.manifest.json 0xf6a3f0fda46abdeacac9eda4600a354d0687c420Contract hash: 0x3096fb5cd0a2a95b29e8e92692f0be77c4cce06fUpdated times: 0Gas consumed: 3.3317182Network fee: 0.0448052Total fee: 3.3765234 GASRelay tx? (no|yes): ySigned and relayed transaction with hash=0x4587846a2cbc8574e16ce04e95e8c73d76b88250581d81291c23f05c215273ba
#
relayAfter signing completed, this command can be used to broadcast the transaction information.
#
Syntaxrelay <jsonObjectToSign>
#
ParametersjsonObjectToSign
: The json string that records the transaction information.
#
Exampleneo> relay {"type":"Neo.Network.P2P.Payloads.Transaction","hex":"AFhJmTC0i5cAAAAAAHwNhQAAAAAA12oAAAK\u002BqHRB6GdCJbuT4Xv76Od/eEbFVAD4JGXeIikja1DoxoxIKrkYu6bW7AEAVwsaDBS\u002BqHRB6GdCJbuT4Xv76Od/eEbFVAwU\u002BCRl3iIpI2tQ6MaMSCq5GLum1uwUwB8MCHRyYW5zZmVyDBT1Y\u002BpAvCg9TQ4FxI6jBbPyoHNA70FifVtSOQ==","items":{"0x54c546787fe7e8fb7be193bb254267e84174a8be":{"script":"DCECF5VDAAGEeB5UR7Pw\u002B6zmZOqSt\u002BMSJ8jnG8Tnza/M245BdHR2qg==","parameters":[{"type":"Signature","value":"gyzhpmI0KRkAJmd8cWtv7PdFLRlS\u002BHqykL0oH/S84Te4DGwRd9ja/TfKW2\u002BHTSrdfUdnN/K8CF0kf0UywcTKCw=="}],"signatures":{"02179543000184781e5447b3f0fbace664ea92b7e31227c8e71bc4e7cdafccdb8e":"gyzhpmI0KRkAJmd8cWtv7PdFLRlS\u002BHqykL0oH/S84Te4DGwRd9ja/TfKW2\u002BHTSrdfUdnN/K8CF0kf0UywcTKCw=="}},"0xecd6a6bb18b92a488cc6e8506b232922de6524f8":{"script":"FQwhAwIkKx3O1j4b9\u002BsUh29\u002B8Ca3lWf5xb6D3hlD3Rhewo5oDCECDfiFi2b/TXsKamjRHd7cx9kNKmT/os0IfExdq/QVC0AMIQIXlUMAAYR4HlRHs/D7rOZk6pK34xInyOcbxOfNr8zbjgwhAl6ElJA7k9w2nwiivX4iH1dMddlnVZHwSQfLqdruuD0QDCEDhBXQvo3BK2HT47drmPRk36t/3e50Jxw14t5iS7UQI6YMIQPJscicbi1KvWKaLbi30DrO1RilZ5O8kPSYXvftPxtIGgwhA\u002BirUYbh3qvNEOwOUJ3tT/\u002Bt5v3fU0rD4FBiaLrj/USmF0F7zmyl","parameters":[{"type":"Signature","value":"QYZ4LuSpqSWZ8RzowvPZ8U0o3HjwhPlDf2jmOV3Rglq4Rm4KvMpIqfmuLdrEkecHe1MSP1AcEvE/c2FhdZ98UQ=="},{"type":"Signature","value":"DhhX8mwnLRVVU9hRjdGJ/Pdq10ytpn8xJUOXWqy3I8cE/Midc6s3dvzMt1QH\u002BPn2xDGjkzNNcczI34reE\u002BaCpA=="},{"type":"Signature","value":"/3oqPLUuFig8B66JNnlyVsA9klLm10LLA5sV/oDr9uzCAPh\u002BDL0yJWx2PfEd\u002BIWijBk/re90CHyJ3w1WkB71eQ=="},{"type":"Signature","value":"cUmlfjxdWmPTSpHsJHqr8lLllclJNGroOmStMLXzOI4fcO3D5/JKru/rU/OC029il\u002B8sVteUmL0rEaLnldKMrQ=="},{"type":"Signature","value":"T0PQ9vQNDtDnpa3f9UtN3\u002B22SOFbVG8NBwvu3tq6YchsMbF4OmlBFtNa\u002BZuqT3fxP0r/naAYgnwHMDG8DXAeSQ=="}],"signatures":{"02179543000184781e5447b3f0fbace664ea92b7e31227c8e71bc4e7cdafccdb8e":"/3oqPLUuFig8B66JNnlyVsA9klLm10LLA5sV/oDr9uzCAPh\u002BDL0yJWx2PfEd\u002BIWijBk/re90CHyJ3w1WkB71eQ==","0302242b1dced63e1bf7eb14876f7ef026b79567f9c5be83de1943dd185ec28e68":"T0PQ9vQNDtDnpa3f9UtN3\u002B22SOFbVG8NBwvu3tq6YchsMbF4OmlBFtNa\u002BZuqT3fxP0r/naAYgnwHMDG8DXAeSQ==","020df8858b66ff4d7b0a6a68d11ddedcc7d90d2a64ffa2cd087c4c5dabf4150b40":"cUmlfjxdWmPTSpHsJHqr8lLllclJNGroOmStMLXzOI4fcO3D5/JKru/rU/OC029il\u002B8sVteUmL0rEaLnldKMrQ==","025e8494903b93dc369f08a2bd7e221f574c75d9675591f04907cba9daeeb83d10":"DhhX8mwnLRVVU9hRjdGJ/Pdq10ytpn8xJUOXWqy3I8cE/Midc6s3dvzMt1QH\u002BPn2xDGjkzNNcczI34reE\u002BaCpA==","038415d0be8dc12b61d3e3b76b98f464dfab7fddee74271c35e2de624bb51023a6":"QYZ4LuSpqSWZ8RzowvPZ8U0o3HjwhPlDf2jmOV3Rglq4Rm4KvMpIqfmuLdrEkecHe1MSP1AcEvE/c2FhdZ98UQ=="}}}}Data relay success, the hash is shown as follows:0xc65c3b3618823238b2b5589dba54c665f86310c85a3460f901cfb0030d4dbf28
#
broadcast addrBroadcasts the IP address of a block.
#
Syntaxbroadcast addr <IPAddress> <port>
#
Exampleneo> broadcast addr 127.0.0.1 10332neo>
#
broadcast blockBroadcasts a block.
#
Syntaxbroadcast block <block-hash>
broadcast block <block-height>
#
Exampleneo> broadcast block 0xd57bbbadee0b8ff283961f886cdc6d455ab8b5301ccdf5359d7316f209064052neo> neo> broadcast block 537neo>
#
broadcast getblocksBroadcasts the getblocks request.
#
Syntaxbroadcast getblocks <block-hash>
#
Exampleneo> broadcast getblocks 0xd57bbbadee0b8ff283961f886cdc6d455ab8b5301ccdf5359d7316f209064052neo>
#
broadcast getheadersBroadcasts the getheaders request.
#
Syntaxbroadcast getheaders <block-hash>
#
Exampleneo> broadcast getheaders 0xd57bbbadee0b8ff283961f886cdc6d455ab8b5301ccdf5359d7316f209064052neo>
#
broadcast getdataBroadcasts the getdata request.
#
Syntaxbroadcast getdata <inventory type> <payload>
#
Exampleneo> broadcast getdata Block 0xd57bbbadee0b8ff283961f886cdc6d455ab8b5301ccdf5359d7316f209064052neo> neo> broadcast getdata TX 0xd57bbbadee0b8ff283961f886cdc6d455ab8b5301ccdf5359d7316f209064052neo>neo> broadcast getdata Consensus 0xd57bbbadee0b8ff283961f886cdc6d455ab8b5301ccdf5359d7316f209064052neo>
#
broadcast invBroadcasts inventory data.
#
Syntaxbroadcast inv <inventory type> <payload>
#
Exampleneo> broadcast inv Block 0xd57bbbadee0b8ff283961f886cdc6d455ab8b5301ccdf5359d7316f209064052neo> neo> broadcast inv TX 0xd57bbbadee0b8ff283961f886cdc6d455ab8b5301ccdf5359d7316f209064052neo>neo> broadcast inv Consensus 0xd57bbbadee0b8ff283961f886cdc6d455ab8b5301ccdf5359d7316f209064052neo>
#
broadcast transactionBroadcasts a transaction.
#
Syntaxbroadcast transaction <transaction hash>
#
Exampleneo> broadcast transaction 0xd57bbbadee0b8ff283961f886cdc6d455ab8b5301ccdf5359d7316f209064052neo>
#
pluginsShows all the loaded plugins.
#
Syntaxplugins
#
Exampleneo> pluginsLoaded plugins: ApplicationLogs Synchronizes the smart contract log with the NativeContract log (Notify) DBFTPlugin Consensus plugin with dBFT algorithm. LevelDBStore Uses LevelDB to store the blockchain data OracleService Built-in oracle plugin TokensTracker Enquiries NEP-17 balances and transaction history of accounts through RPC RpcServer Enables RPC for the node StatesDumper Exports Neo-CLI status data StateService Enables MPT for the node
#
installInstalls plugins.
install [Plugin name]
To install a plugin, enter the command as follows:
neo> install RpcServerDownloading from https://github.com/neo-project/neo-modules/releases/download/v3.1.0/RpcServer.zipInstall successful, please restart neo-cli.
For information about all plugins refer to Install Plug-ins.
#
dump storageExports all or the specified state data.
#
Syntaxdump storage <key>
#
export blocksExports the block data from the specified block height. The output can be used for offline synchronization.
#
Syntaxexport blocks <index>
#
Parameters<index>
: The height of the starting block from which the data is exported.
#
show blocksOutput block details via block height or block hash.
#
Syntaxshow block <indexOrHash>
#
Parameters<indexOrHash>
: The index or height of the block.
#
Exampleneo> show block 332-------------Block-------------
Timestamp: 2024/5/9 16:28:42 Index: 332 Hash: 0x988bf98f6487af8d77f25bedf48961c4a445360324e60b1f487e02bc25998c67 Nonce: 14527164885255458229 MerkleRoot: 0xf5a0bc050795ae0cf2bea36655d65585dc72246464ec27f79e919ed6f301a843 PrevHash: 0x9412af2c3601b0c962fef14f32329a1b8488327a2fe42f62e33ff27954de4b22 NextConsensus: 0x94b96e41baab7eb8b6d78d688c34b912ec76dd38 PrimaryIndex: 0 PrimaryPubKey: 027b8e84897dcdfe7cbdf7e6d7b69ddb6edd6323cbe732ea68dd2b3d44a80e80f0 Version: 0 Size: 470 Byte(s)
-------------Witness-------------
Invocation Script: DECZt8XaJ34W4PIQXjs5oD/uAwa7RxzQ4T7760os7vStFLHq7bcpomdsqpSSDrf1lY/KDEYPjP2F5M/PJcKuVHfv Verification Script: EQwhAnuOhIl9zf58vffm17ad227dYyPL5zLqaN0rPUSoDoDwEUGe0Nw6 ScriptHash: 0x94b96e41baab7eb8b6d78d688c34b912ec76dd38 Size: 110 Byte(s)
-------------Transactions-------------
0xf5a0bc050795ae0cf2bea36655d65585dc72246464ec27f79e919ed6f301a843
--------------------------------------
#
show contractOutput contract details by contract name or contract hash.
#
Syntaxshow contract <nameOrHash>
#
Parameters<nameOrHash>
: The name or hash of the contract.
#
Exampleneo> show contract 0xd2a4cff31913016155e38e474a2c06d08be276cf-------------Contract-------------
Name: GasToken Hash: 0xd2a4cff31913016155e38e474a2c06d08be276cf Id: -6 UpdateCounter: 0 SupportedStandards: NEP-17 Checksum: 2663858513 Compiler: neo-core-v3.0 SourceCode: Trusts: []
-------------Groups-------------
No Group(s).
-------------Permissions-------------
Contract: * Methods: *
-------------Methods-------------
Name: balanceOf Safe: True Offset: 0 Parameters: [Hash160] ReturnType: Integer
Name: decimals Safe: True Offset: 7 Parameters: [] ReturnType: Integer
Name: symbol Safe: True Offset: 14 Parameters: [] ReturnType: String
Name: totalSupply Safe: True Offset: 21 Parameters: [] ReturnType: Integer
Name: transfer Safe: False Offset: 28 Parameters: [Hash160, Hash160, Integer, Any] ReturnType: Boolean
-------------Script-------------
EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0A=
--------------------------------
#
show txOutput transaction details via transaction hash.
#
Syntaxshow tx <hash>
#
Parameters<hash>
: The transaction hash of transaction.
#
Exampleneo> show tx 0xf5a0bc050795ae0cf2bea36655d65585dc72246464ec27f79e919ed6f301a843-------------Transaction-------------
Timestamp: 2024/5/9 16:28:42 Hash: 0xf5a0bc050795ae0cf2bea36655d65585dc72246464ec27f79e919ed6f301a843 Nonce: 1904785219 Sender: 0x4578060c29f4c03f1e16c84312429d991952c94c ValidUntilBlock: 17611 FeePerByte: 4949 NetworkFee: 1232520 SystemFee: 9977780 Script: CwIA4fUFDBRMyVIZmZ1CEkPIFh4/wPQpDAZ4RQwUTMlSGZmdQhJDyBYeP8D0KQwGeEUUwB8MCHRyYW5zZmVyDBTPduKL0AYsSkeO41VhARMZ88+k0kFifVtSOQ== Version: 0 BlockIndex: 332 BlockHash: 0x988bf98f6487af8d77f25bedf48961c4a445360324e60b1f487e02bc25998c67 Size: 249 Byte(s)
-------------Signers-------------
Rules: [] Account: 0x4578060c29f4c03f1e16c84312429d991952c94c Scopes: CalledByEntry AllowedContracts: [] AllowedGroups: [] Size: 21 Byte(s)
-------------Witnesses-------------
InvocationScript: DEChKE7tm85XZkBDpLkYeryTMc+NBSga2Y0mJrm02i6yoSIsn4i5Ri3NcFfsvnltg28s3fqjxjoqgXYRg/ODqM10 VerificationScript: DCECe46EiX3N/ny99+bXtp3bbt1jI8vnMupo3Ss9RKgOgPBBVuezJw== ScriptHash: 0x4578060c29f4c03f1e16c84312429d991952c94c Size: 108 Byte(s)
-------------Attributes-------------
No Attribute(s).
--------------------------------------
#
start consensusStarts the consensus on the premise that the wallet has a consensus authority, allows consensus authority to be obtained on the main net through voting. This command requires installation of the DBFTPlugin. If a private chain is deployed, public key of the consensus can be set up in the protocol.json
. For more information refer to Setting up Private Chain.
#
start oracleStarts Oracle. This command requires installation of the OracleService plugin. The Oracle service is enabled only if the public key of the current wallet address has been assigned the Oracle role by the committee.
#
stop oracleStops Oracle. This command requires installation of the OracleService plugin.
#
state rootQueries the state root with index. This command requires installation of the StateService plugin.
#
Syntaxstate root <index>
#
Parameters<index>
: The block index
neo> state root 20000{"version":0,"index":20000,"roothash":"0x0121262f9833b21eae7b8d375c1c334fdd4d4500f1d3fad2da669d5b83e94157","witness":{"invocation":"DECny9LhRZpH61UNC/sXG9WEBFMl7cf1rZPT7U0tCvZa\u002BHs6rG/fz2gKTfvLBUp5lcmGDlrMlKCCfKoougYGt7s4DEAuhkhPROcr2FM5SSHCl5LFWSTrcvxa6rvmLc1NGXwpgcRHV9LY5/H6q5SnwdAW3DSspap93FjvSHqU48Mn41nGDEDI5G6bGhGvyLl8rZbT0LzAHRbQUZ2OWIcnFi/Jo/QtwZoCGrK6L3g2miCXsgkckzUsJ1DoruMzKgVEFb4t/KYBDEAWC2fagW\u002BOt6iUGyo\u002BNu0zC1jl105uLyv5bY4tE03vBjbJDTm1T3o17jC8b3HMaeYMro2IGZTSOGt3b9YF6ntiDEBaMGwM/\u002Bd\u002BkTHmBb9c\u002BuCfMkEHOez8XuyoSZotQdDCtaVMCT4wHwIHspxeGGp1iVIEtEYFhJl0EfPEObcO0YfGDEBCC3/hBNLGmusDpr4gDfD6asqjyNCGPNerYIHunu2gsOr6kr3uQJBFqaXSYp\u002BCkz9HBrc6Cq2fNz4HPn/tIo5S","verification":"FgwhAwAqLhjDnN7Qb8Yd2UoHuOnz\u002BgNqcFvu\u002BHZCUpVOgtDXDCECAM1gQDlYokm5qzKbbAjI/955zDMJc2eji/a1GIEJU2EMIQIhkM6Z1WxnvBcDTCedOLpwWTZHFtEduMhLpf3Z/AJgEQwhAzU7wXKtEGB62apHDocfRKJil\u002ByBAIP6J8aLnJSjTL/5DCECNxinjeXEq5HT3NK2m0dPLTUIuN3EeHiMupRY6Sj\u002B/qYMIQKXhyDsbFxYdeA0d\u002BFsbZj5AQhamA13R64ysGgh19j6UwwhAqPXy4P0JIWNvpx5c9df/ut8OUCIRJ9onGacn09vEIVODCEDySUJ5CjN1/ek/dSpfGeJELQPFGXd3k8En3MlrzOAeSkYC0ETje\u002Bv"}}
#
get proofGets proof with root hash, contract hash, and storage key.
#
Syntaxget proof <root hash> <script hash> <key>
#
Parameters<root hash>
: hash of the state root.<script hash>
: Contract hash<key>
: key of the storage; Base64-encoded.
neo> get proof 0x7bf925dbd33af0e00d392b92313da59369ed86c82494d0e02040b24faac0a3ca 0x79bcd398505eb779df6e67e4be6c14cded08e2f2 Fw==Bfv///8XBiQBAQ8DRzb6Vkdw0r5nxMBp6Z5nvbyXiupMvffwm0v5GdB6jHvyAAQEBAQEBAQEA7l84HFtRI5V11s58vA+8CZ5GArFLkGUYLO98RLaMaYmA5MEnx0upnVI45XTpoUDRvwrlPD59uWy9aIrdS4T0D2cA6Rwv/l3GmrctRzL1me+iTUFdDgooaz+esFHFXJdDANfA2bdshZMp5ox2goVAOMjvoxNIWWOqjJoRPu6ZOw2kdj6A8xovEK1Mp6cAG9z/jfFDrSEM60kuo97MNaVOP/cDZ1wA1nf4WdI+jksYz0EJgzBukK8rEzz8jE2cb2Zx2fytVyQBANC7v2RaLMCRF1XgLpSri12L2IwL9Zcjz5LZiaB5nHKNgQpAQYPDw8PDw8DggFffnsVMyqAfZjg+4gu97N/gKpOsAK8Q27s56tijRlSAAMm26DYxOdf/IjEgkE/u/CoRL6dDnzvs1dxCg/00esMvgPGioeOqQCkDOTfliOnCxYjbY/0XvVUOXkceuDm1W0FzQQEBAQEBAQEBAQEBAQEBJIABAPH1PnX/P8NOgV4KHnogwD7xIsD8KvNhkTcDxgCo7Ec6gPQs1zD4igSJB4M9jTREq+7lQ5PbTH/6d138yUVvtM8bQP9Df1kh7asXrYjZolKhLcQ1NoClQgEzbcJfYkCHXv6DQQEBAOUw9zNl/7FJrWD7rCv0mbOoy6nLlHWiWuyGsA12ohRuAQEBAQEBAQEBAYCBAIAAgA=
#
verify proofVerifies with root hash and proof.
#
Syntaxverify proof <root hash> <proof>
#
Parameters<root hash>
: hash of the state root.<proof>
: proof of the state root; Base64-encoded.
neo> verify proof 0x7bf925dbd33af0e00d392b92313da59369ed86c82494d0e02040b24faac0a3ca Bfv///8XBiQBAQ8DRzb6Vkdw0r5nxMBp6Z5nvbyXiupMvffwm0v5GdB6jHvyAAQEBAQEBAQEA7l84HFtRI5V11s58vA+8CZ5GArFLkGUYLO98RLaMaYmA5MEnx0upnVI45XTpoUDRvwrlPD59uWy9aIrdS4T0D2cA6Rwv/l3GmrctRzL1me+iTUFdDgooaz+esFHFXJdDANfA2bdshZMp5ox2goVAOMjvoxNIWWOqjJoRPu6ZOw2kdj6A8xovEK1Mp6cAG9z/jfFDrSEM60kuo97MNaVOP/cDZ1wA1nf4WdI+jksYz0EJgzBukK8rEzz8jE2cb2Zx2fytVyQBANC7v2RaLMCRF1XgLpSri12L2IwL9Zcjz5LZiaB5nHKNgQpAQYPDw8PDw8DggFffnsVMyqAfZjg+4gu97N/gKpOsAK8Q27s56tijRlSAAMm26DYxOdf/IjEgkE/u/CoRL6dDnzvs1dxCg/00esMvgPGioeOqQCkDOTfliOnCxYjbY/0XvVUOXkceuDm1W0FzQQEBAQEBAQEBAQEBAQEBJIABAPH1PnX/P8NOgV4KHnogwD7xIsD8KvNhkTcDxgCo7Ec6gPQs1zD4igSJB4M9jTREq+7lQ5PbTH/6d138yUVvtM8bQP9Df1kh7asXrYjZolKhLcQ1NoClQgEzbcJfYkCHXv6DQQEBAOUw9zNl/7FJrWD7rCv0mbOoy6nLlHWiWuyGsA12ohRuAQEBAQEBAQEBAYCBAIAAgA=AAI=