This document includes the full list of Hydra RPCs based on Hydra core v0.17.6. According to this document you can learn how to use Hydra RPC API.
Blockchain
callcontract
callcontract "address" "data" ( address )
Argument:
1. "address" (string, required) The account address
2. "data" (string, required) The data hex string
3. address (string, optional) The sender address hex string
4. gasLimit (string, optional) The gas limit for executing the contract
According the blockhash returns the info of the corresponding block If verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'. If verbosity is 1, returns an Object with information about block. If verbosity is 2, returns an Object with information about block and information about each transaction.
Arguments:
1. "blockhash" (string, required) The block hash
2. verbosity (numeric, optional, default=1) 0 for hex encoded data, 1 for a json object, and 2 for json object with transaction data
Result (for verbosity = 0):
"data" (string) A string that is serialized, hex-encoded data for block 'hash'.
Result (for verbosity = 1):
{
"hash" : "hash", (string) the block hash (same as provided)
"confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain
"size" : n, (numeric) The block size
"strippedsize" : n, (numeric) The block size excluding witness data
"weight" : n (numeric) The block weight as defined in BIP 141
"height" : n, (numeric) The block height or index
"version" : n, (numeric) The block version
"versionHex" : "00000000", (string) The block version formatted in hexadecimal
"merkleroot" : "xxxx", (string) The merkle root
"tx" : [ (array of string) The transaction ids
"transactionid" (string) The transaction id
,...
],
"time" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)
"mediantime" : ttt, (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)
"nonce" : n, (numeric) The nonce
"bits" : "1d00ffff", (string) The bits
"difficulty" : x.xxx, (numeric) The difficulty
"chainwork" : "xxxx", (string) Expected number of hashes required to produce the chain up to this block (in hex)
"nTx" : n, (numeric) The number of transactions in the block.
"previousblockhash" : "hash", (string) The hash of the previous block
"nextblockhash" : "hash" (string) The hash of the next block
}
Result (for verbosity = 2):
{
..., Same output as verbosity = 1.
"tx" : [ (array of Objects) The transactions in the format of the getrawtransaction RPC. Different from verbosity = 1 "tx" result.
,...
],
,... Same output as verbosity = 1.
}
Returns an object containing various state info regarding blockchain processing.
Result:
{
"chain": "xxxx", (string) current network name as defined in BIP70 (main, test, regtest)
"blocks": xxxxxx, (numeric) the current number of blocks processed in the server
"headers": xxxxxx, (numeric) the current number of headers we have validated
"bestblockhash": "...", (string) the hash of the currently best block
"difficulty": xxxxxx, (numeric) the current difficulty
"mediantime": xxxxxx, (numeric) median time for the current best block
"verificationprogress": xxxx, (numeric) estimate of verification progress [0..1]
"initialblockdownload": xxxx, (bool) (debug information) estimate of whether this node is in Initial Block Download mode.
"chainwork": "xxxx" (string) total amount of work in active chain, in hexadecimal
"size_on_disk": xxxxxx, (numeric) the estimated size of the block and undo files on disk
"pruned": xx, (boolean) if the blocks are subject to pruning
"pruneheight": xxxxxx, (numeric) lowest-height complete block stored (only present if pruning is enabled)
"automatic_pruning": xx, (boolean) whether automatic pruning is enabled (only present if pruning is enabled)
"prune_target_size": xxxxxx, (numeric) the target size used by pruning (only present if automatic pruning is enabled)
"softforks": [ (array) status of softforks in progress
{
"id": "xxxx", (string) name of softfork
"version": xx, (numeric) block version
"reject": { (object) progress toward rejecting pre-softfork blocks
"status": xx, (boolean) true if threshold reached
},
}, ...
],
"bip9_softforks": { (object) status of BIP9 softforks in progress
"xxxx" : { (string) name of the softfork
"status": "xxxx", (string) one of "defined", "started", "locked_in", "active", "failed"
"bit": xx, (numeric) the bit (0-28) in the block version field used to signal this softfork (only for "started" status)
"startTime": xx, (numeric) the minimum median time past of a block at which the bit gains its meaning
"timeout": xx, (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in
"since": xx, (numeric) height of the first block to which the status applies
"statistics": { (object) numeric statistics about BIP9 signalling for a softfork (only for "started" status)
"period": xx, (numeric) the length in blocks of the BIP9 signalling period
"threshold": xx, (numeric) the number of blocks with the version bit set required to activate the feature
"elapsed": xx, (numeric) the number of blocks elapsed since the beginning of the current period
"count": xx, (numeric) the number of blocks with the version bit set in the current period
"possible": xx (boolean) returns false if there are not enough blocks left in this period to pass activation threshold
}
}
}
"warnings" : "...", (string) any network and blockchain warnings.
}
Returns the corresponding block header information according to the given index If verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'. If verbose is true, returns an Object with information about blockheader.
Arguments:
1. "hash" (string, required) The block hash
2. verbose (boolean, optional, default=true) true for a json object, false for the hex encoded data
Result (for verbose = true):
{
"hash" : "hash", (string) the block hash (same as provided)
"confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain
"height" : n, (numeric) The block height or index
"version" : n, (numeric) The block version
"versionHex" : "00000000", (string) The block version formatted in hexadecimal
"merkleroot" : "xxxx", (string) The merkle root
"time" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)
"mediantime" : ttt, (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)
"nonce" : n, (numeric) The nonce
"bits" : "1d00ffff", (string) The bits
"difficulty" : x.xxx, (numeric) The difficulty
"chainwork" : "0000...1f3" (string) Expected number of hashes required to produce the current chain (in hex)
"nTx" : n, (numeric) The number of transactions in the block.
"previousblockhash" : "hash", (string) The hash of the previous block
"nextblockhash" : "hash", (string) The hash of the next block
}
Result (for verbose = false):
"data" (string) A string that is serialized, hex-encoded data for block 'hash'.
Compute per block statistics for a given window. All amounts are in satoshis. It won't work for some heights with pruning. It won't work without -txindex for utxo_size_inc, fee or feerate stats.
Arguments:
1. "hash_or_height" (string or numeric, required) The block hash or height of the target block
2. "stats" (array, optional) Values to plot, by default all values (see result below)
[
"height", (string, optional) Selected statistic
"time", (string, optional) Selected statistic
,...
]
Result:
{
"avgfee": xxxxx, (numeric) Average fee in the block
"avgfeerate": xxxxx, (numeric) Average feerate (in satoshis per virtual byte)
"avgtxsize": xxxxx, (numeric) Average transaction size
"blockhash": xxxxx, (string) The block hash (to check for potential reorgs)
"feerate_percentiles": [ (array of numeric) Feerates at the 10th, 25th, 50th, 75th, and 90th percentile weight unit (in satoshis per virtual byte)
"10th_percentile_feerate", (numeric) The 10th percentile feerate
"25th_percentile_feerate", (numeric) The 25th percentile feerate
"50th_percentile_feerate", (numeric) The 50th percentile feerate
"75th_percentile_feerate", (numeric) The 75th percentile feerate
"90th_percentile_feerate", (numeric) The 90th percentile feerate
],
"height": xxxxx, (numeric) The height of the block
"ins": xxxxx, (numeric) The number of inputs (excluding coinbase)
"maxfee": xxxxx, (numeric) Maximum fee in the block
"maxfeerate": xxxxx, (numeric) Maximum feerate (in satoshis per virtual byte)
"maxtxsize": xxxxx, (numeric) Maximum transaction size
"medianfee": xxxxx, (numeric) Truncated median fee in the block
"mediantime": xxxxx, (numeric) The block median time past
"mediantxsize": xxxxx, (numeric) Truncated median transaction size
"minfee": xxxxx, (numeric) Minimum fee in the block
"minfeerate": xxxxx, (numeric) Minimum feerate (in satoshis per virtual byte)
"mintxsize": xxxxx, (numeric) Minimum transaction size
"outs": xxxxx, (numeric) The number of outputs
"subsidy": xxxxx, (numeric) The block subsidy
"swtotal_size": xxxxx, (numeric) Total size of all segwit transactions
"swtotal_weight": xxxxx, (numeric) Total weight of all segwit transactions divided by segwit scale factor (4)
"swtxs": xxxxx, (numeric) The number of segwit transactions
"time": xxxxx, (numeric) The block time
"total_out": xxxxx, (numeric) Total amount in all outputs (excluding coinbase and thus reward [ie subsidy + totalfee])
"total_size": xxxxx, (numeric) Total size of all non-coinbase transactions
"total_weight": xxxxx, (numeric) Total weight of all non-coinbase transactions divided by segwit scale factor (4)
"totalfee": xxxxx, (numeric) The fee total
"txs": xxxxx, (numeric) The number of transactions (excluding coinbase)
"utxo_increase": xxxxx, (numeric) The increase/decrease in the number of unspent outputs
"utxo_size_inc": xxxxx, (numeric) The increase/decrease in size for the utxo index (not discounting op_return and similar)
}
Return information about all known tips in the block tree, including the main chain as well as orphaned branches.
Result:
[
{
"height": xxxx, (numeric) height of the chain tip
"hash": "xxxx", (string) block hash of the tip
"branchlen": 0 (numeric) zero for main chain
"status": "active" (string) "active" for the main chain
},
{
"height": xxxx,
"hash": "xxxx",
"branchlen": 1 (numeric) length of branch connecting the tip to the main chain
"status": "xxxx" (string) status of the chain (active, valid-fork, valid-headers, headers-only, invalid)
}
]
Possible values for status:
"invalid" This branch contains at least one invalid block
"headers-only" Not all blocks for this branch are available, but the headers are valid
"valid-headers" All blocks are available for this branch, but they were never fully validated
"valid-fork" This branch is not part of the active chain, but is fully validated
"active" This is the tip of the active main chain, which is certainly valid
Compute statistics about the total number and rate of transactions in the chain.
Arguments:
1. nblocks (numeric, optional) Size of the window in number of blocks (default: one month).
2. "blockhash" (string, optional) The hash of the block that ends the window.
Result:
{
"time": xxxxx, (numeric) The timestamp for the final block in the window in UNIX format.
"txcount": xxxxx, (numeric) The total number of transactions in the chain up to that point.
"window_final_block_hash": "...", (string) The hash of the final block in the window.
"window_block_count": xxxxx, (numeric) Size of the window in number of blocks.
"window_tx_count": xxxxx, (numeric) The number of transactions in the window. Only returned if "window_block_count" is > 0.
"window_interval": xxxxx, (numeric) The elapsed time in the window in seconds. Only returned if "window_block_count" is > 0.
"txrate": x.xx, (numeric) The average rate of transactions per second in the window. Only returned if "window_interval" is > 0.
}
If txid is in the mempool, returns all in-mempool ancestors.
Arguments:
1. "txid" (string, required) The transaction id (must be in mempool)
2. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids
Result (for verbose = false):
[
"transactionid" (string) The transaction id of an in-mempool ancestor transaction
,...
]
Result (for verbose=true):
{
"transactionid" : {
"size" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.
"fee" : n, (numeric) transaction fee in HYDRA (DEPRECATED)
"modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED)
"time" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT
"height" : n, (numeric) block height when transaction entered pool
"descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one)
"descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one)
"descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)
"ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one)
"ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)
"ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)
"wtxid" : hash, (string) hash of serialized transaction, including witness data
"fees" : {
"base" : n, (numeric) transaction fee in HYDRA
"modified" : n, (numeric) transaction fee with fee deltas used for mining priority in hydra
"ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in hydra
"descendant" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in hydra
}
"depends" : [ (array) unconfirmed transactions used as inputs for this transaction
"transactionid", (string) parent transaction id
... ]
"spentby" : [ (array) unconfirmed transactions spending outputs from this transaction
"transactionid", (string) child transaction id
... ]
}, ...
}
If txid is in the mempool, returns all in-mempool descendants.
Arguments:
1. "txid" (string, required) The transaction id (must be in mempool)
2. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids
Result (for verbose = false):
[
"transactionid" (string) The transaction id of an in-mempool descendant transaction
,...
]
Result (for verbose=true):
{
"transactionid" : {
"size" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.
"fee" : n, (numeric) transaction fee in HYDRA (DEPRECATED)
"modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED)
"time" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT
"height" : n, (numeric) block height when transaction entered pool
"descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one)
"descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one)
"descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)
"ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one)
"ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)
"ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)
"wtxid" : hash, (string) hash of serialized transaction, including witness data
"fees" : {
"base" : n, (numeric) transaction fee in HYDRA
"modified" : n, (numeric) transaction fee with fee deltas used for mining priority in hydra
"ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in hydra
"descendant" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in hydra
}
"depends" : [ (array) unconfirmed transactions used as inputs for this transaction
"transactionid", (string) parent transaction id
... ]
"spentby" : [ (array) unconfirmed transactions spending outputs from this transaction
"transactionid", (string) child transaction id
... ]
}, ...
}
1. "txid" (string, required) The transaction id (must be in mempool)
Result:
{
"size" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.
"fee" : n, (numeric) transaction fee in HYDRA (DEPRECATED)
"modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED)
"time" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT
"height" : n, (numeric) block height when transaction entered pool
"descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one)
"descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one)
"descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)
"ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one)
"ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)
"ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)
"wtxid" : hash, (string) hash of serialized transaction, including witness data
"fees" : {
"base" : n, (numeric) transaction fee in HYDRA
"modified" : n, (numeric) transaction fee with fee deltas used for mining priority in hydra
"ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in hydra
"descendant" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in hydra
}
"depends" : [ (array) unconfirmed transactions used as inputs for this transaction
"transactionid", (string) parent transaction id
... ]
"spentby" : [ (array) unconfirmed transactions spending outputs from this transaction
"transactionid", (string) child transaction id
... ]
}
Returns details on the active state of the TX memory pool.
Result:
{
"size": xxxxx, (numeric) Current tx count
"bytes": xxxxx, (numeric) Sum of all virtual transaction sizes as defined in BIP 141. Differs from actual serialized size because witness data is discounted
"usage": xxxxx, (numeric) Total memory usage for the mempool
"maxmempool": xxxxx, (numeric) Maximum memory usage for the mempool
"mempoolminfee": xxxxx (numeric) Minimum fee rate in HYDRA/kB for tx to be accepted. Is the maximum of minrelaytxfee and minimum mempool fee
"minrelaytxfee": xxxxx (numeric) Current minimum relay fee for transactions
}
Returns all transaction ids in memory pool as a json array of string transaction ids.
Hint: use getmempoolentry to fetch a specific transaction from the mempool.
Arguments:
1. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids
Result: (for verbose = false):
{
"transactionid" : {
"size" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.
"fee" : n, (numeric) transaction fee in HYDRA (DEPRECATED)
"modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED)
"time" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT
"height" : n, (numeric) block height when transaction entered pool
"descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one)
"descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one)
"descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)
"ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one)
"ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)
"ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)
"wtxid" : hash, (string) hash of serialized transaction, including witness data
"fees" : {
"base" : n, (numeric) transaction fee in HYDRA
"modified" : n, (numeric) transaction fee with fee deltas used for mining priority in hydra
"ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in hydra
"descendant" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in hydra
}
"depends" : [ (array) unconfirmed transactions used as inputs for this transaction
"transactionid", (string) parent transaction id
... ]
"spentby" : [ (array) unconfirmed transactions spending outputs from this transaction
"transactionid", (string) child transaction id
... ]
}, ...
}
1. "address" (string, required) The address to get the storage from
2. "blockNum" (string, optional) Number of block to get state from, "latest" keyword supported. Latest if not passed.
3. "index" (number, optional) Zero-based index position of the storage
1. "hash" (string, required) The contract transaction hash
Result:
{
"blockHash": "XXX" (String), 32 bytes, the blockhash included this tx.
"blockNumber": n (Number), the blocknumber included this transaction.
"transaction": "XXX": (String), 32 bytes,the hash of this transaction.
"transactionIndex": n (numberic), the index in the block for this tx.
"from": "XXX" (String), 20 bytes,the sender address of this tx.
"to" : "XXXX" (String), 20 bytes,the receiver address of this tx. if this address is created by a contract,return null.
"cumulativeGasUsed": n (numberic), The total amount of gas used after execution of the current transaction
"gasUsed": n (numberic), The gas cost alone to execute the current transaction。
"contractAddress": "XXX" (String), 20 bytes,the created contract address.
if this tx is created by the contract, return the contract address. else return null.
"logs": []
}
Returns details about an unspent transaction output.
Arguments:
1. "txid" (string, required) The transaction id
2. "n" (numeric, required) vout number
3. "include_mempool" (boolean, optional) Whether to include the mempool. Default: true. Note that an unspent output that is spent in the mempool won't appear.
Result:
{
"bestblock": "hash", (string) The hash of the block at the tip of the chain
"confirmations" : n, (numeric) The number of confirmations
"value" : x.xxx, (numeric) The transaction value in HYDRA
"scriptPubKey" :
{
"asm" : "code", (string)
"hex" : "hex", (string)
"reqSigs" : n, (numeric) Number of required signatures
"type" : "pubkeyhash",(string) The type, eg pubkeyhash
"addresses" : [ (array of string) array of hydra addresses
"address" (string) hydra address
,...
]
},
"coinbase" : true|false (boolean) Coinbase or not
}
Returns a hex-encoded proof that "txid" was included in a block.
NOTE: By default this function only works sometimes. This is when there is an unspent output in the utxo for this transaction. To make it always work, you need to maintain a transaction index, using the -txindex command line option or specify the block in which the transaction is included manually (by blockhash).
Arguments:
1. "txids" (string,required) A json array of txids to filter
[
"txid" (string) A transaction hash
,...
]
2. "blockhash" (string, optional) If specified, looks for txid in the block with this hash
Result:
"data" (string) A string that is a serialized, hex-encoded data for the proof.
Returns statistics about the unspent transaction output set. Note this call may take some time.
Result:
{
"height":n, (numeric) The current block height (index)
"bestblock": "hex", (string) The hash of the block at the tip of the chain
"transactions": n, (numeric) The number of transactions with unspent outputs
"txouts": n, (numeric) The number of unspent transaction outputs
"bogosize": n, (numeric) A meaningless metric for UTXO set size
"hash_serialized_2": "hash", (string) The serialized hash
"disk_size": n, (numeric) The estimated size of the chainstate on disk
"total_amount": x.xxx (numeric) The total amount
}
1. start (numeric or string, optional) The starting account index, default 1
2. maxDisplay (numeric or string, optional) Max accounts to list, default 20
prune the spend tx to reduce the size of the block
Arguments:
1. "height" (numeric, required) The block height to prune up to. May be set to a discrete height, or a unix timestamp to prune blocks whose block time is at least 2 hours older than the provided timestamp.
EXPERIMENTAL warning: this call may be removed or changed in future releases.
Scans the unspent transaction output set for entries that match certain output descriptors. Examples of output descriptors are: addr() Outputs whose scriptPubKey corresponds to the specified address (does not include P2PK) raw() Outputs whose scriptPubKey equals the specified hex scripts combo() P2PK, P2PKH, P2WPKH, and P2SH-P2WPKH outputs for the given pubkey pkh() P2PKH outputs for the given pubkey sh(multi(,,,...)) P2SH-multisig outputs for the given threshold and pubkeys
In the above, either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one or more path elements separated by "/", and optionally ending in "/" (unhardened), or "/'" or "/*h" (hardened) to specify all unhardened or hardened child keys. In the latter case, a range needs to be specified by below if different from 1000. For more information on output descriptors, see the documentation in the doc/descriptors.md file.
Arguments:
1. "action" (string, required) The action to execute
"start" for starting a scan
"abort" for aborting the current scan (returns true when abort was successful)
"status" for progress report (in %) of the current scan
2. "scanobjects" (array, required) Array of scan objects
[ Every scan object is either a string descriptor or an object:
"descriptor", (string, optional) An output descriptor
{ (object, optional) An object with output descriptor and metadata
"desc": "descriptor", (string, required) An output descriptor
"range": n, (numeric, optional) Up to what child index HD chains should be explored (default: 1000)
},
...
]
Result:
{
"unspents": [
{
"txid" : "transactionid", (string) The transaction id
"vout": n, (numeric) the vout value
"scriptPubKey" : "script", (string) the script key
"amount" : x.xxx, (numeric) The total amount in hydra of the unspent output
"height" : n, (numeric) Height of the unspent transaction output
}
,...],
"total_amount" : x.xxx, (numeric) The total amount of all found unspent outputs in hydra
]
searchlogs
requires -logevents to be enabled
Arguments:
1. "fromBlock" (numeric, required) The number of the earliest block (latest may be given to mean the most recent block).
2. "toBlock" (string, required) The number of the latest block (-1 may be given to mean the most recent block).
3. "address" (string, optional) An address or a list of addresses to only get logs from particular account(s).
4. "topics" (string, optional) An array of values from which at least one must appear in the log entries. The order is important, if you want to leave topics out use null, e.g. ["null", "0x00..."].
5. "minconf" (uint, optional, default=0) Minimal number of confirmations before a log is returned
1. checklevel (numeric, optional, 0-4, default=3) How thorough the block verification is.
2. nblocks (numeric, optional, default=6, 0=all) The number of blocks to check.
Verifies that a proof points to a transaction in a block, returning the transaction it commits to and throwing an RPC error if the block is not in our best chain
Arguments:
1. "proof" (string, required) The hex-encoded proof generated by gettxoutproof
Result:
["txid"] (array, strings) The txid(s) which the proof commits to, or empty array if the proof can not be validated.
waitforlogs (fromBlock) (toBlock) (filter) (minconf) requires -logevents to be enabled
Waits for a new logs and return 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 entires.
This call is different from the similarly named waitforlogs. 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
Result:
An object with the following properties:
1. logs (LogEntry[]) Array of matchiing log entries. This may be empty if `filter` removed all entries.2. count (int) How many log entries are returned.3. nextBlock (int) To wait for new log entries haven't seen before, use this number as `fromBlock`
Usage:
`waitforlogs` waits for new logs, starting from the tip of the chain.
`waitforlogs 600` waits for new logs, but starting from block 600. If there are logs available, this call will return immediately.
`waitforlogs 600 700` waits for new logs, but only up to 700th block
`waitforlogs null null` this is equivalent to `waitforlogs`, using default parameter values
`waitforlogs null null` { "addresses": [ "ff0011..." ], "topics": [ "c0fefe"] }` waits for logs in the future matching the specified conditions
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.
getmemoryinfo
Returns an object containing information about memory usage.
Arguments:
1. "mode" determines what kind of information is returned. This argument is optional, the default mode is "stats".
- "stats" returns general statistics about memory usage in the daemon.
- "mallocinfo" returns an XML string describing low-level heap state (only available if compiled with glibc 2.10+).
Result (mode "stats"):
{
"locked": { (json object) Information about locked memory manager
"used": xxxxx, (numeric) Number of bytes used
"free": xxxxx, (numeric) Number of bytes available in current arenas
"total": xxxxxxx, (numeric) Total number of bytes managed
"locked": xxxxxx, (numeric) Amount of bytes that succeeded locking. If this number is smaller than total, locking pages failed at some point and key data could be swapped to disk.
"chunks_used": xxxxx, (numeric) Number allocated chunks
"chunks_free": xxxxx, (numeric) Number unused chunks
}
}
List all commands, or get help for a specified command.
Arguments:
1. "command" (string, optional) The command to get help on
Result:
"text" (string) The help text
logging
Gets and sets the logging configuration.
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 and return the lists above. The arguments are evaluated in order "include", "exclude".
If an item is both included and excluded, it will thus end up being excluded.
In addition, the following are available as category names with special meanings:
"all", "1" : represent all logging categories.
"none", "0" : even if other logging categories are specified, ignore all of them.
Arguments:
1. "include" (array of strings, optional) A json array of categories to add debug logging
[
"category" (string) the valid logging category
,...
]
2. "exclude" (array of strings, optional) A json array of categories to remove debug logging
[
"category" (string) the valid logging category
,...
]
Result:
{
"category": 0|1, (numeric) if being debug logged or not. 0:inactive, 1:active
...
}
Mine up to nblocks blocks immediately (before the RPC call returns) to an address in the wallet.
Arguments:
1. nblocks (numeric, required) How many blocks are generated immediately.
2. maxtries (numeric, optional) How many iterations to try (default = 1000000).
Result:
[ blockhashes ] (array) hashes of blocks generated
Examples:
Generate 11 blocks
> hydra-cli generate 11
generatetoaddress
Mine blocks immediately to a specified address (before the RPC call returns)
Arguments:
1. nblocks (numeric, required) How many blocks are generated immediately.
2. address (string, required) The address to send the newly generated hydra to.
3. maxtries (numeric, optional) How many iterations to try (default = 1000000).
Result:
[ blockhashes ] (array) hashes of blocks generated
Examples:
Generate 11 blocks to myaddress
> hydra-cli generatetoaddress 11 "myaddress"
1. template_request (json object, optional) A json object in the following spec
{
"mode":"template" (string, optional) This must be set to "template", "proposal" (see BIP 23), or omitted
"capabilities":[ (array, optional) A list of strings
"support" (string) client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid'
,...
],
"rules":
[
(array, optional) A list of strings
"support" (string) client side supported softfork deployment
,...
]
}
Result:
{
"version" : n, (numeric) The preferred block version
"rules" : [ "rulename", ... ], (array of strings) specific block rules that are to be enforced
"vbavailable" : { (json object) set of pending, supported versionbit (BIP 9) softfork deployments
"rulename" : bitnumber (numeric) identifies the bit number as indicating acceptance and readiness for the named softfork rule
,...
},
"vbrequired" : n, (numeric) bit mask of versionbits the server requires set in submissions
"previousblockhash" : "xxxx", (string) The hash of current highest block
"transactions" : [ (array) contents of non-coinbase transactions that should be included in the next block
{
"data" : "xxxx", (string) transaction data encoded in hexadecimal (byte-for-byte)
"txid" : "xxxx", (string) transaction id encoded in little-endian hexadecimal
"hash" : "xxxx", (string) hash encoded in little-endian hexadecimal (including witness data)
"depends" : [ (array) array of numbers
n (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is
,...
],
"fee": n, (numeric) difference in value between transaction inputs and outputs (in satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one
"sigops" : n, (numeric) total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero
"weight" : n, (numeric) total transaction weight, as counted for purposes of block limits
}
,...
],
"coinbaseaux" : { (json object) data that should be included in the coinbase's scriptSig content
"flags" : "xx" (string) key name is to be ignored, and value included in scriptSig
},
"coinbasevalue" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)
"coinbasetxn" : { ... }, (json object) information for coinbase transaction
"target" : "xxxx", (string) The hash target
"mintime" : xxx, (numeric) The minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT)
"mutable" : [ (array of string) list of ways the block template may be changed
"value" (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'
,...
],
"noncerange" : "00000000ffffffff",(string) A range of valid nonces
"sigoplimit" : n, (numeric) limit of sigops in blocks
"sizelimit" : n, (numeric) limit of block size
"weightlimit" : n, (numeric) limit of block weight
"curtime" : ttt, (numeric) current timestamp in seconds since epoch (Jan 1 1970 GMT)
"bits" : "xxxxxxxx", (string) compressed target of next block
"height" : n (numeric) The height of the next block
}
getmininginfo
Returns a json object containing mining-related information.
{
"blocks": nnn, (numeric) The current block
"currentblockweight": nnn, (numeric) The last block weight
"currentblocktx": nnn, (numeric) The last block transaction
"difficulty": xxx.xxxxx (numeric) The current difficulty
"networkhashps": nnn, (numeric) The network hashes per second
"pooledtx": n (numeric) The size of the mempool
"chain": "xxxx", (string) current network name as defined in BIP70 (main, test, regtest)
"warnings": "..." (string) any network and blockchain warnings
}
Returns the estimated network hashes per second based on the last n blocks (for PoW only). Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change. Pass in [height] to estimate the network speed at the time when a certain block was found.
Arguments:
1. nblocks (numeric, optional, default=120) The number of blocks, or -1 for blocks since last difficulty change.
2. height (numeric, optional, default=-1) To estimate at the time of the given height.
Returns an object containing staking-related information.
Example:
./hydra-cli getstakinginfo
Result:
{
"enabled": true or false,(bool),if HD key is enabled, the value if true,else is false.
"staking": true or false,(bool),if wallet staking token or not.
"errors": "XXX", (string), any network and blockchain errors
"currentblocktx": n, (numberic),the last block transaction
"pooledtx": n, (numberic), The size of the mempool
"difficulty": n, (numberic),the current proof-of-work difficulty
"search-interval": n,
"weight": n, (numberic), the total staking token number
"netstakeweight": n, (numberic), the total numbers of staking in the network
"expectedtime": n, (numberic), the time that to get the rights to cast the block
}