Hydra Core Wallet Commands

The Hydra 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 Hydra 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 hydrad server wallet or given to the Hydra-qt desktop GUI (Graphical User Interface) wallet using the Debug window Console command line (see Figure 1).
2019-1 Mac Debug Window with Prompt
Figure 1. The hydra-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 hydrad, console commands are given using the Command Line Interface application hydra-cli on the system command line prompt (see Figure 2).
You can always get a list of the current console commands using the help command (see Figure 3.)
2019-3 Help Command Mac
Figure 3. The help command

Console Commands :hammer_and_wrench:

Console commands are given to a running Hydra Core wallet and provide additional information and control. Console commands and are required to operate the hydrad 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 Hydra 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 http://chainquery.com/bitcoin-api 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 Hydra (estimatepriority, getgenerate) and two (gettransaction, walletpassphrase) have an additional parameter for Hydra. See also https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs.
Advanced interfaces to the Hydra 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 Hydra-qt wallet with Help - Command line options:
2019-4 Startup Commands Win
Figure 4. Startup commands
and on the command line itself with "Hydra -?":
2019-5 Startup Commands Command Line Win
Figure 5. Startup commands from the command line

Console Commands A - Z

For these console commands documented below, responses are given for default parameters (Hydraversion 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 \" will give complete information about the command and relevant parameters, formatted in a way you can copy and paste (replacing the addresses, transactions IDs, etc., as required). The format below shows the command with parameters followed by the response, in some cases, parameters or responses are truncated with the term "\". Where noted, some commands only work with the regtest (Regression Test) network. Many commands will return "null" for Hydra-qt and return nothing for command line systems.

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".
hydra-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 Hydra 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 "[\"HgdaD9b3ppKowoC45EZMtepjjBfnvEe6m\",\"HFmr8vY29reHj73XSHfdWvkV3mD57Kqd8\"]"
{
"address": "mHB9w64hHbm2YtCxyqS8kG3g77b2gbSvK",
"redeemScript": "5321538ef45ab52bd53508adfda3cfe82ebcaf0495963729e5ff2a8e5aeecdd4cdd23daea03cf4394ad4c578caff2d297ce937c3afba5bc56f31c786b2addf56c72ab"
}

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. Hydrad returns nothing:
addnode 35.200.159.68:3888 add
addnode 35.197.138.163:3888 add
addnode 35.226.31.206:3888 add
addnode 35.200.130.53:3888 add
addnode 35.192.54.161:3888 add
Hydra-qt returns "null" after each (see Figure 6).
2019-6 addnode Mac
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 Hydrad with -deprecatedrpc=addwitnessaddress to run the command:
addwitnessaddress HkSc3wcAJ59Nk4X9mvd258ycVxJ7XWhp9
MHa57hGwD48SZQjh23MZbq24tFwTu7Q3c

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. Hydra-qt will returns "null", Hydrad returns nothing. On Windows:
backupwallet "C:\Users\\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:
  1. 1.
    "address" (string, required) The account address
  2. 2.
    "data" (string, required) The data hex string
  3. 3.
    address (string, optional) The sender address hex string
  4. 4.
    gasLimit (string, optional) The gas limit for executing the contract
TO COME

clearbanned

Clear all banned nodes IPs. Hydra-qt returns "null", hydrad 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 "[\"0200000001b000000\", \"0200000001c000000\"]"
0200000001b000000

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 6060604041701d0029
{
"txid": "a1d823cb5ce776200dcbe729d901d4e1d31ad5bb8d835db0f704g73ac8e74d3",
"sender": "HfdR8vwd69oMi2xeeSe8XBgv3mku27ukh",
"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 VERY HIGH transaction fee!
createrawtransaction "[{\"txid\":\"17b3f9ef530695ef2e0368e445a3b59bf12811bdfd42325bb14248e72deb7e2\",\"vout\":0}]" "{\"Qd5eHho389mJMCxSzAbe31w2vntTc7192\":1.0, \"QdXtq55Bf443Lkme2hdj4mD8KKepk32f6\":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 0200000f33ad0000000
{
"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,
}
]
}

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": [
"Hgw5Ds4Py6J2oBX3EKP3kyde2UpnWn7eV",
"HK3bx79fzkei5XF7h2q7wB4s6MK99u29x"
],
"p2sh": "mKa7c52cX97eK4vdk35jV442p3j59hk3R"
}

disconnectnode "[address]" [nodeid]

