ZHCash Core Wallet Commands (Part-2)


importpubkey "pubkey" ( "label" rescan )

Adds a public key that can be watched as if it were in your wallet but cannot be used to spend. The public key is 66 characters hex, and can be obtained using the validateaddress command. After entering this command, the wallet will rescan for a few minutes, ZeroHour-QT returns "null" and ZeroHourD returns nothing. The wallet should be backed up after importing a public key.

importpubkey 0381dc63bc14d32743a7741dc6a2993b8384dc3aa848332194bc851ff2a371b827

null

importwallet "filename"

Imports keys from a wallet dump file (see dumpwallet). Requires a new wallet backup after this command. Use the full path to the dump file. ZeroHour-QT will show a status of "Importing" for a while, then "Scanning" as it rescans the blockchain. This command may take five minutes or more to return, and the wallet may appear to freeze during this time.

On a PC with the dump file in a folder "Backups" on the Desktop:

importwallet "C:\Users\<username>\Desktop\Backups\dump 2019-01-14.txt"

null

invalidateblock "blockhash"

Hidden command. Permanently marks a block as invalid, as if it violated a consensus rule. Used for software testing or in some rare manual blockchain forking scenarios. Use reconsiderblock to reverse this command. Returns "null" if successful.

invalidateblock 263f7ab042135cb0e5479afd8385a237f8eb44b86135d29b34eb0fa82cc815f

null

keypoolrefill ( newsize )

Refills the key pool with new private keys, with a default size of 100. The normal size of the keypool is 1,000 and the wallet opportunistically fills the keypool as addresses are used, so this command should use a 1,100 size, etc., to be meaningful. The wallet must be unlocked. ZeroHour-QT returns "null", ZeroHourD returns nothing.

keypoolrefill 1100

null

listaccounts ( minconf include_watchonly)

DEPRECATED. Returns information about account names and account balances. Gives the balance in Satoshis (ZHCash x 0.00000001), including the default undefined account.

This "account" was an attempt to manually track balances from bitcoin which will be removed by version 0.17, because it doesn't work well, for example, returning negative values:

listaccounts
{
  "": -20077.14454684,
  "First": 9512.20615539,
  "Second": 0.00000000,
  "Third": 10564.97000000
}

listaddressgroupings

Lists the receiving addresses for the wallet, and their balance. Some addresses may show a zero balance.

listaddressgroupings
[
  [
    [
      "ZSZKuemGNi2Z8AD33fcvy973dGMGSpauiL",
      0.00000000
    ],
    [
      "ZVrbuqQESmdYq4oBYq4wooD8yTwAKU1Q5M",
      0.00000000
    ],
    [
      "ZVrbuqQESmdYq4oBYq4wooD8yTwAKU1Q5M",
      0.03160855,
      "MyAccount 1"
    ],
    <snip>
  ]
]

Listbanned

List all peer IP addresses that have been banned.

listbanned

[
  {
    "address": "79.137.70.15/32",
    "banned_until": 1554322856,
    "ban_created": 1522786856,
    "ban_reason": "manually added"
  }
]

listcontracts (start maxDisplay)

Lists the address hash of the smart contracts for the wallet, and the balance of the associated tokens.

listcontracts

{
  "0162b1247a37af180eefba02b85df40d6d5d8e45": 0.00000000,
  "2c6734f611b46cc37eaafcc1e0d6b9953b7ae2cd": 0.08470000,
  "eb1939b4196ff26af3f7a379329ecf1caf0a47ab": 0.00000000,
  "26f6c6092c85f99649e08c4bc3ee8fab6b4aa905": 0.00000000,
  "988b1b1b42bb4f80935a6adf7efe2ba9aa6888bb": 0.00000001,
  "a181bf8cf9b1418a8ecba244aea70b4f4fbbea1e": 0.00000000,
  "68a203b2252dd6ebd3d90ff643fa47deae007e9e": 0.00000000
}

listlockunspent

Returns a list of temporarily locked (unspendable) outputs. See also the lockunspent and unlockcommands. If the wallet is restarted all the locks are cleared.

listlockunspent

[
  {
    "txid": "9fc384b55230ca1899dd1acf081033ebf57ae0335abf692c4f8a6336befc2f6",
    "vout": 1
  }
]

listreceivedbyaccount ( minconf include_empty include_watchonly)

DEPRECATED. List the balance for the accounts.

listreceivedbyaccount

[
  {
    "account": "",
    "amount": 185.29137380,
    "confirmations": 23926
  },
  {
    "account": "Account 1",
    "amount": 8.82579750,
    "confirmations": 23927
  }
]

