Commands
The ZHCash Core wallet has a rich set of commands which give comprehensive control of the wallet and blockchain transactions. There are two sets of commands that may be used with ZHCash Core wallets:
- Console commands are given to a wallet that is already running.
- Startup commands are used when starting up a wallet.
This manual focuses on the console commands which are given to a wallet that is running and can be sent using RPC (Remote Procedure Calls) or on the command line to the ZeroHourD server wallet or given to the ZeroHour-QT desktop GUI (Graphical User Interface) wallet using the Debug window Console command line (see Figure 1).
Figure 1. The ZeroHour-QT Console
Note the warning message in red in Figure 1 and be careful using the private key commands (dumpprivkey
and dumpwallet
) with Mainnet wallets.
For the server wallet ZeroHourD, console commands are given using the Command Line Interface application ZeroHour-cli on the system command line prompt.
You can always get a list of the current console commands using the help command (see Figure 3.)
Figure 3. The help command
Console Commands :hammer_and_wrench:
Console commands are given to a running ZHCash Core wallet and provide additional information and control. Console commands and are required to operate the ZeroHourD server wallet, which is a "headless" wallet with no graphical user interface.
There are 136 console commands with some good references for the 112 inherited from bitcoin. There are 13 "hidden" commands that are used by developers and won't show up in the "help" list.
Commands can have required or optional parameters and more numerous parameters are entered in JSON (JavaScript Object Notation) format with escaped double quotes ( \" ) as shown below.
Common parameters for these commands are ZHCash addresses, block hashes, contract addresses, etc. Some of the commands will have an optional parameter "minconf" (minimum confirmations) which allows you to get a response for a transaction or block that has at least that number of confirmations.
The chain query bitcoin API reference https://chainquery.com explains the parameters and gives examples with responses for the commands inherited from bitcoin. The bitcoin chain query API reverence gives 67 commands, of which 2 are not in ZHCash (estimatepriority
, getgenerate
) and two (gettransaction
, walletpassphrase
) have an additional parameter for ZHCash. See also https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs.
Advanced interfaces to the ZHCash Core wallet (full node) can use these "console commands" as RPCs (Remote Procedure Calls) over a dedicated port connection to the node. To build an exchange hot wallet or server node for a mobile DAPP (Distributed Application) you can use RPCs, which follow these same console commands. The client node offers a JSON-RPC interface over HTTP sockets to perform various operational functions and to manage the local node.
A quick comment on "accounts". Accounts was an ill-fated way from bitcoin to track balances for what are really UTXO transaction-based values, and "accounts" are deprecated and will be phased out by version 0.18.
Here are some command groupings that are useful for various tasks:
- Peer connections:
getconnectioncount
,getpeerinfo
,addnodes
,getnetworkinfo
- Staking:
getstakinginfo
,getwalletinfo
,getnetworkinfo
- Sending:
listaddressgroupings
,sendtoaddress
,sendmany
,sendmanywithdupes
- Raw transactions:
crearterawtransaction
,signrawtransaction
,combinerawtransactoins
,sendrawtransaction
- Smart contract transactions:
createcontract
,callcontract
,sendtocontract
,getaccountinfo
,getstorage
,searchlogs
,waitforlogs
Startup Commands
Startup commands give additional control and recovery options when launching the wallet. For example, you can use startup commands for various kinds of blockchain recovery techniques, additional debug logging or additional controls. If you are going to use these startup commands, make sure you have a good backup of the wallet.dat file.
See the startup commands on the ZeroHour-QT wallet with Help - Command line options:
Figure 4. Startup commands
and on the command line itself with "ZeroHourD -?":
Console Commands A - Z
For these console commands documented below, responses are given for default parameters (ZHCash version 0.16 - winter 2018/2019). Commands marked DEPRECATED should not be used because they will be removed and replaced in future versions of the wallet, for example, commands using "account" will be removed in version 0.18.
Using the command "help \
abandontransaction "txid"
Works on transactions not in the blockchain or mempool, used in testing.
abandontransaction "0cc99a30bc2064041ea4263835b4ed594ff500c56d6b14e4970aeee548e71389"
Transaction not eligible for abandonment (code -5)
abortrescan
Stops a wallet rescan triggered by a command such as importprivkey
. This command can be issued by opening a 2nd command line window (where the first window is scanning), in which case the command will stop the scan and return "true".
ZeroHour-cli abortrescan
true
addmultisigaddress nrequired ["key",...] ( "account" "address_type" )
Add a multisignature address to the wallet so you can receive and send from that address. Run the command on each machine that will be signing and backup the wallet.dat file. The address can be a ZHCash address or hex-encoded public key. Use importaddress
to add the multisig address on each signing wallet.
This functionality is only intended for use with non-watchonly addresses. See importaddress
for watchonly p2sh address support. Use of account is DEPRECATED). See also validateaddress
.
addmultisigaddress 2 "[\"ZPov6tw7Ez5rmWL5DNv1yDFqM7UbWV1629\",\"ZPov6tw7Ez5rmWL5DNv1yDFqM7UbWV1629\"]"
{
"address": "ZPov6tw7Ez5rmWL5DNv1yDFqM7UbWV1629",
"redeemScript": "7721538ef45ab52bd53508adfda3cfe82ebcaf0495963729e5ff2a8e5aeecdd4cdd23daea03cf4394ad4c578caff2d297ce937c3afba5bc56f31c786b2addf56c72ab"
}
addnode "node" "add|remove|onetry"
Attempts to add a node with a known IP address. This command is useful for new wallets that are having trouble making peer connections. Here are some good IP addresses to add, you can put these commands in one after another, then the wallet will try for a few minutes to make a peer connection with each. ZeroHourD returns nothing:
addnode 77.220.212.119:38100 add
addnode 212.86.114.52:38100 add
addnode 37.153.1.116:38100 add
addnode 185.231.69.254:38100 add
addnode 80.89.239.60:38100 add
ZeroHour-QT returns "null" after each (see Figure 6).
Figure 6. Entering the addnode command
addwitnessaddress "address" ( p2sh )
Hidden command. DEPRECATED. This command was a way to generate a SegWit address from an existing legacy address, usually a P2SH-P2WPKH addresses - Pay-to-Witness-Public-Key-Hash (P2WPKH) script embedded in a Pay-to-Script-Hash (P2SH) address. This command is mostly disabled in version 0.16 and will be removed in version 0.17. Instead, use the getnewaddress
command with address type "p2sh-segwit" or "bech32".
Launch v 0.16 ZeroHourD with -deprecatedrpc=addwitnessaddress
to run the command:
addwitnessaddress ZPov6tw7Ez5rmWL5DNv1yDFqM7UbWV1629
ZPov6tw7Ez5rmWL5DNv1yDFqM7UbWV1629
backupwallet "destination"
The destination can be a filename or path with a filename. The wallet must be fully decrypted (not just for staking only) for this command to work. ZeroHour-QT will returns "null", ZeroHourD returns nothing. On Windows:
backupwallet "C:\Users\<username>\Desktop\Backups\backup2018-10-21.dat"
null
bumpfee "txid" ( options )
Bumps the fee of a transaction, replacing it with a new transaction by adjusting the change. The new fee can be calculated automatically or by using various options.
bumpfee "cae25062777fca1bce7f860dd238af2be4495f4aef1b5a15bbee260b4c3cde2"
{
"txid": "ecbc798c140b5104ae3d5828493e8e5ef04131dd0e44eb7fa7e1abba24901a5",
"origfee": 0.00090400,
"fee": 0.00093061,
"errors": [
]
}
callcontract "address" "data" ( address )
Arguments:
- "address" (string, required) The account address
- "data" (string, required) The data hex string
- address (string, optional) The sender address hex string
- gasLimit (string, optional) The gas limit for executing the contract
TO COME
clearbanned
Clear all banned nodes IPs. ZeroHour-QT returns "null", ZeroHourD gives no response.
clearbanned
null
combinerawtransaction ["hexstring",...]
Combine multiple partially signed raw transactions into one transaction. The combined transaction may be another partially signed transaction or a fully signed transaction. Here two raw transactions are combined:
combinerawtransaction "[\"0200000001b<snip>000000\", \"0200000001c<snip>000000\"]"
0200000001b<snip>000000
createcontract "bytecode" (gaslimit gasprice "senderaddress" broadcast)
Publish a smart contract for the given bytecode, using default gas price of 0.00000040 and gas amount of 2,500,000. Returns the transaction ID and the contract address hash.
createcontract 60606040<snip>41701d0029
{
"txid": "a1d823cb5ce776200dcbe729d901d4e1d31ad5bb8d835db0f704g73ac8e74d3",
"sender": "ZPov6tw7Ez5rmWL5DNv1yDFqM7UbWV1629",
"hash160": "efe574bu5ce54a7eb33f96e4336accbed826ffe",
"address": "4853cd349027fe239fed85837456b3c48aae42a"
}
createmultisig nrequired ["key",...]
DEPRECATED. Use addmultisigaddress
.
createrawtransaction [{"txid":"id","vout":n},...] {"address":amount,"data":"hex",...} ( locktime ) ( replaceable )
Create a hex-encoded raw transaction sending some inputs to outputs. The transaction must then be signed and sent to the network, see signrawtransaction
and sendrawtransaction
. Returns a hex-encoded raw transaction. If you are sending coins make sure to create a change address so the change can be returned; any difference between the input values and output values will be taken as the transaction fee. If you don't work out the math you could pay a big transaction fee.
createrawtransaction "[{\"txid\":\"17b3f9ef530695ef2e0368e445a3b59bf12811bdfd42325bb14248e72deb7e2\",\"vout\":0}]" "{\"ZPov6tw7Ez5rmWL5DNv1yDFqM7UbWV1629\":1.0, \"ZPov6tw7Ez5rmWL5DNv1yDFqM7UbWV1629\":0.99}"
020000001d637cf207c6418fb6220cfcb2b141ba5d230f0ba0a43c68b358aff9a8a6000000000fffffff0509e5f50480000001983a952d5fb15a70832ffdc3cadd3dc7749a49bf053ed6defacd09ef6060000000187aa814bd4ae4167bebbf56bb7c51c5eabf35d50a5c6e7f33ad0000000
decoderawtransaction "hexstring" ( iswitness )
Gives the decoded data from a raw hex-encoded transaction. Here we decode the results from createrawtransaction
above.
decoderawtransaction 0200000<snip>f33ad0000000
{
"txid": "c93dace459f5ac38c9d28ded224e47364abdde5e3fa947dc2d9c4422afb8852",
"hash": "c93dace459f5ac38c9d28ded224e47364abdde5e3fa947dc2d9c4422afb8852",
"version": 2,
"size": 119,
"vsize": 119,
"locktime": 0,
"vin": [
{
"txid": "17b3f9ef530695ef2e0368e445a3b59bf12811bdfd42325bb14248e72deb7e2",
"vout": 0,
"scriptSig": {
"asm": "",
"hex": ""
},
"sequence": 4384362583
}
],
"vout": [
{
"value": 1.00000000,
<snip>
}
]
}
decodescript "hexstring"
Decode a hex-encoded script, for example, decode the script for a mulitsig address:
decodescript 52460396bc49812bad50949fbc0bbd44e95bf32a5695519b3ff267a5d93cba3bd169b2393cd4864da4c2786dd3322fcfcb239c3db185ef33fa14836b8fecf36c68bb84ddac92f2
{
"asm": "2 0396c2483bbc207827fbc06fb32f48bf28450b5fb973032b742aeedd98dadcf3ba 02ba529ef3455bcc4339dbd7269acc2de135ff65a33c706a9beef48c37ab2a95ab 2 OP_CHECKMULTISIG",
"reqSigs": 2,
"type": "multisig",
"addresses": [
"ZPov6tw7Ez5rmWL5DNv1yDFqM7UbWV1629",
"ZPov6tw7Ez5rmWL5DNv1yDFqM7UbWV1629"
],
"p2sh": "mKa7c52cX97eK4vdk35jV442p3j59hk3R"
}
disconnectnode "[address]" [nodeid]
Disconnects a peer (node) using either the IP address or node number. ZeroHour-QT will return "null", ZeroHourD will return nothing.
disconnectnode "35.198.0.76:38100"
null
dumpprivkey "address"
Displays the private key for a given address in WIF (Wallet Import Format). The wallet must be unlocked (and not for "staking only") for this command to work.
dumpprivkey "ZPov6tw7Ez5rmWL5DNv1yDFqM7UbWV1629"
KwxLh9CwxJydu22LUgGCFKFY6o7a7qa432uTqEoto4oW18NeqiBB
dumpwallet "filename"
Writes all the wallet private keys to a file in clear text (unencrypted) format. The wallet must be fully decrypted (not just for staking only) for this command to work. Returns the filename. Dumpwallet will save all the private keys and their addresses; it will not save watchonly addresses (which do not have private keys in the wallet). This file contains all the private keys in the wallet (1,000 or more), be very careful and do not store the dump file online.
On PC:
dumpwallet "C:\Users\<username>\Desktop\Backups\dump 2019-12-30.txt"
{
"filename": "C:\\Users\\<username>\\Desktop\\Backups\\dump 2019-12-30.txt"
}
File:
Wallet dump created by ZHCash v0.16.1.0-0806c12c4-dirty
* Created on 2019-12-30T01:01:01Z
* Best block at time of backup was 241161 (b11d5169d66d39cbcd848e2ea3f9adfcee1c22af945f100aec9e762d88609e2e),
mined on 2019-12-30T01:01:01Z
extended private masterkey: <snip>
On Mac:
dumpwallet /Users/<USERNAME>/Desktop/dump_2018-12-15.txt
{
"filename": "/Users/<USERNAME>/Desktop/dump_2018-12-15.txt"
}
File:
Wallet dump created by ZHCash v0.16.2.0-47a30461d-dirty
* Created on 2018-12-16T02:22:59Z
* Best block at time of backup was 148510
(ca8a9457a69882b395bf56671e3661e148d3aca4a7b6c77398804229e7fb58f4),
mined on 2018-05-06T02:45:52Z
extended private masterkey: <snip>
encryptwallet "passphrase"
Encrypts the wallet with "passphrase" for first-time encryption. After encryption, any calls that interact with private keys such as sending or signing will require passphrase entry to enable these functions. See also walletpassphrase
, walletlock
and walletpassphrasechange
. After this command runs, the wallet will shut down.
encryptwallet "you should always use a long and strong passphrase"
(wallet exits)
echo "message"
Hidden command. Simply echo back the input arguments. This command is for testing.
The difference between echo
and echojson
is that echojson
has argument conversion enabled in the client-side table in ZeroHour-cli and the GUI. There is no server-side difference. Here we echo the parameters used to setup a multisig address.
echo "[\"ZRmx9S5FUnvpTjPXfdG2LBRWfyEE6cdNbC\",\"ZRmx9S5FUnvpTjPXfdG2LBRWfyEE6cdNbC\"]"
[
"[\"ZRmx9S5FUnvpTjPXfdG2LBRWfyEE6cdNbC\",\"ZRmx9S5FUnvpTjPXfdG2LBRWfyEE6cdNbC\"]"
]
echojson "message"
Hidden command. Simply echo back the input arguments. This command is for testing.
The difference between echo
and echojson
is that echojson
has argument conversion enabled in the client-side table in ZeroHour-cli and the GUI. There is no server-side difference. Here we echo the parameters used to setup a multisig address.
echojson
"[\"ZRmx9S5FUnvpTjPXfdG2LBRWfyEE6cdNbC\",\"ZRmx9S5FUnvpTjPXfdG2LBRWfyEE6cdNbC\"]"
[
[
"ZRmx9S5FUnvpTjPXfdG2LBRWfyEE6cdNbC",
"ZRmx9S5FUnvpTjPXfdG2LBRWfyEE6cdNbC"
]
]
estimatefee nblocks
DEPRECATED. Please use estimatesmartfee
for better estimates. Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within nblocks blocks.
estimatefee 10
estimatefee is deprecated and will be fully removed in v0.17.
estimaterawfee conf_target (threshold)
Hidden command. WARNING: This command is unstable and may disappear or change, and the results are tightly coupled to the calling parameters.
Gives fee estimates for short, medium, and long term confirmations, and gives mempool statistics for transactions with those fees. Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within conf_target blocks.
estimaterawfee 6
{
"short": {
"feerate": 0.01000002,
"decay": 0.962,
"scale": 1,
"pass": {
"startrange": 490954,
"endrange": 1e+099,
"withintarget": 14.31,
"totalconfirmed": 14.31,
"inmempool": 0,
"leftmempool": 0
},
"fail": {
"startrange": 0,
"endrange": 490954,
"withintarget": 3.57,
"totalconfirmed": 3.57,
"inmempool": 0,
"leftmempool": 0
}
},
"medium": {
"feerate": 0.00419464,
"decay": 0.9952,
"scale": 2,
"pass": {
"startrange": 403909,
"endrange": 490954,
"withintarget": 28.94,
"totalconfirmed": 28.94,
"inmempool": 0,
"leftmempool": 0
},
"fail": {
"startrange": 0,
"endrange": 403909,
"withintarget": 2.45,
"totalconfirmed": 2.45,
"inmempool": 0,
"leftmempool": 0
}
},
"long": {
"feerate": 0.00420764,
"decay": 0.99931,
"scale": 24,
"pass": {
"startrange": 403909,
"endrange": 626596,
"withintarget": 190,
"totalconfirmed": 190,
"inmempool": 0,
"leftmempool": 0
},
"fail": {
"startrange": 0,
"endrange": 403909,
"withintarget": 12.93,
"totalconfirmed": 12.93,
"inmempool": 0,
"leftmempool": 0
}
}
}
estimatesmartfee conf_target ("estimate_mode")
Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within conf_target blocks.
estimatesmartfee 10
{
"feerate": 0.00420597,
"blocks": 10
}
fromhexaddress "hexaddress"
Converts a raw hex address to a base 58 pubkeyhash address. Returns the base58 pubkeyhash address.
fromhexaddress 9467c4cbd6c4bb736cf4724de25a298bc529bfa3
QXvN7L3D2NkdPgt20rYrGkSPCggwkKbqa
See gethexaddress
to convert a base58 pubkeyhash to a hex address.
fundrawtransaction "hexstring" ( options iswitness )
Select and add inputs to a transaction until it has enough in value to meet its out value. Collects one or more unspent transactions as inputs, and computes and specifies the change amount. Note that inputs which were signed may need to be resigned after completion since in/outputs have been added. The inputs added will not be signed, use signrawtransaction
for that.
fundrawtransaction "02000000000140620b00000000001875c9289dc9ffac451edb8229dd6e95221cd3b5c23af2698ec00000000"
{
"hex": "020000000150<snip 100 bytes>c3fb7a7636798bd00000000",
"changepos": 1,
"fee": 0.00090400
}
generate nblocks ( maxtries )
Mine up to nblocks blocks immediately to an address in the wallet. Used with the regression test "regtest" private test blockchain. Can use generate 1
to publish waiting transactions in the next block, or generate 600
to initialize a new regtest blockchain.
docker exec myapp qcli generate 600
[
"5476f8f1c5feb8dd0eaecb113715337a418ae2538f478bb2e5454a801e2aec15",
"465b21528a217250ed300d0636e7838f8eb2539afec2a87e7052e2f901e31c03",
<snip 596 block hashes>
"5716637b80c70d3b0f6cb338fc772ac952c535fa19be086ee2e9c2e97d5ef396",
"59cde5be7929118bfc3239a93226eb35b7e0093fe9b6b7007b126365ab04901a"
]
generatetoaddress nblocks address (maxtries)
Mine up to nblocks immediately to a specified address. Used with the regression test "regtest" private test blockchain. Here we generate 10 genesis blocks on regtest with 20,000 Test ZHCash each, plus an initial block, and listaddressgroupings
shows the result:
PS C:\Users\Test> docker exec myapp qcli generatetoaddress 10 "ZRmx9S5FUnvpTjPXfdG2LBRWfyEE6cdNbC"
[
"7994c09b3c5a4f31976144a429695140ee4e0747de36a5eae4aefb169a8f558",
"79cd57805f061d964428dff08b03a91a3a7245bc6d6ea01f3bb735bac62decf",
"38cfab367ece8f34d4f48838ca9c43fc87873919dbe5113302e316890304adc",
"41d8f6276e7544d0992e95c216d42be391a3cdf72cd8ba128f7c8b879d7a1b8",
"3d270dfae9927870f342c6056adfdb3c6b121b6d38fc1a60e965deb33207035",
"5fb82e9978f83afc7c30bbdb6d195f5a26e8beace00a57e7581b1b4376f1351",
"65bce2a9f180246245944e235fa0c86fba2502e279b846f7e14e3265d620031",
"7d676d46c2c4008051cb4660a74ff0899ac647d8c1afedeabbe6a7fe935b7be",
"35482c05e5b5b173cd5ae3e1665d9b33811a4358249d566fded891b9d772ac5",
"06d5849f0b3c91ad215e364d183b39c4e156ea4024cb5337cadc47fb2a54cca"
]
PS C:\Users\Test> docker exec myapp qcli listaddressgroupings
[
[
[
"qNe5aDdubCGRaTp7vDYL4BASjzVH7c7Yc",
2200000.00000000
]
]
]
getaccount "address"
DEPRECATED. Returns the account name for a given address.
getaccount "ZRmx9S5FUnvpTjPXfdG2LBRWfyEE6cdNbC"
My trading Acct 101
getaccountaddress "account"
DEPRECATED. Returns the current ZHCash address for an account. Use the null account "" for the default address.
getaccountaddress "My trading Acct 101"
ZRmx9S5FUnvpTjPXfdG2LBRWfyEE6cdNbC
getaccountinfo "contract address hash"
Returns information about a contract including storage (the ZRC20 balance for every address) and the code. The command may take several minutes to return, depending on the size of the storage (number of token holders). Here is the INK contract.
getaccountinfo fe59cbc1704e89a698571413a81f0de9d8f00c69
{
"address": "fe59cbc1704e89a698571413a81f0de9d8f00c69",
"balance": 0,
"storage": {
"00009fe46099bb10054d8b89985c4729a9e8e06539e462e9d250f6afc80ac616": {
"50e4c63c65830a6709ce0dbc387bbdcef75805769b71841b8d401049e77a64a2":
"0000000000000000000000000000000000000000000000000000000000000064"
},
"0000dd359df16177c5a00a2155979a1ca105df754abbe99bb09af5abc84d4aa4": {
"896176e7c566fd067c483861fcad197b31e0f9206ee19b71aa704d8978eb2bdc":
"0000000000000000000000000000000000000000000000000000000000000001"
},
<snip>
"fffd29bb4ec023344772b5c3cda826cba78eed7cc88791357ee4ae9fdee2f0aa": {
"3f2cc887dcd9aaf8b642c415b8201a833f08695db6e6dbc3f41b6376a8467452":
"000000000000000000000000000000000000000000000000000000006e44c280"
}
},
"code": "606060405236 <snip> c62c0029"
}
getaddednodeinfo ( "node" )
Returns information about nodes that have been manually added using the addnode
command.
getaddednodeinfo
[
{
"addednode": "77.220.214.41:38100",
"connected": true,
"addresses": [
{
"address": "91.201.25.182:38100",
"connected": "outbound"
}
]
},
{
"addednode": "212.86.114.52:38100",
"connected": true,
"addresses": [
{
"address": "37.153.1.116:38100",
"connected": "outbound"
}
]
}
]
getaddressesbyaccount "account"
DEPRECATED. Returns the list of addresses for the given account.
getaddressesbyaccount "MyAccount1"
[
"ZJmtRez55BKhS3ATGcHSPo3auiUXkiEsvK",
"ZJmtRez55BKhS3ATGcHSPo3auiUXkiEsvK"
]
getbalance ( "account" minconf include_watchonly )
Get the balance in ZHCash for a wallet.
getbalance
1.53160855
getbestblockhash
Returns the block hash of the most recent block.
getbestblockhash
a18adc4fb204fe1818c30e3003fa8c8bf1833692d6df7dbb66d1569d27b18f8e
getblock "blockhash" ( verbosity )
Returns information about a block.
getblock a18adc4fb204fe1818c30e3003fa8c8bf1833692d6df7dbb66d1569d27b18f8e
{
"hash": "a18adc4fb204fe1818c30e3003fa8c8bf1833692d6df7dbb66d1569d27b18f8e",
"confirmations": 1,
"strippedsize": 1642,
"size": 1678,
"weight": 6604,
"height": 244847,
"version": 536870912,
"versionHex": "20000000",
"merkleroot": "8b5bc1b8201c483b3d2a8ea528429c73755cd4d026f4ea9ec000a8b9ff4d6913",
"hashStateRoot": "8c72ed6a22f205a31965acc8deb4e5a83aa1b3e9c2eb72b41fb966c244bbf7ae",
"hashUTXORoot": "a4a9138f1c02a7a8f2948cf255be5c85a774f0c58e55e754eeed83e41e44b0e3",
"tx": [
"be6f9a76ea5e495102504bcd4e0975006f9287421535eb830812bf225fd85a81",
"ef1153d23cbf664ddf37e93ad3995c77faba5f9425c9a8edf07173d10d68cc7d",
"28368d7c9afe354ee47322a21943191f41adef227b4cd28f808672a5fd6502ca",
"287ba39ef4b2f08dcf94bca8390749440fa3ef955c7270dc13ceff63d5a547a0",
"d9454d185072e44b7eedfd7d99d547af715e7966b774cc58c4378cd21404b6c1"
],
"time": 1539478304,
"mediantime": 1539478016,
"nonce": 0,
"bits": "1a06ff51",
"difficulty": 2397623.192092059,
"chainwork": "0000000000000000000000000000000000000000000000ae38c2396a362a5cad",
"previousblockhash": "4844ea8b549bda9a1d95050d68846f5943f07fbb39709cdd0c386efea193582d",
"flags": "proof-of-stake",
"proofhash": "00018df67d4d91255e3ccc6256ec894267aedddb0b17addc27984d33bbda0163",
"modifier": "a7d1d4fd5670a282ae5c8f231d3473eaa21ae89fe344f8101847fc11da8e6262",
"signature": "3044022019ef654d26e49f7bfa8cd2793fb4db7ab9017f82ec480f723230633a68757fb0022006d9137a72b61faf249587dcc323c1b097bfd1c923fba6be543d4d5227d4fc15"
}
getblockchaininfo
Returns information about the blockchain. Here "blocks" equals "headers", so this wallet is synced to the latest blocks. "moneysupply" gives the total ZHCash created (genesis blocks + all block rewards). "size_on_disk" gives the local storage size for blocks.
getblockchaininfo
{
"chain": "main",
"blocks": 299495,
"headers": 299495,
"bestblockhash": "5a414f062b69ed29b50decd5b06a810b6c9d7970e1596386447f89798fa3ca7e",
"difficulty": 3024079.571373563,
"moneysupply": 101177980,
"mediantime": 1547361808,
"verificationprogress": 0.9999963369857782,
"initialblockdownload": false,
"chainwork": "0000000000000000000000000000000000000000000000d32917f4beda97dea",
"size_on_disk": 1533747593,
"pruned": false,
"softforks": [
{
"id": "bip34",
"version": 2,
"reject": {
"status": true
}
},
{
"id": "bip66",
"version": 3,
"reject": {
"status": true
}
},
{
"id": "bip65",
"version": 4,
"reject": {
"status": true
}
}
],
"bip9_softforks": {
"csv": {
"status": "active",
"startTime": 0,
"timeout": 999999999999,
"since": 6048
},
"segwit": {
"status": "active",
"startTime": 0,
"timeout": 999999999999,
"since": 6048
}
},
"warnings": ""
}
Figure 7. The getblockchaininfo
command
getblockcount
Returns the number of blocks in the main (longest with most difficulty) blockchain.
getblockcount
277888
getblockhash height
Returns the hash of the main blockchain for the given block height (not an orphan block).
getblockhash 277888
8c0a43d58e96bd081209253eb9406c98ab3771c900cc05d793a62c48f3b1c030
getblockheader "hash" ( verbose )
Returns hex or decoded data for the header of the given block hash.
getblockheader 8c0a43d58e96bd081209243eb9406c98ab3771c900cc05d793a62c48f3b1c03f
{
"hash": "8c0a43d58e96bd081209243eb9406c98ab3771c900cc05d793a62c48f3b1c03f",
"confirmations": 1,
"height": 244848,
"version": 536870912,
"versionHex": "20000000",
"merkleroot": "55e9df47918882e9da67fca364102785f95f630277251e0f02c5a999a5ad7222",
"time": 1539478576,
"mediantime": 1539478048,
"nonce": 0,
"bits": "1a057777",
"difficulty": 3068960.095125648,
"chainwork": "0000000000000000000000000000000000000000000000ae38f10db922d370e0",
"hashStateRoot": "8c72ed6a22f205a31965acc8deb4e5a83aa1b3e9c2eb72b41fb966c244bbf7ae",
"hashUTXORoot": "a4a9138f1c02a7a8f2948cf255be5c85a774f0c58e55e754eeed83e41e44b0e3",
"previousblockhash": "a18adc4fb204fe1818c30e3003fa8c8bf1833692d6df7dbb66d1569d27b18f8e",
"flags": "proof-of-stake",
"proofhash": "00001121392ae309cf450c96f461cc4dcbaab48a07da28b3c391774a5051ea13",
"modifier": "d48db9884b7fd19852db420ad8faee6a51ca122574c041155965ac7de4cfe10c"
}
getblocktemplate ( TemplateRequest )
Returns data needed to construct a block, and has a number of TemplateRequst parameters. The default (no TemplateReqest) gives:
getblocktemplate
{
"capabilities": [
"proposal"
],
"version": 536870912,
"rules": [
"csv",
"segwit"
],
"vbavailable": {
},
"vbrequired": 0,
"previousblockhash": "584350297b043c72e04afc9a5b5e61d5067b1c478554927dffb3101ccf681925",
"transactions": [
{
"data": "0200000000020000000000000000000084d71700000000015100000000",
"txid": "65b1a6eb24a3e0833a986eb88f969784811e2143ffce51d630873c1a49a2b596",
"hash": "65b1a6eb24a3e0833a986eb88f969784811e2143ffce51d630873c1a49a2b596",
"depends": [
],
"fee": -9223335579943919278,
"sigops": -8646875390281014959,
"weight": 116
}
],
"coinbaseaux": {
"flags": ""
},
"coinbasevalue": 0,
"longpollid": "584350297b043c72e04afc9a5b5e61d5067b1c478554927dffb3101ccf681925654",
"target": "000000000000052f650000000000000000000000000000000000000000000000",
"mintime": 1542420161,
"mutable": [
"time",
"transactions",
"prevblock"
],
"noncerange": "00000000ffffffff",
"sigoplimit": 80000,
"sizelimit": 8000000,
"weightlimit": 8000000,
"curtime": 1542420909,
"bits": "1a052f65",
"height": 265308
}
getchaintips
Return information about all known tips in the block tree, including the main chain as well as orphaned branches. Will display chain tips since the wallet launched because only the main chain will be synced from other peers when this wallet launched. The status "active" is the mainchain, "valid-fork" are orphan blocks, and "valid headers" are not on the blockchain.
getchaintips
[
{
"height": 244849,
"hash": "87458fe59d6f0e7957030d1a30029dad1ef94782d747db46e5e83effa45caa4c",
"branchlen": 0,
"status": "active"
},
{
"height": 244315,
"hash": "7689474e181547e41c4ffc0afbbcb037b2a680bca52f93d186fe58a849cecc0f",
"branchlen": 1,
"status": "valid-fork"
},
{
"height": 242324,
"hash": "7da31893bf1e531b67711d7e831dd799b753503109e04ea0d96ff028acbee313",
"branchlen": 1,
"status": "valid-headers"
},
{
"height": 240795,
"hash": "b5ddb716d5d0a50e38e948c30d51a03e8982584a0c896a216ddf5d46c0630101",
"branchlen": 1,
"status": "valid-fork"
},
<snip>
getchaintxstats ( nblocks blockhash )
Compute statistics about the total number and rate of transactions in the chain, where the default "window" is the last one month.
- "time" gives the Unix timestamp for the last block in the window
- "txcount" gives the total transactions from the launch of the blockchain
- "window_block_count" gives the number of blocks in the window (675 TX/day * 30 days)
- "window_interval" gives the window length in seconds
- "txrate" gives the average transactions per second (TPS) in the window
getchaintxstats
{
"time": 1540774144,
"txcount": 2361329,
"window_block_count": 20250,
"window_tx_count": 135311,
"window_interval": 2928224,
"txrate": 0.046209238091075
}
getconnectioncount
Get the peer connection count for the wallet, typically 8 for outgoing only peer connections, or up to 125 for outgoing + incoming connections.
getconnectioncount
8
getdifficulty
Proof-of-stake difficulty gives the Proof of Stake consensus target from the most recent block (proof-of-work is not used after the genesis blocks).
getdifficulty
{
"proof-of-work": 1.52587890625e-005,
"proof-of-stake": 1671018.148846696
}
gethexaddress "address"
Converts a base58 pubkeyhash address to a hex address for use in smart contracts, returns the hex address.
gethexaddress ZPov6tw7Ez5rmWL5DNv1yDFqM7UbWV1629
9467c4cbd6c4bb736cf4724de25a298bc529bfa3
See fromhexaddress
to convert a hex address to base58 pubkeyhash.
getinfo
Hidden command. DEPERCATED. Command line interfaces (but not the ZeroHour-QT GUI wallet) may invoke this command using -getinfo
. The wallet below has 8 peer connections, and is unlocked for a long time ("unlocked until" is Unix epoch time in seconds). Use getpeerinfo
to check computer clock compared to "timeoffset" for other peers in the network.
ZeroHour-cli -getinfo
{
"version": 160200,
"protocolversion": 70016,
"walletversion": 130000,
"balance": 2.00000000,
"stake": 0.00000000,
"blocks": 281989,
"timeoffset": 0,
"connections": 8,
"proxy": "",
"difficulty": {
"proof-of-work": 1.52587890625e-005,
"proof-of-stake": 1928119.729097471
},
"testnet": false,
"moneysupply": 101107956,
"keypoololdest": 1507071638,
"keypoolsize": 1000,
"unlocked_until": 1644835797,
"paytxfee": 0.00000000,
"relayfee": 0.00400000,
"warnings": ""
}
getmemoryinfo ("mode")
Gives information about memory usage.
getmemoryinfo
{
"locked": {
"used": 32,
"free": 262112,
"total": 262144,
"locked": 0,
"chunks_used": 1,
"chunks_free": 2
}
}
getmempoolancestors txid (verbose)
If the given transaction is in the mempool, returns all its in-mempool ancestors.
getmempoolancestors 31d44105e8c71234f2c1ef3c3104c2a5d34fd47134207bb2a293dc37361debb7
[
"fa8354c63c87b631c70ca6edaac60055fcd2e9759a89161af4fc09532085ca10",
"9d28428b5867c0257c30262bb23569e7ef819ff00bb7563e8c90cee53b0ae83b",
"95bf14c60e6ec50a2a0c04e70bdc5be0f6b2bc984194b8afaf648181233d3c49",
"c7e93a793a9e63152bc95f060af14f7741bf1fe7f4d52284815798fe5518de56"
]
getmempooldescendants txid (verbose)
If the given transaction is in the mempool, returns all its in-mempool descendants.
getmempooldescendants 95bf14c60e6ec50a2a0c04e70bdc5be0f6b2bc984194b8afaf648181233d3c49
[
"fa8354c63c87b631c70ca6edaac60055fcd2e9759a89161af4fc09532085ca10",
"9d28428b5867c0257c30262bb23569e7ef819ff00bb7563e8c90cee53b0ae83b",
"c7e93a793a9e63152bc95f060af14f7741bf1fe7f4d52284815798fe5518de56",
"31d44105e8c71234f2c1ef3c3104c2a5d34fd47134207bb2a293dc37361debb7"
]
getmempoolentry txid
Get mempool data for a given transaction in the mempool.
getmempoolentry "0cc99a30bc2064041ea4263835b4ed594ff500c56d6b14e4970aeee548e71389"
{
"size": 373,
"fee": 0.00149600,
"modifiedfee": 0.00149600,
"time": 1539823932,
"height": 221206,
"descendantcount": 1,
"descendantsize": 373,
"descendantfees": 149600,
"ancestorcount": 1,
"ancestorsize": 373,
"ancestorfees": 149600,
"wtxid": "0cc99a30bc2064041ea4263835b4ed594ff500c56d6b14e4970aeee548e71389",
"depends": [
]
}
getmempoolinfo
Returns details on the active state of the memory pool. Here a single transaction is waiting in the memory pool:
getmempoolinfo
{
"size": 1,
"bytes": 223,
"usage": 1072,
"maxmempool": 300000000,
"mempoolminfee": 0.00400000,
"minrelaytxfee": 0.00400000
}
getmininginfo
Gives mining information including network weight ("netstakeweight" of 12.27 million shown below) and wallet weight ("stakeweight" of 107.6).
getmininginfo
{
"blocks": 453656,
"currentblockweight": 4000,
"currentblocktx": 0,
"difficulty": {
"proof-of-work": 1.62587890625e-005,
"proof-of-stake": 5785501.473223674,
"search-interval": 34847
},
"blockvalue": 400000000,
"netmhashps": 0,
"netstakeweight": 1226715419614939,
"errors": "",
"networkhashps": 80603867856378.4,
"pooledtx": 4,
"stakeweight": {
"minimum": 10759890919,
"maximum": 0,
"combined": 10759890919
},
"chain": "main",
"warnings": ""
}
getnettotals
Gives the network traffic statistics since the wallet launched.
getnettotals
{
"totalbytesrecv": 923333,
"totalbytessent": 279356,
"timemillis": 1539478945470,
"uploadtarget": {
"timeframe": 86400,
"target": 0,
"target_reached": false,
"serve_historical_blocks": true,
"bytes_left_in_cycle": 0,
"time_left_in_cycle": 0
}
}
getnetworkhashps ( nblocks height )
DEPRECATED. Returns a network hash value related to block mining difficulty, which is not relevant to ZHCash Proof of Stake, for which the network hashes per second is the total number of nodes divided by 16 seconds.
getnetworkhashps
78300177154693.26
getnetworkinfo
Gives the parameters for IPv4, IPv6 and Tor (Onion) network connections. Use getpeerinfo
to check computer clock "timeoffset" to other peers in the network, not this value from getnetworkinfo
.
getnetworkinfo
{
"version": 160100,
"subversion": "/Satoshi:0.16.1/",
"protocolversion": 70016,
"localservices": "000000000000040d",
"localrelay": true,
"timeoffset": 0,
"networkactive": true,
"connections": 8,
"networks": [
{
"name": "ipv4",
"limited": false,
"reachable": true,
"proxy": "",
"proxy_randomize_credentials": false
},
{
"name": "ipv6",
"limited": false,
"reachable": true,
"proxy": "",
"proxy_randomize_credentials": false
},
{
"name": "onion",
"limited": true,
"reachable": false,
"proxy": "",
"proxy_randomize_credentials": false
}
],
"relayfee": 0.00400000,
"incrementalfee": 0.00010000,
"localaddresses": [
],
"warnings": ""
}
getnewaddress ( "account" "address_type" )
Get a new receiving address, with types "legacy", "p2sh-segwit" or "bech32". ZHCash Mainnet legacy addresses start with a "Q", and SegWit addresses will start with an "M" for p2sh-segwit and "qc1" for bech32. ZHCash Testnet legacy addresses start with a "q", and SegWit addresses will start with an "m" for p2sh-segwit and "tq1" for bech32. Here we get a new Mainnet SegWit bech32 address:
getnewaddress "" "bech32"
qc1q52g2c283225pfdm2wqdsk45aufm4urtcdp9d5
getpeerinfo
Gives information about the wallet peer connections. "timeoffset" values of mostly zero means the computer clock is set correctly for network time.
getpeerinfo
[
{
"id": 1,
"addr": "35.198.108.56:38100",
"addrlocal": "168.252.32.120:63648",
"addrbind": "172.21.42.106:63648",
"services": "000000000000040d",
"relaytxes": true,
"lastsend": 1539479080,
"lastrecv": 1539479084,
"bytessent": 28109,
"bytesrecv": 90334,
"conntime": 1539467479,
"timeoffset": 0,
"pingtime": 0.375712,
"minping": 0.286454,
"version": 70016,
"subver": "/Satoshi:0.16.1/",
"inbound": false,
"addnode": false,
"startingheight": 244769,
"banscore": 0,
"synced_headers": 244853,
"synced_blocks": 244853,
"inflight": [
],
"whitelisted": false,
"bytessent_per_msg": {
"addr": 165,
"feefilter": 32,
"getaddr": 24,
"getblocktxn": 58,
"getdata": 2681,
"getheaders": 989,
"headers": 6660,
"inv": 10986,
"ping": 3104,
"pong": 3104,
"sendcmpct": 132,
"sendheaders": 24,
"verack": 24,
"version": 126
},
"bytesrecv_per_msg": {
"addr": 30192,
"blocktxn": 540,
"cmpctblock": 1780,
"feefilter": 32,
"getheaders": 989,
"headers": 22474,
"inv": 9137,
"ping": 3104,
"pong": 3104,
"sendcmpct": 66,
"sendheaders": 24,
"tx": 18742,
"verack": 24,
"version": 126
}
},
{
"id": 14,
"addr": "35.225.188.93:38100",
"addrlocal": "168.252.32.120:58535",
"addrbind": "172.21.42.106:58535",
"services": "000000000000040d",
"relaytxes": true,
"lastsend": 1539479090,
"lastrecv": 1539479088,
"bytessent": 22785,
"bytesrecv": 147958,
"conntime": 1539467555,
"timeoffset": 0,
"pingtime": 0.27101,
"minping": 0.169899,
"version": 70016,
"subver": "/Satoshi:0.16.1/",
"inbound": false,
"addnode": false,
"startingheight": 244770,
"banscore": 0,
"synced_headers": 244853,
"synced_blocks": 244853,
"inflight": [
],
"whitelisted": false,
"bytessent_per_msg": {
"addr": 110,
"feefilter": 32,
"getaddr": 24,
"getblocktxn": 522,
"getdata": 2656,
"getheaders": 989,
"headers": 554,
"inv": 11186,
"ping": 3104,
"pong": 3104,
"sendcmpct": 330,
"sendheaders": 24,
"verack": 24,
"version": 126
},
"bytesrecv_per_msg": {
"addr": 30082,
"blocktxn": 4943,
"cmpctblock": 30125,
"feefilter": 32,
"getheaders": 989,
"headers": 6657,
"inv": 8641,
"ping": 3104,
"pong": 3104,
"sendcmpct": 66,
"sendheaders": 24,
"tx": 60041,
"verack": 24,
"version": 126
}
},
<snip>
getrawchangeaddress ( "address_type" )
Returns a new address for receiving change with raw transactions, used for composing raw transactions. The address type may be "legacy", "p2sh-segwit" or "bech32".
getrawchangeaddress "p2sh-segwit"
MBncZ4Z8a71UrgsS5QqJfxkDbun5wHy6d
getrawmempool ( verbose )
Get all the transactions waiting in the mempool.
getrawmempool
[
"d3139ba01a161eb35d40bbfe7cd78062c8ab1d6c57151a61f5d8f703996666f4",
"95bf14c60e6ec50a2a0c04e70bdc5be0f6b2bc984194b8afaf648181233d3c49",
"a66bc1d79da79b0939f03c96bb323a0b4a5a5d1f81fa13110e6cc741884e37f1",
<snip>
]
getrawtransaction "txid" ( verbose "blockhash" )
Get the data from a transaction, either as raw hex data or formatted (use "true"). Here formatted data is shown.
getrawtransaction cbd113e947d5c1b3fccae149d0d16c82e3bfe05c4f2c204c8bc65ae0697bbd64 true
{
"txid": "cbd113e947d5c1b3fccae149d0d16c82e3bfe05c4f2c204c8bc65ae0697bbd64",
"hash": "cbd113e947d5c1b3fccae149d0d16c82e3bfe05c4f2c204c8bc65ae0697bbd64",
"version": 1,
"size": 225,
"vsize": 225,
"locktime": 0,
"vin": [
{
"txid": "585c69575402000d74bb3ab75d2f6d3f63c78b4d9ef49f604f93d58a9c9a17fa",
"vout": 1,
"scriptSig": {
"asm": "304402201df556eb5aa6bd97756d6fc3262cf2c38ab8e00b57bd988e1ef172621e2d2e480220130e3aea45fad2f26d4eab57426273a4159b71139b7c9ea68ee9ed83776e15ae[ALL|ANYONECANPAY] 03845440d93fcaafc1a55d079217efcdd137de3ba0df39e747619d829a972cc150",
"hex": "47304402201df556eb5aa6bd97756d6fc3262cf2c38ab8e00b57bd988e1ef172621e2d2e480220130e3aea45fad2f26d4eab57426273a4159b71139b7c9ea68ee9ed83776e15ae812103845440d93fcaafc1a55d079217efcdd137de3ba0df39e747619d829a972cc150"
},
"sequence": 4294967295
}
],
"vout": [
{
"value": 300.68541000,
"n": 0,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 97e59bd55c357c0701c7e930c62df8f43332c805 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a91497e59bd55c357c0701c7e930c62df8f43332c80588ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"ZZJFN4wKcUkpP1cEQU1hqigr9bpN8845UA"
]
}
},
{
"value": 11769.78668720,
"n": 1,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 e8e41858c0726783e88cdd2d0119aa872e4954a1 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a914e8e41858c0726783e88cdd2d0119aa872e4954a188ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"ZZJFN4wKcUkpP1cEQU1hqigr9bpN8845UA"
]
}
}
],
"hex": "0100000001fa179a9c8ad5934f609ff49e4d8bc7633f6d2f5db73abb740d00025457695c58010000006a47304402201df556eb5aa6bd97756d6fc3262cf2c38ab8e00b57bd988e1ef172621e2d2e480220130e3aea45fad2f26d4eab57426273a4159b71139b7c9ea68ee9ed83776e15ae812103845440d93fcaafc1a55d079217efcdd137de3ba0df39e747619d829a972cc150ffffffff0248863900070000001976a91497e59bd55c357c0701c7e930c62df8f43332c80588acb03c6509120100001976a914e8e41858c0726783e88cdd2d0119aa872e4954a188ac00000000",
"blockhash": "f41bddaa8a0730cf3fca06deb6dec19bc4e7b925ba1c460833578894ca0cd6a4",
"confirmations": 17,
"time": 1542415856,
"blocktime": 1542415856
}
The transaction above has one "vin" UTXO input which provides the previous transaction to be spent and two outputs "vout". The first output "vout" sends 300.685401 to a receiving address, the second sends 11769.78668720 ZHCash to a change address. The difference in value between the inputs and outputs is the transaction fee.
getreceivedbyaccount "account" ( minconf )
DEPRECATED. Returns the total amount received for an account name, which could be spent or unspent transactions, for transactions with at least minconf confirmations (default is 1 confirmation).
getreceivedbyaccount "MyAccount1"
14.21655439
getreceivedbyaddress "address" ( minconf )
Returns the total amount received by an address, including transactions that are spent or unspent.
getreceivedbyaddress QfWtnPq9M4a7Fmeeh6dyu0s4KR59F9xn
10.05630000
getstakinginfo
Returns staking-related information.
- "enabled": true means the wallet was launched with staking allowed (command line option
-staking=false
was not used) - "staking": true means the wallet is staking (decrypted, mature coins, blockchain synced)
- "errors" gives various errors (rare)
- "currentblocktx" gives the number of transactions in a block mined by the wallet
- "pooledtx" gives the number of transactions waiting in the mempool
- "difficulty" gives the PoS target difficulty for the current block
- "search-interval" gives either the time in seconds since the wallet began staking or the time since the wallet's most recent block reward, here one day and one minute
- "weight" gives the wallet weight in Satoshis, move the decimal point eight digits to the left to give these weights in units, here wallet weight is 148 ZHCash and the network weight is 12.23 million
- "netstakeweight" gives the estimated network weight
- "expected time" gives an estimate of the average expected time to a block reward in seconds, here 4.59 months
getstakinginfo
{
"enabled": true,
"staking": true,
"errors": "",
"currentblocktx": 0,
"pooledtx": 2,
"difficulty": 4096615.946734428,
"search-interval": 86460,
"weight": 14807063425,
"netstakeweight": 1223152433452116,
"expectedtime": 11897280
}
getstorage "contract address hash"
Get the storage used by a smart contract, may take 5 to 10 minutes to return. Here is the result for the Bodhi token contract. getaccountinfo
also returns smart contract storage, plus address, balance, and code.
getstorage 6b8bf98ff497c064e8f0bde13e0c4f5ed5bf8ce7
{
"0002ab7e2ee0ab915c13f2c72d73d94cafa553da7cb3acb9e049d167be5f9bda": {
"be50707eafca4ec97c968fa62d21a25ed88c8075397799f8e0466113ead180f7": "0000000000000000000000000000000000000000000000000000000005f253a3"
},
"000b72f6738f4f0ff3119478d6b8d308815a49f43efc26129f501dcb9e84dff9": {
"7bbfe61f0ec6df73a6f4164c1c43ca18f5885326dbbe6ca3a0e71499dba1adad": "0000000000000000000000000000000000000000000000000000000030136f20"
},
<snip 33147 entries>
"fffe2b13ba414cd701a18201ba1ffada23cd6f0347f98b6c5b02c91c36d34745": {
"3186f17ad401d87c233df50753ceb0dcb557d6d0940e89f7d0f1148b997d2c1e": "0000000000000000000000000000000000000000000000000000000031880dc0"
}
}
getsubsidy [nTarget]
Returns subsidy (block reward) for the specified block height. Here we see the first block which will have a block reward of 2.0 ZHCash.
getsubsidy 990501
200000000
gettransaction "txid" ( include_watchonly ) (waitconf)
Get detailed information about a transaction for an address in this wallet (send or receive). Here is a send transaction:
gettransaction 723a08448afca334761f611e93623049f82b43d55cabaf02ef616f972fda51b
{
"amount": -0.05000000,
"fee": -0.00268000,
"confirmations": 63527,
"blockhash": "08dd5c42cde08d238fdcd23d7f14fceabdef3810337abcc0d8345249cfc24c",
"blockindex": 2,
"blocktime": 1533602584,
"txid": "73280a35b29eb47a3b821c501e96513498d77b84d22cb6aa04ab6255179e5fa35",
"walletconflicts": [
],
"time": 1533602524,
"timereceived": 1533602524,
"bip125-replaceable": "no",
"details": [
{
"account": "",
"address": "ZPov6tw7Ez5rmWL5DNv1yDFqM7UbWV1629",
"category": "send",
"amount": -0.05000000,
"label": "Test label 2",
"vout": 0,
"fee": -0.00268000,
"abandoned": false
},
{
"account": "First",
"address": "ZPov6tw7Ez5rmWL5DNv1yDFqM7UbWV1629",
"category": "send",
"amount": -0.00251255,
"label": "Default acct",
"vout": 1,
"fee": -0.00268000,
"abandoned": false
},
{
"account": "First",
"address": "ZPov6tw7Ez5rmWL5DNv1yDFqM7UbWV1629",
"category": "receive",
"amount": 0.00251255,
"label": " Default acct",
"vout": 1
}
],
"hex": "02000000<snip>df1a0300"
}
gettransactionreceipt "hash"
Returns details for a contract call transaction given the transaction ID (hash), requires -logevents
to be enabled for the wallet. Here is a contract call token transfer for Ocash:
gettransactionreceipt f4c2a055f51777c8d5c2db745f2b8ea300bb4f2f8c0cacfced00c3cea3b0492b
[
{
"blockHash": "944a8bdc256ce6c663729361955366854ce495c9c24d8e6a04451933ff7437d",
"blockNumber": 277019,
"transactionHash": "f5d2b05f61b36cef5d6db475e3b8ba70abf42208d0ddc8cfd38cbc213c0593c",
"transactionIndex": 3,
"from": "bc498a5ae6c677d52c8bc27e23bbc3d684b6a7c",
"to": "e327c58cd332bf5efc2ed7208d446c0afaad2e3",
"cumulativeGasUsed": 36253,
"gasUsed": 36253,
"contractAddress": "f397f39ce992b0f5bdc7ec1109d676d07f7af2f9",
"excepted": "None",
"log": [
{
"address": "f397f39ce992b0f5bdc7ec1109d676d07f7af2f9",
"topics": [
"ded243dd2b22c9c59c3a079fc472dbe953bf7515bc1ab7629f37acdf664b4eb",
"000000000000000000000000ad8bc5e38cb7c7923c8cb62e42bce4f294b6f7f",
"000000000000000000000000b069299a7eb54ac4810e03b8de39c8c31effb70"
],
"data": "00000000000000000000000000000000000000000000000000006a8f649befd"
}
]
}
]
gettxout "txid" n ( include_mempool )
Return details about an unspent transaction output. Has more detail than listunspent
. Will return "null" if the transaction has been spent.
gettxout 9ebd45e58980ef1278d1ba300b1504aaf57ae0239a3cf899bf3d37866dda175 1
{
"bestblock": "b20dc592f540bf19549a18187d6e22ba456ea84fc328aac46cea65d37bde4770b",
"confirmations": 13,
"value": 0.03235539,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 5bf232263fc9b17134baa773cdb9b3b64d5cea34 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76b0135ff586419299ba1fd413ac72cab9bba67d4bfd2f88ca",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
" ZPov6tw7Ez5rmWL5DNv1yDFqM7UbWV1629"
]
},
"coinbase": false,
"coinstake": false
}
gettxoutproof ["txid",...] ( blockhash )
Returns a hex-encoded proof that a transaction ID was included in a block, if there are unspent outputs in that transaction. See verifytxoutproof
for the reciprocal.
gettxoutproof [\"b52cb4ac7ae175bbddf25274acc3944e38cd7ba96277a5c60e223d0f93c442b\"]
000000201cb576b9<snip 307 bytes>e36ab6c678b8311b
gettxoutsetinfo
Returns statistics about the whole blockchain unspent UTXOs, may take some time to return. "total_amount" gives the current total supply (genesis blocks + total block rewards)
gettxoutsetinfo
{
"height": 264144,
"bestblock": "00fa97450ff3af39f33377e7042eaedf94a4755b2f56a95138aaefe5198de67d",
"transactions": 1155194,
"txouts": 2205063,
"bogosize": 201311789,
"hash_serialized_2": "d5273addced7f3226ca9039f1b749035fe8d65db1e2d5bd9e8a9c02697215251",
"disk_size": 168408370,
"total_amount": 101036576.00000000
}
getunconfirmedbalance
Get the unconfirmed balance for the wallet, which is the amount in transactions received by the wallet that haven't yet been published in blocks. Here the wallet has received 7.0 ZHCash that haven't been confirmed in a block:
getunconfirmedbalance
7.00000000
getwalletinfo
Returns information about the wallet:
- "walletname" - the name of the wallet.dat file currently loaded
- "walletversion" - not the software client version, use
getnetworkinfo
to check this - "balance" - balance in ZHCash
- "stake" - any balance currently committed to a stake
- "unconfirmed_balance" - any balance that hasn't been published in the next blocks
- "immature_balance" - any coinbase (Proof of Work) balance that does not have 500 confirmations, seen only for regtest.
- "txcount" - the total number of transactions in the wallet
- "keypoololdest" - the Unix epoch timestamp in seconds for the oldest key in the key pool
- "keypoolsize" - how many new keys are pre-generated
- "keypoolsize_hd_internal" - how many new keys are pre-generated for internal use (used for change addresses)
- "unlocked_until" - the Unix epoch time in seconds that the wallet is unlocked, or 0 if the wallet is locked, this field is omitted for unencrypted wallets.
- "paytxfee" - the transaction fee in ZHCash per 1,000 bytes
- "hdmasterkeyid" - a Hash 160 of the hierarchical deterministic (HD) master public key, this field is omitted if HD is not enabled
getwalletinfo
{
"walletname": "wallet.dat",
"walletversion": 130000,
"balance": 1.53160855,
"stake": 0.00000000,
"unconfirmed_balance": 0.00000000,
"immature_balance": 0.00000000,
"txcount": 94,
"keypoololdest": 1507072726,
"keypoolsize": 952,
"unlocked_until": 0,
"paytxfee": 0.00000000,
"hdmasterkeyid": "c1c081490c4dc42b3e3431683052df36bc583fbe5"
}
help ( "command" )
Gives help and examples for a specific command or lists all the commands (without a parameter). The examples are formatted so you can copy and paste them for giving the command (replacing the parameters as appropriate).
help
== Blockchain ==
callcontract "address" "data" ( address )
getaccountinfo "address"
getbestblockhash
getblock "blockhash" ( verbosity )
getblockchaininfo
getblockcount
<snip>
importaddress "address" ( "label" rescan p2sh )
Adds a 34-character ZHCash address or 66 hex character public key address that can be watched as if it were in your wallet but cannot be used to spend. The wallet will rescan after entering this command and should be backed up after adding addresses. ZeroHour-QT returns "null" and displays the "Watch-only" balance, ZeroHourD returns nothing.
importaddress ZSZKuemGNi2Z8AD33fcvy973dGMGSpauiL
null
importmulti "requests" ( "options" )
Import multiple addresses/scripts (with private or public keys, redeem script (P2SH)), rescanning the blockchain for all the new addresses in a single pass. Optional time stamps can control how far back the scanning begins for each address. Requires a new wallet backup after addition of the addresses.
Here we import two watch only addresses and scan the blockchain from 00:00:00 hours GMT on June 1, 2018 (timestamp 1527811200). After entering the command, the wallet will take several minutes to rescan the blockchain for the new addresses:
importmulti '[{ "scriptPubKey": { "address": "ZPov6tw7Ez5rmWL5DNv1yDFqM7UbWV1629" }, "timestamp":1527811200 }, { "scriptPubKey": { "address": "ZPov6tw7Ez5rmWL5DNv1yDFqM7UbWV1629" }, "timestamp": 1527811200 }]'
importmulti(Ö)
[
{
"success": true
},
{
"success": true
}
]
importprivkey "ZHCashprivkey" ( "label" ) ( rescan )
Adds a WIF private key to your wallet, for example as returned by dumpprivkey or from another ZHCash wallet. The wallet must be unlocked and requires a new wallet backup afterwards. The wallet will rescan for a few minutes to add any balance from the new address, and return "null" if successful.
importprivkey
KwxLh9CwxJydu22LUgGCFKFY6o7a7qa432uTqEoto4oW18NeqiBB
null
importprunedfunds
Imports funds without rescan. Corresponding address or script must previously be included in wallet. Aimed towards pruned wallets. The end-user is responsible to import additional transactions that subsequently spend the imported outputs or rescan after the point in the blockchain the transaction is included.
Example TO COME.