Disconnects a peer (node) using either the IP address or node number. Hydra-qt will return "null", Hydra will return nothing.
disconnectnode "35.198.0.76:3888"
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 "HXfSbN8DaT21Z6L3Pw52UexuP8zW4mY6h"
L3vaEHms4VpciP85UsufQf3Gfa9p5gatBGm6Z4rD8FxzFLdXE5V

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\\Desktop\Backups\dump 2018-10-30.txt"
{
"filename": "C:\\Users\\\\Desktop\\Backups\\dump 2018-10-30.txt"
}
File:
Wallet dump created by Hydra v0.16.1.0-0806c12c4-dirty
* Created on 2018-10-31T01:56:32Z
* Best block at time of backup was 241161 (b11d5169d66d39cbcd848e2ea3f9adfcee1c22af945f100aec9e762d88609e2e),
mined on 2018-10-31T01:55:28Z
extended private masterkey:
On Mac:
dumpwallet /Users//Desktop/dump_2018-12-15.txt
{
"filename": "/Users//Desktop/dump_2018-12-15.txt"
}
File:
Wallet dump created by Hydra 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:

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 Hydra-cli and the GUI. There is no server-side difference. Here we echo the parameters used to setup a multisig address.
echo "[\"hghwDvb1pyJoqoAD2ESMTevvvjUfNvReDn\",\"hfKr7vXdmroHi61XUUHedXvgV2mDx9Kudb\"]"
[
"[\"hghwDvb1pyJoqoAD2ESMTevvvjUfNvReDn\",\"hfKr7vXdmroHi61XUUHedXvgV2mDx9Kudb\"]"
]

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 Hydra-cli and the GUI. There is no server-side difference. Here we echo the parameters used to setup a multisig address.
echojson
"[\"hghwDvb1pyJoqoAD2ESMTevvvjUfNvReDn\",\"qfKr7vXdmroHi61XUUHedXvgV2mDx9Kudb\"]"
[
[
"hghwDvb1pyJoqoAD2ESMTevvvjUfNvReDn",
"hfKr7vXdmroHi61XUUHedXvgV2mDx9Kudb"
]
]

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
HXvN7L3D2NkdPgt20rYrGkSPCggwkKbqa
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": "020000000150c3fb7a7636798bd00000000",
"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",
"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 Hydra each, plus an initial block, and listaddressgroupings shows the result:
PS C:\Users\Test> docker exec myapp qcli generatetoaddress 10 "qNe5aDdubCGRaTp7vDYL4BASjzVH7c7Yc"
[
"7994c09b3c5a4f31976144a429695140ee4e0747de36a5eae4aefb169a8f558",
"79cd57805f061d964428dff08b03a91a3a7245bc6d6ea01f3bb735bac62decf",
"38cfab367ece8f34d4f48838ca9c43fc87873919dbe5113302e316890304adc",
"41d8f6276e7544d0992e95c216d42be391a3cdf72cd8ba128f7c8b879d7a1b8",
"3d270dfae9927870f342c6056adfdb3c6b121b6d38fc1a60e965deb33207035",
"5fb82e9978f83afc7c30bbdb6d195f5a26e8beace00a57e7581b1b4376f1351",
"65bce2a9f180246245944e235fa0c86fba2502e279b846f7e14e3265d620031",
"7d676d46c2c4008051cb4660a74ff0899ac647d8c1afedeabbe6a7fe935b7be",
"35482c05e5b5b173cd5ae3e1665d9b33811a4358249d566fded891b9d772ac5",
"06d5849f0b3c91ad215e364d183b39c4e156ea4024cb5337cadc47fb2a54cca"
]
PS C:\Users\Test> docker exec myapp qcli listaddressgroupings
[
[
[
"hNe5aDdubCGRaTp7vDYL4BASjzVH7c7Yc",
2200000.00000000
]
]
]

getaccount "address"

DEPRECATED. Returns the account name for a given address.
getaccount "H5ytvGW47jcS38NGz9cV6WtK2d3JqhQv5"
My trading Acct 101

getaccountaddress "account"

DEPRECATED. Returns the current Hydra address for an account. Use the null account "" for the default address.
getaccountaddress "My trading Acct 101"
H5ytvGW47jcS38NGz9cV6WtK2d3JqhQv5

getaccountinfo "contract address hash"

Returns information about a contract including storage (the QRC20 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"
},
"fffd29bb4ec023344772b5c3cda826cba78eed7cc88791357ee4ae9fdee2f0aa": {
"3f2cc887dcd9aaf8b642c415b8201a833f08695db6e6dbc3f41b6376a8467452":
"000000000000000000000000000000000000000000000000000000006e44c280"
}
},
"code": "606060405236 c62c0029"
}

getaddednodeinfo ( "node" )

Returns information about nodes that have been manually added using the addnode command.
getaddednodeinfo
[
{
"addednode": "35.200.159.68:3888",
"connected": true,
"addresses": [
{
"address": "35.200.159.68:3888",
"connected": "outbound"
}
]
},
{
"addednode": "35.231.140.221:3888",
"connected": true,
"addresses": [
{
"address": "35.231.140.221:3888",
"connected": "outbound"
}
]
}
]

getaddressesbyaccount "account"

DEPRECATED. Returns the list of addresses for the given account.
getaddressesbyaccount "MyAccount1"
[
"HDmZ3dx13suFL53hjRyLSmfpYc87CQ6m",
"H4FtdG46MkSW7N6gzJcv3Wt8Sd32qaPce"
]

getbalance ( "account" minconf include_watchonly )

Get the balance in Hydra 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 Hydra 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": ""
}
2019-7 getblockchaininfo
Figure 7. The getblockchaininfo command

getblockcount

Returns the number of blocks in the main (longest with most difficulty) blockchain.
getblockcount
244848

getblockhash height

Returns the hash of the main blockchain for the given block height (not an orphan block).
getblockhash 244848
8c0a43d58e96bd081209243eb9406c98ab3771c900cc05d793a62c48f3b1c03f
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"
},

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 HXvN7L3D2NkdPgt20rYrGkSPCggwkKbqa
9467c4cbd6c4bb736cf4724de25a298bc529bfa3
See fromhexaddress to convert a hex address to base58 pubkeyhash.

getinfo

Hidden command. DEPERCATED. Command line interfaces (but not the hydra-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.
hydra-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 Hydra 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". Hydra Mainnet legacy addresses start with an "H", and SegWit addresses will start with an "M" for p2sh-segwit and "qc1" for bech32. Hydra Testnet legacy addresses start with a "h", and SegWit addresses will start with an "m" for p2sh-segwit and "th1" for bech32. Here we get a new Mainnet SegWit bech32 address:
getnewaddress "" "bech32"
hc1q52g2c283225pfdm2wqdsk45aufm4urtcdp9d5

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:3888",
"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:3888",
"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": {