listreceivedbyaddress ( minconf include_empty include_watchonly)

List balances by receiving address.

listreceivedbyaddress

[
  {
    "address": "ZCpqF7Qo3G4XwxkkYNV9H7HMv6T6d4e7yr",
    "account": "First,
    "amount": 12.29616322,
    "confirmations": 12946,
    "label": "First",
    "txids": [
      "6478fc4d0ef0081e902f5f90A2483c82195ff18b7c38dcb9f2a388hdba94ae08",
      "5346419fac6dc35cag8aVc3172caeef59bD4cb50c8V773dc2c5e362F6bA20505",
      "6d8481be243fard24e69de6e49Z8442259b65fa9wed404be2fDb7w7free60565",
      "72w0016116v5b4fb5527110C73519fk868u22977f670M04b46641w11bpe331B8",
      "d303S6b3dAdc32479e5928eatdw6e45d5p64Q4686d23a4j7b4bB4ed1b9f81LeP"
    ]
  },
  {
    "address": "ZYZxP5xCuSPyo6cjoxN5eo8JGUMkCjXkwm",
    "account": "",
    "amount": 0.60927503,
    "confirmations": 55329,
    "label": "",
    "txids": [
      "a93f5fa60bd753914fb72bf5bce8042cb66272c09495afcb7638397bd40abff94"
    ]
  },
  <snip>
]

listsinceblock ( "blockhash" target_confirmations include_watchonly include_removed )

List all the transactions for your wallet since the given blockhash, or a list all the transactions since block 1 if blockhash is not given. The transactions below show a send and a receive transaction.

listsinceblock 9957c2abcb56dead1cc7390acd50f52703fcd010aa5fd4a7c3ed7facb38cd287

{
  "transactions": [
    {
      "account": "",
      "address": "ZJNYFD6kRa47Bp97rSCcVw82QGybM7PwJm",
      "category": "send",
      "amount": -5.23000000,
      "label": "",
      "vout": 1,
      "fee": -0.00090400,
      "confirmations": 4,
      "blockhash": "4a1582348a59781cabfdd23551057a75faee481035c5dae395a5b522acff8db",
      "blockindex": 2,
      "blocktime": 1547693528,
      "txid": "c3da0be5b78ev626e6b8fb63ff366sa872d545a8c132267829c185f432acd938",
      "walletconflicts": [
      ],
      "time": 1547693438,
      "timereceived": 1547693438,
      "bip125-replaceable": "no",
      "abandoned": false
    },
    {
      "account": "",
      "address": "ZXs7wMJ9BXVectNPHgv9a4TiZNcpkuLwpp",
      "category": "receive",
      "amount": 4.50000000,
      "label": "",
      "vout": 0,
      "confirmations": 2,
      "blockhash": "8a5f521afb1437831aeffc4e5418521e9b37b029889a1ccdea249e23df6c35a",
      "blockindex": 2,
      "blocktime": 1547693720,
      "txid": "3a2df47bc22fea2e3aae416fe932cbe28c833e97b44f6dc03d903268a8bb2c2",
      "walletconflicts": [
      ],
      "time": 1547693638,
      "timereceived": 1547693638,
      "bip125-replaceable": "no"
    }
  ],
  "removed": [
  ],
  "lastblock": "835ca632a5bba30a0c836dfa497a43e5316acdf8b8437e42bcfa7e3554a61af"
}

listtransactions ( "account" count skip include_watchonly)

Returns up to 'count' most recent transactions for your wallet (default = 10), with various options. Using "account" is DEPRECATED.

listtransactions

[
  {
    "account": "",
    "address": "ZHv3riQzUxfXSuRLk5VAZfMwhZkGYuQicK",
    "category": "receive",
    "amount": 8.50000000,
    "label": "",
    "vout": 1,
    "confirmations": 3532,
    "blockhash": "0bc940fbfc7f66af8c4e11f9d3325a5ec42c69a2ecbd1d870338baeccf3e95d",
    "blockindex": 2,
    "blocktime": 1575639472,
    "txid": "95cf7a43c6ea87348fe1f8b365fcbed5579ea4422b16cbad0377ef6ee2f99af",
    "walletconflicts": [
    ],
    "time": 1575639440,
    "timereceived": 1575639472,
    "bip125-replaceable": "no"
  },
  {
    "account": "",
    "address": "ZVmaoTbZaurRUeS6kUxHCVKMUW1Lx9yxHr",
    "category": "send",
    "amount": -1.58540000,
    "label": "",
    "vout": 0,
    "fee": -0.02003200,
    "confirmations": 1680,
    "blockhash": "6c6cbeaa5b480a39ad92d484bd3bcae4aa334b923b614f4b897ed736ad9e21f",
    "blockindex": 2,
    "blocktime": 1542934848,
    "txid": "55dc28cbff0ff7a94e5cb51a928703911baac60892bc6dea575bbdb9b3302673",
    "walletconflicts": [
    ],
    "time": 1542934828,
    "timereceived": 1542934828,
    "bip125-replaceable": "no",
    "abandoned": false
  },
<snip 8 more transactions>
]

listunspent ( minconf maxconf ["addresses",...] [include_unsafe] [query_options])

Returns array of unspent transaction outputs, which can be sorted by number of confirmations or for a specific address.

listunspent

[
  {
    "txid": "d36ba8beb38c7118b3bc6e8c90d54b58d7d53ef603c49039df2abb5d160ea",
    "vout": 1,
    "address": "ZVmaoTbZaurRUeS6kUxHCVKMUW1Lx9yxHr",
    "account": "",
    "scriptPubKey": "76a914bd3b1563bedea856a7ca5df8aac54a0ab56f2985ad",
    "amount": 1.10000000,
    "confirmations": 2632,
    "spendable": true,
    "solvable": true,
    "safe": true
  },
  {
    "txid": "2c55ecdb59be333ad04df5a97ca2f536ed16351de344db94a326f65f7560c54",
    "vout": 10,
    "address": "ZVmaoTbZaurRUeS6kUxHCVKMUW1Lx9yxHr",
    "account": "",
    "scriptPubKey": "76a914986c8cbd67dbb55dcaf261be37a528c6868fee0723s",
    "amount": 2.40000000,
    "confirmations": 15843,
    "spendable": true,
    "solvable": true,
    "safe": true
  },
  <snip>
]

listwallets

Gives the currently loaded wallet.dat file, usually "wallet.dat" unless you can load a different file with "Restore Wallet".

listwallets

[
  "wallet1132019.dat"
]

lockunspent unlock ([{"txid":"txid","vout":n},...])

Updates list of temporarily unspendable outputs. Temporarily lock (unlock=false as shown below) or unlock (unlock=true) the specified transaction outputs. If no transactions are specified when unlocking then all current locked transactions are unlocked.

A locked transaction output will not be chosen by automatic coin selection when spending ZHCash.

Locks are stored in memory only. Wallets launch with zero locked outputs and the locked output list is always cleared (by virtue of process exit) when a wallet stops or fails. Also see the listunspent call.

lockunspent false "[{\"txid\":\"9fc384b55230ca1899dd1acf081033ebf57ae0335abf692c4f8a6336befc2f6\",\"vout\":1}]"

true

logging ( )

Gets and sets the logging configuration for the debug.log file. When called without an argument, returns the list of categories with status that are currently being debug logged or not. When called with arguments, adds or removes categories from debug logging. The arguments are evaluated in order "include" then "exclude". If an item is both included and excluded, it will thus end up being excluded.

The valid logging categories are: net, tor, mempool, http, bench, zmq, db, rpc, estimatefee, addrman, selectcoins, reindex, cmpctblock, rand, prune, proxy, mempoolrej, libevent, coindb, qt, leveldb, coinstake, and http-poll.

Here we turn on logging for "mempool" and "mempoolrej" (they are listed first for "include") and turn off "http". Returns the current debug logging status.

logging "[\"mempool\", \"mempoolrej\"]" "[\"http\"]"

{
  "net": 0,
  "tor": 0,
  "mempool": 1,
  "http": 0,
  "bench": 0,
  "zmq": 0,
  "db": 0,
  "rpc": 0,
  "estimatefee": 0,
  "addrman": 0,
  "selectcoins": 0,
  "reindex": 0,
  "cmpctblock": 0,
  "rand": 0,
  "prune": 0,
  "proxy": 0,
  "mempoolrej": 1,
  "libevent": 0,
  "coindb": 0,
  "qt": 0,
  "leveldb": 0,
  "coinstake": 0,
  "http-poll": 0
}

move "fromaccount" "toaccount" amount ( minconf "comment" )

DEPRECATED. Move a specified amount from one account in your wallet to another. Returns "true" if the command can be parsed, whether or not the accounts exist or the movement took place.

move "Test Addr" "LTCp2shsegwit" 1.1

true

ping

Requests that a ping be sent to other peers, to measure ping time. Results are provided in getpeerinfo, "pingtime" and "pingwait" fields are decimal seconds (does not provide a direct result like using "ping" from a system command prompt). The ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.

ping

null

preciousblock "blockhash"

Prioritizes a block with an earlier time for blocks at the same height. Used in hard fork situations. See also invalidateblock. ZeroHour-QT returns "null" if successful, ZeroHourD returns nothing if successful.

preciousblock 854d57da75ba7550aebe83c1cdf539ac685d735684b7c40cfd639582abf43b

null

prioritisetransaction

Accepts the transaction into mined blocks at a higher (or lower) priority. A higher fee is not actually paid, the algorithm for selecting transactions into a block (which is trying to maximize fees) considers the transaction as having paid a higher fee. ZeroHour-QT and ZeroHourD return "true":

prioritisetransaction "01b347eb32bca5cde81444f6a6d4311f02ae3f3da25394e0f144fca525218dd" 0.0 10000

true

pruneblockchain

Prune the blockchain up to a given block. Pruning removes spent transactions to reduce the storage size for the blockchain. Returns the last block pruned. The wallet must be launched in prune mode with disk working space reserved, at least 550 MB, here with 2 GB of working space:

ZeroHour-QT.exe -prune=2000

Then you can give the command

pruneblockchain 125000

125000

Don't prune the blockchain if your wallet accepts incoming connections (over 8 peers) because your wallet needs to be able to send all the blocks to bootstrap new peers coming online.

reconsiderblock "blockhash"

Hidden command. Removes invalidity status of a block and its descendants, used for code testing or in manual blockchain reorganization. This command can reverse the effects of invalidateblock. Returns "null" if successful:

reconsiderblock 263f7ab042135cb0e5479afd8385a237f8eb44b86135d29b34eb0fa82cc815f

null

removeprunedfunds "txid"

Deletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. This will affect wallet balances. ZeroHour-cli returns "null".

removeprunedfunds "535e2bf90fda10c8c8186c4c73ac2861cb19312507b9e4552e78a6148030f19f"

null

rescanblockchain ("start_height") ("stop_height")

Rescan the local blockchain for wallet transactions. An optional start height and stop height can be used, or by default scan the entire blockchain. This command will scan the blockchain for transactions of your wallet, and can be used if the wallet balance doesn't appear to be correct after a wallet restore or adding private keys. Returns the start and top height scanned.

rescanblockchain 100000 200000

{
  "start_height": 100000,
  "stop_height": 200000
}

resendwallettransactions

Hidden command. Immediately re-broadcast unconfirmed wallet transactions to all peers. The wallet periodically re-broadcasts automatically, so this can be used for testing. Here two transactions were resent after being stuck in the local mempool after restarting the wallet.

resendwallettransactions

[
  "8b4c25d4959cd43f6ee2ce5ab397ca32860dd6c4f2c0d83e9631aa137803124ed",
  "f5c615ca95bc324bebca4823a4ff972dc0a3950d6d7d398f238df935c5bb713c4"
]

reservebalance [ [amount]]

Sets the amount of coins that will not be used for staking and can be sent immediately vs. waiting 500 confirmations after staking is turned off. Returns the reserve status and amount.

reservebalance true 50

{
  "reserve": true,
  "amount": 50.00000000
}

savemempool

Writes the memory pool to disk in the mempool.dat file. ZeroHour-QT returns "null", ZeroHourD has no response.

savemempool

null

searchlogs (address) (topics)

Return the smart contract log events between two blocks (inclusive). The command requires -logevents to be enabled on wallet startup. Use the contract address hash if desired.

searchlogs 274690 274700

[
  {
    "blockHash": "d3168805de880ff19108c119f3701604b71fc6f5c3586b9d6f5b137d70e76ca7",
    "blockNumber": 274690,
    "transactionHash": "5d957c6b03557b514f03b0f68ef0e9bb140c99b5e9a00186f36eb4b3213463c1",
    "transactionIndex": 2,
    "from": "1854f76267a1e142dccc6c5697066f6a09a7c069",
    "to": "2e1b8528c07539b5dd9a76f3374adf09f1ab6075",
    "cumulativeGasUsed": 37968,
    "gasUsed": 37968,
    "contractAddress": "2e1b8528c07539b5dd9a76f3374adf09f1ab6075",
    "excepted": "None",
    "log": [
      {
        "address": "2e1b8528c07539b5dd9a76f3374adf09f1ab6075",
        "topics": [
          "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
          "0000000000000000000000001854f76267a1e142dccc6c5697066f6a09a7c069",
          "000000000000000000000000e57e4a5f9ac130defb33a057729f10728fcdb9cb"
        ],
        "data": "0000000000000000000000000000000000000000000316d984535eb922280000"
      }
    ]
  },
  {
    "blockHash": "b35295f75e57b1a9dd0c4797c8f090a8d4bc7d6fc936208616d00c9c079e82aa",
    "blockNumber": 274696,
    "transactionHash": "de6e0bf79c04386ba05f8c83bea025451492bd0140b3cf1ba4e010c2339adf9b",
    "transactionIndex": 8,
    "from": "f30a2e96271180258aaac50956f0af94c4610beb",
    "to": "f2033ede578e17fa6231047265010445bca8cf1c",
    "cumulativeGasUsed": 36423,
    "gasUsed": 36423,
    "contractAddress": "f2033ede578e17fa6231047265010445bca8cf1c",
    "excepted": "None",
    "log": [
      {
        "address": "f2033ede578e17fa6231047265010445bca8cf1c",
        "topics": [
          "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
          "000000000000000000000000f30a2e96271180258aaac50956f0af94c4610beb",
          "000000000000000000000000e57e4a5f9ac130defb33a057729f10728fcdb9cb"
        ],
        "data": "00000000000000000000000000000000000000000000000000000059c78d0fff"
      }
    ]
  }
]

sendfrom "fromaccount" "toaddress" amount ( minconf "comment" "comment_to" )

DEPRECATED (use sendtoaddress). Send an amount to a ZHCash address, requires the wallet to be unlocked. The "account" is for notation, it does not control the source of UTXOs. If successful, returns the transaction ID.

sendfrom "" ZVmaoTbZaurRUeS6kUxHCVKMUW1Lx9yxHr 1.0

3e5ae45efbde38318a3a8af1d5c4d3bb844c58fab745f21d42a449ad923af3f

sendmany "fromaccount" {"address":amount,...} ( minconf "comment" ["address",...] replaceable conf_target "estimate_mode")

Send to multiple addresses, requires the wallet to unlocked. Amounts are floating point in ZHCash. Don't put blank spaces betweeen the parameters. If successful, returns a single transaction ID containing all the outputs. Here we send to two different addresses:

sendmany "" "{\"ZVmaoTbZaurRUeS6kUxHCVKMUW1Lx9yxHr\":0.5,\"QM5yJs3v3u9vAVE5XseFa9g63ke6Ld9Wp\":0.77}"

7a5077ac6e42acbed182c35eb034702e1fadd5c7d1547a85ae63dc0e151ed5

sendmanywithdupes "fromaccount" {"address":amount,...} ( minconf "comment" ["address",...] )

Send to multiple addresses, requires the wallet to be unlocked. Amounts are floating point in ZHCash. Can send to duplicate addresses which sendmany can't do. If successful, returns a single transaction ID containing all the outputs. Here we send two transactions to the same address:

sendmanywithdupes "" "{\"ZVmaoTbZaurRUeS6kUxHCVKMUW1Lx9yxHr\":200.0,\"ZVmaoTbZaurRUeS6kUxHCVKMUW1Lx9yxHr\":250.0}"

7d90b8365ba85de8c4bd19e1a94ebe9c8a5b9938385e5b10496a0ad5359824f

sendrawtransaction "hexstring" ( allowhighfees )

Transmits a raw hex-encoded transaction to the network. Also see createrawtransaction and signrawtransaction. Returns the transaction hash in hex, which is the transaction ID.

sendrawtransaction 020000003d6b5df207d94bafb4520adca3871fdaf397afd20f60f0a39c6fc353ae18000000006b5734040229999abc42d6d1e095b07b4538cb8a1b4ea2c42852feffcfb36dc8494b5238f24402100514aab22c8be9458056bb14f755adae12adf15721eb0b6cd314230237c26707210dd486ffc6e7ea92f2b30e428c1f3726e3dfc09418bb815f64bd32d7d5836f89fffffff0301e1d505420000002976b414d4fcc597395462ec3fdab4d6b49bc9af53fed3d87add09fe60400000001986a824dcead1313bfdde586b8bc3cd2ace54d4fa4b6f6887ad0000000

8f2cb4f0363ac5b4d3b5492722c5ab9eb91ab635b5d62354b3f1b42f73dc84

sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount replaceable conf_target "estimate_mode" "sender address" changeToSender )

Sends to an address, with options for various comments and specifying the address to send the coins from. The wallet must be unlocked. If successful, returns the transaction ID.

sendtoaddress ZVmaoTbZaurRUeS6kUxHCVKMUW1Lx9yxHr 0.1

04efe64bfd72f82c7ce94702fe1a2c946934efb46ed8e0772bad36ea45ce3c8d

sendtocontract "contractaddress" "data" (amount gaslimit gasprice senderaddress broadcast)

Send funds and data to a contract.

Arguments:

  1. "contractaddress" (string, required) The contract address that will receive the funds and data
  2. "datahex" (string, required) data to send
  3. "amount" (numeric or string, optional) The amount in ZHCash to send, default: 0
  4. gasLimit (numeric or string, optional) gasLimit, default: 250000, max: 40000000
  5. gasPrice (numeric or string, optional) gasPrice ZHCash price per gas unit, default: 0.0000004, min:0.0000004
  6. "senderaddress" (string, optional) The ZHCash address that will be used as sender
  7. "broadcast" (bool, optional, default=true) Whether to broadcast the transaction or not
  8. "changeToSender" (bool, optional, default=true) Return the change to the sender

Returns transaction information:

sendtocontract "0bf3bca874ddf209dae6863743d749d83bfded4" "53e62baf"

{
  "txid": "cb3c85a8282afb599edcd421d053b824383ca593aeb328ad7628f20a2c38abe",
  "sender": "QdB38N29nc3zb3pb238PWzs3Sbp88ew4m",
  "hash160": "dc7a88381e7d027d0becf368557acbf624a7b82"
}

setaccount "address" "account"

DEPRECATED. Assigns and account name to the given address. ZeroHour-QT will return "null" if successful.

setaccount "ZVmaoTbZaurRUeS6kUxHCVKMUW1Lx9yxHr" "My New Account"

null

setban "subnet" "add|remove" (bantime) (absolute)

Attempts to add or remove an IP address from the banned list. Use "add" to add a ban, and give the duration of the ban in seconds. Returns "null" if successful. Here we add a ban for one day and confirm the result with listbanned:

setban "116.61.213.45" "add" 86400

null


listbanned

[
  {
    "address": "116.61.213.45/32",
    "banned_until": 1547586400,
    "ban_created": 1547500000,
    "ban_reason": "manually added"
  }
]

setmocktime timestamp

Hidden command. Set the local time to given timestamp, only works for regtest. Give an epoch time in seconds, or 0 to go back to system time. The command line interface has no return.

docker exec myapp qcli setmocktime 1547319783

setnetworkactive true|false

Use to enable/disable peer network connections. Returns the network connection status. To disable the network connections:

setnetworkactive false

false

settxfee amount

Set the transaction fee per kilobyte of the transaction message. Overwrites the paytxfee parameter seen in getwalletinfo. The default minimum fee per 1,000 bytes is 0.004 ZHCash. Returns true if successful.

settxfee 0.01

true

getwalletinfo would show "paytxfee": 0.01000000,

signmessage "address" "message"

Sign a message using the private key of an address, the wallet must be unlocked. Returns a base 64 signature hash.

signmessage "ZVmaoTbZaurRUeS6kUxHCVKMUW1Lx9yxHr" "message"

IJTWLjS9oma8M+EsXVnESR12jONwjMky4YimE0cQnvtAcQyim3lJPQ58Q6IADifR3I10LyMctNAe+2Kc274AqLu=

Use verifymessage to verify a message.

signmessagewithprivkey "privkey" "message"

Sign a message with the private key of an address, the wallet must be unlocked. Returns a base 64 signature hash.

signmessagewithprivkey "cSxP62VDq527SWRddkX5D49mNekwNz9nexaikk55RG5X2AXEFvq" "hello world"

signmessagewithprivkey(Ö)

H3SBMeQUvo82A63wegSNT582Puziba54sCGt6notPb3xHm3WwM2OuIwV4E9Ya38TMCqe2aV7rmuFrc9A2Qb+t3A=

Use verifymessage to verify a message.

signrawtransaction "hexstring" ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] ["privatekey1",...] sighashtype )

Signs a raw transaction in preparation for sending to the network. The wallet must be unlocked. See createrawtransaction and sendrawtransaction.

signrawtransaction 020000001d637cf207c6418fb6220cfcb2b141ba5d230f0ba0a43c68b358aff9a8a6000000000fffffff0509e5f50480000001983a952d5fb15a70832ffdc3cadd3dc7749a49bf053ed6defacd09ef6060000000187aa814bd4ae4167bebbf56bb7c51c5eabf35d50a5c6e7f33ad0000000

{
  "hex": "020000003d6b5df207d94bafb4520adca3871fdaf397afd20f60f0a39c6fc353ae18000000006b5734040229999abc42d6d1e095b07b4538cb8a1b4ea2c42852feffcfb36dc8494b5238f24402100514aab22c8be9458056bb14f755adae12adf15721eb0b6cd314230237c26707210dd486ffc6e7ea92f2b30e428c1f3726e3dfc09418bb815f64bd32d7d5836f89fffffff0301e1d505420000002976b414d4fcc597395462ec3fdab4d6b49bc9af53fed3d87add09fe60400000001986a824dcead1313bfdde586b8bc3cd2ace54d4fa4b6f6887ad0000000",
  "complete": true
}

stop

Shuts down and exits the wallet. No return value - the wallet exits.

stop

submitblock "hexdata" ( "dummy" )

Attempts to submit new block to network. See https://en.bitcoin.it/wiki/BIP_0022 for full specification. Use getblocktemplate to construct a block along with the block header and transactions.

Arguments

  1. "hexdata" (string, required) the hex-encoded block data to submit
  2. "dummy" (optional) dummy value, for compatibility with BIP22. This value is ignored.

Example TO COME.

syncwithvalidationinterfacequeue

Hidden command. Waits for all the asynchronous validation queues (for the blockchain, mempool, etc.) to complete. For use by developers. ZeroHour-QT returns "null", ZeroHourD returns nothing.

syncwithvalidationinterfacequeue

null

uptime

Gives the wallet uptime (since starting) in seconds.

uptime

12592

validateaddress "address"

Return detailed information about an address, here the multisig address from addmultisigaddress:

validateaddress mKa7c52cX97eK4vdk35jV442p3j59hk3R

{
  "isvalid": true,
  "address": "mKa7c52cX97eK4vdk35jV442p3j59hk3R",
  "scriptPubKey": "a813bcd644a82f494ae0ef442a5253c0ebde7b20b2f29",
  "ismine": true,
  "iswatchonly": false,
  "isscript": true,
  "iswitness": false,
  "script": "multisig",
  "hex": "52460396bc49812bad50949fbc0bbd44e95bf32a5695519b3ff267a5d93cba3bd169b2393cd4864da4c2786dd3322fcfcb239c3db185ef33fa14836b8fecf36c68bb84ddac92f2",
  "sigsrequired": 2,
  "pubkeys": [
    "03a64c40c2d385306afcc08fd56b35bfe38626df29b3ef6a935bbf8523afb1fa5",
    "03bf3874f4c496cb472ccb2c9b3fce6f2a6bc09ff1b826cba33f2ac83ab2495fe"
  ],
  "addresses": [
    " Qgw5Ds4Py6J2oBX3EKP3kyde2UpnWn7eV",
    " QK3bx79fzkei5XF7h2q7wB4s6MK99u29x"
  ],
  "account": ""
}

verifychain ( checklevel nblocks )

Verifies the blockchain database for a default 6 blocks, returns true or false.

verifychain

true

verifymessage "address" "signature" "message"

Verify a signed message. Returns true or false.

verifymessage "Qg3WDvb1Ey2oqAW2EpM5evdv3Ufnvre3n" "IJTWLjS9oma8M+EsXVnESR12jONwjMky4YimE0cQnvtAcQyim3lJPQ58Q6IADifR3I10LyMctNAe+2Kc274AqLu=" "hello world"

true

See signmessage for creating a message signature.

verifytxoutproof "proof"

Verifies that a proof points to a transaction in a block, returning the transaction if found or giving an empty tring or error not found in the best chain. The "proof" is the hex string from gettxoutproof.

verifytxoutproof 00000020a8/<snip/>d38abf491d

[
  "cb0ef481c7be99a23686abfca6c671acc21b9aa35bc34bcc29b22effbacc610b"
]

waitforblock (timeout)

Hidden command. Used to monitor when blockchain reloading has reached a given block. For command line interfaces like ZeroHourD (not for the ZeroHour-QT GUI wallet), the command returns after the given block is loaded. This example waits for Mainnet block 150,000:

ZeroHour-cli waitforblock ae4699ac0a8f4d1170767167fd3b0639312850ce33dcb55a0afd0f5c1a88406f

{
  "hash": "ae4699ac0a8f4d1170767167fd3b0639312850ce33dcb55a0afd0f5c1a88406f",
  "height": 150000
}

waitforblockheight (timeout)

Hidden command. Waits for (at least) block height and returns the height and blockhash of the current tip (highest block). Returns the current block on timeout or exit. Timeout is given in milliseconds, 0 or default is no timeout. This command only works from the command line (not with the ZeroHour-QT GUI wallet) and is used for development.

On Docker regtest:

docker exec myapp qcli waitforblockheight 7210

{
  "hash": "b5bd2dfa428effb185a31513315bbae6284ab59b9942759e07d9110770ae9c61",
  "height": 7210
}

On Mainnet with ZeroHourD:

ZeroHour-cli waitforblockheight 281985

{
  "hash": "44f6a6909b255f9932e28322174c6eec201790d84e7d4f9c201c92594914d240",
  "height": 281985
}

waitforlogs (fromBlock) (toBlock) (filter) (minconf)

requires -logevents to be enabled

Waits for a new logs and returns matching log entries. When the call returns, it also specifies the next block number to start waiting for new logs. By calling waitforlogs repeatedly using the returned nextBlock number, a client can receive a stream of up-to-date log entries.

This call is different from the similarly named searchlogs. This call returns individual matching log entries, searchlogs returns a transaction receipt if one of the log entries of that transaction matches the filter conditions.

Arguments:

  1. fromBlock (int | "latest", optional, default=null) The block number to start looking for logs. ()
  2. toBlock (int | "latest", optional, default=null) The block number to stop looking for logs. If null, will wait indefinitely into the future.
  3. filter ({ addresses?: Hex160String[], topics?: Hex256String[] }, optional default={}) Filter conditions for logs. Addresses and topics are specified as array of hexadecimal strings
  4. minconf (uint, optional, default=6) Minimal number of confirmations before a log is returned

Example TO COME.

waitfornewblock (timeout)

Hidden command. Waits for a new block and returns the blockhash and height. Returns the current block on timeout or exit. This command works on command line only (not with the ZeroHour-QT GUI wallet) and is used for development. The timeout parameter is given in milliseconds and 0 indicates no timeout.

On Docker with regtest:

waitfornewblock

{
  "hash": "47f1ddc856ba47a242cbdc771d198296f3a1343f81aad21d454bec438972868c",
  "height": 7207
}

On Mainnet with ZeroHourD:

ZeroHour-cli waitfornewblock

{
  "hash": "b4caac261c4f5386076bbb07e0dc94b92fb67ca740b8a5d7b49cddcaffd6f103",
  "height": 281981
}

walletlock

Locks an encrypted wallet.

walletlock

null

ZeroHour-cli returns no response, but you can check with getwalletinfo for "unlocked_until": 0 and check the padlock icon on ZeroHour-QT.

walletpassphrase "passphrase" timeout ( true )

Unlock an encrypted wallet for transactions which require use of a private key, such as sending coins, staking, or exporting private keys. Timeout gives the time in seconds to unlock and the optional Boolean "true" allows unlocking for staking only.

This command would unlock the wallet for 10 minutes:

walletpassphrase "you should always use a long and strong passphrase" 600

This command would unlock the wallet for staking only for a long time:

walletpassphrase "you should always use a long and strong passphrase" 99999999 true

The ZeroHour-QT wallet will show lock status with the padlock icon and the Console returns "null". ZeroHour-cli returns no status but you can check the unlock status with getwalletinfo for "unlocked_until":

walletpassphrasechange "oldpassphrase" "newpassphrase"

Changes the wallet passphrase from "oldpassphrase" to "newpassphrase", ZeroHour-QT returns "null", ZeroHourD returns nothing.

walletpassphrasechange "you should always use a long and strong passphrase" "please use a strong and long passphrase"

null

```


Did you find this article useful?



  • Main ZHChain Docs

    Documentation Please take some time to read the following, this is for your own safety! This website provides documentation on different aspects...

  • ZHCash QT Wallet Tutorial

    My WalletThis is the ZHCash wallet “My Wallet” page, it shows the following: Balances Available Pending Total Other Tokens If ...

  • ZHCash Wallet Best Practices

    In this document we'll take a look at how to safely use our ZHCash wallet. Please keep in mind these VERY IMPORTANT topics: Encrypt your wallet BEF...

  • How to update your ZHCash wallet

    Updating your ZHCash wallet is quite easy, however, this process changes depending on which operating system you're running, in this document we'll go...

  • ZHCash Core Wallet Commands (Part-1)

    Commands The ZHCash Core wallet has a rich set of commands which give comprehensive control of the wallet and blockchain transactions. There are two ...