Command Lines (RPC API)
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
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
Copied!
Test example
1
./hydra-cli callcontract "74045ec0dc26ec1861473828bc140ebc4c1f3eff" "00000000000000000000000000000000000000000000000000000000000000a9"
Copied!
Test result:
1
{
2
"address": "74045ec0dc26ec1861473828bc140ebc4c1f3eff",
3
"executionResult": {
4
"gasUsed": 39999999,
5
"excepted": "None",
6
"newAddress": "74045ec0dc26ec1861473828bc140ebc4c1f3eff",
7
"output": "",
8
"codeDeposit": 0,
9
"gasRefunded": 0,
10
"depositSize": 0,
11
"gasForDeposit": 0
12
},
13
"transactionReceipt":
14
{
15
"stateRoot": "1253c56cf79597e89ce179f14e6a86a493356dac410c30efc576503687ad2670",
16
"gasUsed": 39999999,
17
"bloom": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
18
"log": [
19
]
20
}
21
}
Copied!

getaccountinfo

Contract details including balance, storage data and code
Argument:
1
1. "address"(string, required) The contract address
Copied!
Result:
1
Contract details including balance, storage data and code
Copied!
Test example:
1
./hydra-cli getaccountinfo "fdb9d0873ba524ef3ea67c1719666968e1eeb110"
Copied!

getbestblockhash

Returns the hash of the best (tip) block in the longest blockchain.
Result:
1
"hex" (string) the block hash hex encoded
Copied!
Examples:
1
>hydra-cli getbestblockhash
2
3
>curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbestblockhash", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!
Test example:
1
./hydra-cli getbestblockhash
Copied!
Test result:
1
e006ada4d1b7caf1559cc1b5b520ab8c54f51486230f2ea18d2692d3a095ba03
Copied!

getblock

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
1. "blockhash" (string, required) The block hash
2
2. verbosity (numeric, optional, default=1) 0 for hex encoded data, 1 for a json object, and 2 for json object with transaction data
Copied!
Result (for verbosity = 0):
1
"data" (string) A string that is serialized, hex-encoded data for block 'hash'.
Copied!
Result (for verbosity = 1):
1
{
2
"hash" : "hash", (string) the block hash (same as provided)
3
"confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain
4
"size" : n, (numeric) The block size
5
"strippedsize" : n, (numeric) The block size excluding witness data
6
"weight" : n (numeric) The block weight as defined in BIP 141
7
"height" : n, (numeric) The block height or index
8
"version" : n, (numeric) The block version
9
"versionHex" : "00000000", (string) The block version formatted in hexadecimal
10
"merkleroot" : "xxxx", (string) The merkle root
11
"tx" : [ (array of string) The transaction ids
12
"transactionid" (string) The transaction id
13
,...
14
],
15
"time" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)
16
"mediantime" : ttt, (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)
17
"nonce" : n, (numeric) The nonce
18
"bits" : "1d00ffff", (string) The bits
19
"difficulty" : x.xxx, (numeric) The difficulty
20
"chainwork" : "xxxx", (string) Expected number of hashes required to produce the chain up to this block (in hex)
21
"nTx" : n, (numeric) The number of transactions in the block.
22
"previousblockhash" : "hash", (string) The hash of the previous block
23
"nextblockhash" : "hash" (string) The hash of the next block
24
}
Copied!
Result (for verbosity = 2):
1
{
2
..., Same output as verbosity = 1.
3
"tx" : [ (array of Objects) The transactions in the format of the getrawtransaction RPC. Different from verbosity = 1 "tx" result.
4
,...
5
],
6
,... Same output as verbosity = 1.
7
}
Copied!
Examples:
1
> hydra-cli getblock "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblock", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!
test examples:
1
./hydra-cli getblock “eeab43864b89c15bd1ffad21eaabc97f4fa4a576a71b46c9d512afc26168569f”
Copied!
Test result:
1
{
2
"hash": "eeab43864b89c15bd1ffad21eaabc97f4fa4a576a71b46c9d512afc26168569f",
3
"confirmations": 2,
4
"strippedsize": 846,
5
"size": 882,
6
"weight": 3420,
7
"height": 402359,
8
"version": 536870912,
9
"versionHex": "20000000",
10
"merkleroot": "359698a4d0e24baadfe9892b56bb5a6090830aea9fe1bf221f4766d7d552eeff",
11
"hashStateRoot": "6099ad48961a320b62cc29ba3d89dcbd8bbc0e33069f6c7169ba008039cbc44f",
12
"hashUTXORoot": "9e729950c184acd011471252a0c1a4bc279cd4c1e86d543bead4af6df787b2dd",
13
"tx": [
14
"9cd9f5e952988cd88c73b7cd172cc17f7ba6ec7c34918b50fbfa3901251cbc2f",
15
"49260697a2d127541cfd5190fc18a5193f118d4b1cc23504a520983ad7f0ee35"
16
],
17
"time": 1562145008,
18
"mediantime": 1562144608,
19
"nonce": 0,
20
"bits": "1a037540",
21
"difficulty": 4851625.823213781,
22
"chainwork": "000000000000000000000000000000000000000000000114688c263219ba17a6",
23
"nTx": 2,
24
"previousblockhash": "dd7ccce7a7b419874dac6097c6505c3b00efdce9336aa9ad79363c81d8a05e26",
25
"nextblockhash": "60ef2b919581b7d7f684e6e2de574ee72ac94cb924770988d2686ca4c3b6e24a",
26
"flags": "proof-of-stake",
27
"proofhash": "000001199a996fef47845c16830c9187ed076dea11d34ba734201a011945c962",
28
"modifier": "148572257a37c882895429d69b15d8a2446be5ad5f0d74237ecf621841164990",
29
"signature": "304402204fe60e75699f3773e3c1d86281f2e7cf17268d23e40628622b3a215fea299e68022041c767b4e2ede77311aeaca2dfafc8f9066f628d2aa3234a57604cebc976c311"
30
}
Copied!

getblockchaininfo

Returns an object containing various state info regarding blockchain processing.
Result:
1
{
2
"chain": "xxxx", (string) current network name as defined in BIP70 (main, test, regtest)
3
"blocks": xxxxxx, (numeric) the current number of blocks processed in the server
4
"headers": xxxxxx, (numeric) the current number of headers we have validated
5
"bestblockhash": "...", (string) the hash of the currently best block
6
"difficulty": xxxxxx, (numeric) the current difficulty
7
"mediantime": xxxxxx, (numeric) median time for the current best block
8
"verificationprogress": xxxx, (numeric) estimate of verification progress [0..1]
9
"initialblockdownload": xxxx, (bool) (debug information) estimate of whether this node is in Initial Block Download mode.
10
"chainwork": "xxxx" (string) total amount of work in active chain, in hexadecimal
11
"size_on_disk": xxxxxx, (numeric) the estimated size of the block and undo files on disk
12
"pruned": xx, (boolean) if the blocks are subject to pruning
13
"pruneheight": xxxxxx, (numeric) lowest-height complete block stored (only present if pruning is enabled)
14
"automatic_pruning": xx, (boolean) whether automatic pruning is enabled (only present if pruning is enabled)
15
"prune_target_size": xxxxxx, (numeric) the target size used by pruning (only present if automatic pruning is enabled)
16
"softforks": [ (array) status of softforks in progress
17
{
18
"id": "xxxx", (string) name of softfork
19
"version": xx, (numeric) block version
20
"reject": { (object) progress toward rejecting pre-softfork blocks
21
"status": xx, (boolean) true if threshold reached
22
},
23
}, ...
24
],
25
"bip9_softforks": { (object) status of BIP9 softforks in progress
26
"xxxx" : { (string) name of the softfork
27
"status": "xxxx", (string) one of "defined", "started", "locked_in", "active", "failed"
28
"bit": xx, (numeric) the bit (0-28) in the block version field used to signal this softfork (only for "started" status)
29
"startTime": xx, (numeric) the minimum median time past of a block at which the bit gains its meaning
30
"timeout": xx, (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in
31
"since": xx, (numeric) height of the first block to which the status applies
32
"statistics": { (object) numeric statistics about BIP9 signalling for a softfork (only for "started" status)
33
"period": xx, (numeric) the length in blocks of the BIP9 signalling period
34
"threshold": xx, (numeric) the number of blocks with the version bit set required to activate the feature
35
"elapsed": xx, (numeric) the number of blocks elapsed since the beginning of the current period
36
"count": xx, (numeric) the number of blocks with the version bit set in the current period
37
"possible": xx (boolean) returns false if there are not enough blocks left in this period to pass activation threshold
38
}
39
}
40
}
41
"warnings" : "...", (string) any network and blockchain warnings.
42
}
Copied!
Test example:
1
./hydra-cli getblockchaininfo
Copied!
Test result:
1
{
2
"chain": "main",
3
"blocks": 401574,
4
"headers": 401574,
5
"bestblockhash": "be4cb62080f36d2c3a45127e016460aca82ea1de17af4166ad9341d1a18e00cc",
6
"difficulty": 1699339.658646735,
7
"moneysupply": 101586296,
8
"mediantime": 1562032592,
9
"verificationprogress": 0.9999994694221126,
10
"initialblockdownload": false,
11
"chainwork": "000000000000000000000000000000000000000000000113f4c983f14834f842",
12
"size_on_disk": 1939468044,
13
"pruned": false,
14
"softforks": [
15
{
16
"id": "bip34",
17
"version": 2,
18
"reject": {
19
"status": true
20
}
21
},
22
{
23
"id": "bip66",
24
"version": 3,
25
"reject": {
26
"status": true
27
}
28
},
29
{
30
"id": "bip65",
31
"version": 4,
32
"reject": {
33
"status": true
34
}
35
}
36
],
37
"bip9_softforks": {
38
"csv": {
39
"status": "active",
40
"startTime": 0,
41
"timeout": 999999999999,
42
"since": 6048
43
},
44
"segwit": {
45
"status": "active",
46
"startTime": 0,
47
"timeout": 999999999999,
48
"since": 6048
49
}
50
},
51
"warnings": ""
52
}
Copied!

getblockcount

Returns the number of blocks in the longest blockchain.
Result:
1
n (numeric) The current block count
Copied!
Examples:
1
> hydra-cli getblockcount
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockcount", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!
Test example:
1
./hydra-cli getblockcount
Copied!
Test result:
1
395049
Copied!

getblockhash

Returns hash of block in best-block-chain at height provided.
Arguments:
1
1. height (numeric, required) The height index
Copied!
Result:
1
"hash" (string) The block hash
Copied!
Examples:
1
> hydra-cli getblockhash 1000
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockhash", "params": [1000] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!
Test example:
1
./hydra-cli getblockhash 1
Copied!
Test result:
1
0000d5dab5e76310ae640e9bcfa270c2eb23a1e5948bdf01fc7ed1f157110ab7
Copied!
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
1. "hash" (string, required) The block hash
2
2. verbose (boolean, optional, default=true) true for a json object, false for the hex encoded data
Copied!
Result (for verbose = true):
1
{
2
"hash" : "hash", (string) the block hash (same as provided)
3
"confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain
4
"height" : n, (numeric) The block height or index
5
"version" : n, (numeric) The block version
6
"versionHex" : "00000000", (string) The block version formatted in hexadecimal
7
"merkleroot" : "xxxx", (string) The merkle root
8
"time" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)
9
"mediantime" : ttt, (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)
10
"nonce" : n, (numeric) The nonce
11
"bits" : "1d00ffff", (string) The bits
12
"difficulty" : x.xxx, (numeric) The difficulty
13
"chainwork" : "0000...1f3" (string) Expected number of hashes required to produce the current chain (in hex)
14
"nTx" : n, (numeric) The number of transactions in the block.
15
"previousblockhash" : "hash", (string) The hash of the previous block
16
"nextblockhash" : "hash", (string) The hash of the next block
17
}
Copied!
Result (for verbose = false):
1
"data" (string) A string that is serialized, hex-encoded data for block 'hash'.
Copied!
Examples:
1
> hydra-cli getblockheader "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockheader", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!
Test example:
1
./hydra-cli getblockheader
2
“ebd10c9b338247a9ccfd45493b484ae5638a5d97ddaa68c44c6ef214ea443c19”
Copied!
Test result:
1
{
2
"hash": "ebd10c9b338247a9ccfd45493b484ae5638a5d97ddaa68c44c6ef214ea443c19",
3
"confirmations": -1,
4
"height": 388910,
5
"version": 536870912,
6
"versionHex": "20000000",
7
"merkleroot": "b1a21dd48f978ea8671383f9454d058d2047d19666348340bea543cf89e31aca",
8
"time": 1560222144,
9
"mediantime": 1560221568,
10
"nonce": 0,
11
"bits": "1a097561",
12
"difficulty": 1773742.122273433,
13
"chainwork": "00000000000000000000000000000000000000000000010ca5944ed9b867aaef",
14
"nTx": 7,
15
"hashStateRoot": "10504057696a3ad9f96254b86424cc8f49f3ef2b271893f933b18174e538b828",
16
"hashUTXORoot": "9e729950c184acd011471252a0c1a4bc279cd4c1e86d543bead4af6df787b2dd",
17
"previousblockhash": "56044826105d66a95ab6f97f945a7cd18eef7109c59da64a7b6c57c377eaf4bb",
18
"flags": "proof-of-stake",
19
"proofhash": "0000000000000000000000000000000000000000000000000000000000000000",
20
"modifier": "1551ed22c1a43da60aebcb2d66a1e42d9bf6a007276367a4a189325ea37a1f91"
21
}
Copied!

getblockstats

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
1. "hash_or_height" (string or numeric, required) The block hash or height of the target block
2
2. "stats" (array, optional) Values to plot, by default all values (see result below)
3
[
4
"height", (string, optional) Selected statistic
5
"time", (string, optional) Selected statistic
6
,...
7
]
Copied!
Result:
1
{
2
"avgfee": xxxxx, (numeric) Average fee in the block
3
"avgfeerate": xxxxx, (numeric) Average feerate (in satoshis per virtual byte)
4
"avgtxsize": xxxxx, (numeric) Average transaction size
5
"blockhash": xxxxx, (string) The block hash (to check for potential reorgs)
6
"feerate_percentiles": [ (array of numeric) Feerates at the 10th, 25th, 50th, 75th, and 90th percentile weight unit (in satoshis per virtual byte)
7
"10th_percentile_feerate", (numeric) The 10th percentile feerate
8
"25th_percentile_feerate", (numeric) The 25th percentile feerate
9
"50th_percentile_feerate", (numeric) The 50th percentile feerate
10
"75th_percentile_feerate", (numeric) The 75th percentile feerate
11
"90th_percentile_feerate", (numeric) The 90th percentile feerate
12
],
13
"height": xxxxx, (numeric) The height of the block
14
"ins": xxxxx, (numeric) The number of inputs (excluding coinbase)
15
"maxfee": xxxxx, (numeric) Maximum fee in the block
16
"maxfeerate": xxxxx, (numeric) Maximum feerate (in satoshis per virtual byte)
17
"maxtxsize": xxxxx, (numeric) Maximum transaction size
18
"medianfee": xxxxx, (numeric) Truncated median fee in the block
19
"mediantime": xxxxx, (numeric) The block median time past
20
"mediantxsize": xxxxx, (numeric) Truncated median transaction size
21
"minfee": xxxxx, (numeric) Minimum fee in the block
22
"minfeerate": xxxxx, (numeric) Minimum feerate (in satoshis per virtual byte)
23
"mintxsize": xxxxx, (numeric) Minimum transaction size
24
"outs": xxxxx, (numeric) The number of outputs
25
"subsidy": xxxxx, (numeric) The block subsidy
26
"swtotal_size": xxxxx, (numeric) Total size of all segwit transactions
27
"swtotal_weight": xxxxx, (numeric) Total weight of all segwit transactions divided by segwit scale factor (4)
28
"swtxs": xxxxx, (numeric) The number of segwit transactions
29
"time": xxxxx, (numeric) The block time
30
"total_out": xxxxx, (numeric) Total amount in all outputs (excluding coinbase and thus reward [ie subsidy + totalfee])
31
"total_size": xxxxx, (numeric) Total size of all non-coinbase transactions
32
"total_weight": xxxxx, (numeric) Total weight of all non-coinbase transactions divided by segwit scale factor (4)
33
"totalfee": xxxxx, (numeric) The fee total
34
"txs": xxxxx, (numeric) The number of transactions (excluding coinbase)
35
"utxo_increase": xxxxx, (numeric) The increase/decrease in the number of unspent outputs
36
"utxo_size_inc": xxxxx, (numeric) The increase/decrease in size for the utxo index (not discounting op_return and similar)
37
}
Copied!
Examples:
1
> hydra-cli getblockstats 1000 '["minfeerate","avgfeerate"]'
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockstats", "params": [1000 '["minfeerate","avgfeerate"]'] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!

getchaintips

Return information about all known tips in the block tree, including the main chain as well as orphaned branches.
Result:
1
[
2
{
3
"height": xxxx, (numeric) height of the chain tip
4
"hash": "xxxx", (string) block hash of the tip
5
"branchlen": 0 (numeric) zero for main chain
6
"status": "active" (string) "active" for the main chain
7
},
8
{
9
"height": xxxx,
10
"hash": "xxxx",
11
"branchlen": 1 (numeric) length of branch connecting the tip to the main chain
12
"status": "xxxx" (string) status of the chain (active, valid-fork, valid-headers, headers-only, invalid)
13
}
14
]
Copied!
Possible values for status:
  1. 1.
    "invalid" This branch contains at least one invalid block
  2. 2.
    "headers-only" Not all blocks for this branch are available, but the headers are valid
  3. 3.
    "valid-headers" All blocks are available for this branch, but they were never fully validated
  4. 4.
    "valid-fork" This branch is not part of the active chain, but is fully validated
  5. 5.
    "active" This is the tip of the active main chain, which is certainly valid
Examples:
1
>hydra-cli getchaintips
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getchaintips", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!
Test example:
1
./hydra-cli getchaintips
Copied!
Result:
1
[
2
{
3
"height": 353464,
4
"hash": "342e378ff153232fb08efe61ceb2fc00e28b1569aa0de97d031ba0bab98387be",
5
"branchlen": 2,
6
"status": "invalid"
7
},
8
{
9
"height": 353415,
10
"hash": "f1748f4c718cf5d36bab1dc7f4199e0e0379a338e6ea55fb18860daa0bc0c604",
11
"branchlen": 1,
12
"status": "valid-fork"
13
},
14
{
15
"height": 353388,
16
"hash": "1fbd1234497731d8f3296c60e9d21cc5c8d57b19d4fe7f154b4aa17e47b526b8",
17
"branchlen": 1,
18
"status": "valid-headers"
19
},
20
{
21
"height": 353103,
22
"hash": "583b2cd790cc493390474306cb78de68e4ba2f0bfdae852ab36c240fb058c559",
23
"branchlen": 1,
24
"status": "valid-fork"
25
},...
26
]
Copied!

getchaintxstats

Compute statistics about the total number and rate of transactions in the chain.
Arguments:
1
1. nblocks (numeric, optional) Size of the window in number of blocks (default: one month).
2
2. "blockhash" (string, optional) The hash of the block that ends the window.
Copied!
Result:
1
{
2
"time": xxxxx, (numeric) The timestamp for the final block in the window in UNIX format.
3
"txcount": xxxxx, (numeric) The total number of transactions in the chain up to that point.
4
"window_final_block_hash": "...", (string) The hash of the final block in the window.
5
"window_block_count": xxxxx, (numeric) Size of the window in number of blocks.
6
"window_tx_count": xxxxx, (numeric) The number of transactions in the window. Only returned if "window_block_count" is > 0.
7
"window_interval": xxxxx, (numeric) The elapsed time in the window in seconds. Only returned if "window_block_count" is > 0.
8
"txrate": x.xx, (numeric) The average rate of transactions per second in the window. Only returned if "window_interval" is > 0.
9
}
Copied!
Examples:
1
> hydra-cli getchaintxstats
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getchaintxstats", "params": [2016] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!
Test result:
1
{
2
"time": 1561602624,
3
"txcount": 866823,
4
"window_final_block_hash": "ea6b26303facc34404da3174962a5c1d8d00369a3ff27aa50238ba8f24170280",
5
"window_block_count": 20250,
6
"window_tx_count": 41012,
7
"window_interval": 2655920,
8
"txrate": 0.01544173017259556
9
}
Copied!

getdifficulty

Returns the proof-of-work difficulty as a multiple of the minimum difficulty.
Returns the proof-of-stake difficulty as a multiple of the minimum difficulty.
Result:
1
n.nnn (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty.
Copied!
Examples:
1
> hydra-cli getdifficulty
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getdifficulty", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!
Test example:
1
./hydra-cli getdifficulty
Copied!
Test result:
1
{
2
"proof-of-work": 1.52587890625e-05,
3
"proof-of-stake": 7022116.100551808
4
}
Copied!

getmempoolancestors

If txid is in the mempool, returns all in-mempool ancestors.
Arguments:
1
1. "txid" (string, required) The transaction id (must be in mempool)
2
2. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids
Copied!
Result (for verbose = false):
1
[
2
"transactionid" (string) The transaction id of an in-mempool ancestor transaction
3
,...
4
]
Copied!
Result (for verbose=true):
1
{
2
"transactionid" : {
3
"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.
4
"fee" : n, (numeric) transaction fee in HYDRA (DEPRECATED)
5
"modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED)
6
"time" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT
7
"height" : n, (numeric) block height when transaction entered pool
8
"descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one)
9
"descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one)
10
"descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)
11
"ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one)
12
"ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)
13
"ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)
14
"wtxid" : hash, (string) hash of serialized transaction, including witness data
15
"fees" : {
16
"base" : n, (numeric) transaction fee in HYDRA
17
"modified" : n, (numeric) transaction fee with fee deltas used for mining priority in hydra
18
"ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in hydra
19
"descendant" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in hydra
20
}
21
"depends" : [ (array) unconfirmed transactions used as inputs for this transaction
22
"transactionid", (string) parent transaction id
23
... ]
24
"spentby" : [ (array) unconfirmed transactions spending outputs from this transaction
25
"transactionid", (string) child transaction id
26
... ]
27
}, ...
28
}
Copied!
Examples:
1
> hydra-cli getmempoolancestors "mytxid"
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmempoolancestors", "params": ["mytxid"] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!
Test example:
1
./hydra-cli getmempoolancestors a957d309824b760814feb6426ba386d082f3b8bc95837e3e7ebada6538cf7e2c
Copied!
Test result:
1
[
2
"c3d044940534fd94fd0c901a895f62505e7beba0dfa44b1563c7aea980279135"
3
]
Copied!

getmempooldescendants

If txid is in the mempool, returns all in-mempool descendants.
Arguments:
1
1. "txid" (string, required) The transaction id (must be in mempool)
2
2. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids
Copied!
Result (for verbose = false):
1
[
2
"transactionid" (string) The transaction id of an in-mempool descendant transaction
3
,...
4
]
Copied!
Result (for verbose=true):
1
{
2
"transactionid" : {
3
"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.
4
"fee" : n, (numeric) transaction fee in HYDRA (DEPRECATED)
5
"modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED)
6
"time" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT
7
"height" : n, (numeric) block height when transaction entered pool
8
"descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one)
9
"descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one)
10
"descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)
11
"ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one)
12
"ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)
13
"ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)
14
"wtxid" : hash, (string) hash of serialized transaction, including witness data
15
"fees" : {
16
"base" : n, (numeric) transaction fee in HYDRA
17
"modified" : n, (numeric) transaction fee with fee deltas used for mining priority in hydra
18
"ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in hydra
19
"descendant" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in hydra
20
}
21
"depends" : [ (array) unconfirmed transactions used as inputs for this transaction
22
"transactionid", (string) parent transaction id
23
... ]
24
"spentby" : [ (array) unconfirmed transactions spending outputs from this transaction
25
"transactionid", (string) child transaction id
26
... ]
27
}, ...
28
}
Copied!
Examples:
1
> hydra-cli getmempooldescendants "mytxid"
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmempooldescendants", "params": ["mytxid"] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!
Test result:
1
[
2
"9d980a4fcdf13fb2c9a5c7769ad6f3e8668aba1f0608be09ef84a11afaf3d03f",
3
"89874d6f44bb3b8a526c50cecda1cbe06c6c6e8107623b79222ee75b79f91d5a",
4
"0c2d893fdc510a6fddb18fc3d441b02d5b6050b754dc6f5d5ddd251707c3d995"
5
]
Copied!

getmempoolentry

Returns mempool data for given transaction
Arguments:
1
1. "txid" (string, required) The transaction id (must be in mempool)
Copied!
Result:
1
{
2
"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.
3
"fee" : n, (numeric) transaction fee in HYDRA (DEPRECATED)
4
"modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED)
5
"time" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT
6
"height" : n, (numeric) block height when transaction entered pool
7
"descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one)
8
"descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one)
9
"descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)
10
"ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one)
11
"ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)
12
"ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)
13
"wtxid" : hash, (string) hash of serialized transaction, including witness data
14
"fees" : {
15
"base" : n, (numeric) transaction fee in HYDRA
16
"modified" : n, (numeric) transaction fee with fee deltas used for mining priority in hydra
17
"ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in hydra
18
"descendant" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in hydra
19
}
20
"depends" : [ (array) unconfirmed transactions used as inputs for this transaction
21
"transactionid", (string) parent transaction id
22
... ]
23
"spentby" : [ (array) unconfirmed transactions spending outputs from this transaction
24
"transactionid", (string) child transaction id
25
... ]
26
}
Copied!
Examples:
1
> hydra-cli getmempoolentry "mytxid"
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmempoolentry", "params": ["mytxid"] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!

getmempoolinfo

Returns details on the active state of the TX memory pool.
Result:
1
{
2
"size": xxxxx, (numeric) Current tx count
3
"bytes": xxxxx, (numeric) Sum of all virtual transaction sizes as defined in BIP 141. Differs from actual serialized size because witness data is discounted
4
"usage": xxxxx, (numeric) Total memory usage for the mempool
5
"maxmempool": xxxxx, (numeric) Maximum memory usage for the mempool
6
"mempoolminfee": xxxxx (numeric) Minimum fee rate in HYDRA/kB for tx to be accepted. Is the maximum of minrelaytxfee and minimum mempool fee
7
"minrelaytxfee": xxxxx (numeric) Current minimum relay fee for transactions
8
}
Copied!
Examples:
1
> hydra-cli getmempoolinfo
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmempoolinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!
Test example:
1
./hydra-cli getmempoolinfo
Copied!
Test result:
1
{
2
"size": 10,
3
"bytes": 3582,
4
"usage": 14176,
5
"maxmempool": 300000000,
6
"mempoolminfee": 0.00400000,
7
"minrelaytxfee": 0.00400000
8
}
Copied!

getrawmempool

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
1. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids
Copied!
Result: (for verbose = false):
1
{
2
"transactionid" : {
3
"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.
4
"fee" : n, (numeric) transaction fee in HYDRA (DEPRECATED)
5
"modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED)
6
"time" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT
7
"height" : n, (numeric) block height when transaction entered pool
8
"descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one)
9
"descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one)
10
"descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)
11
"ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one)
12
"ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)
13
"ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)
14
"wtxid" : hash, (string) hash of serialized transaction, including witness data
15
"fees" : {
16
"base" : n, (numeric) transaction fee in HYDRA
17
"modified" : n, (numeric) transaction fee with fee deltas used for mining priority in hydra
18
"ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in hydra
19
"descendant" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in hydra
20
}
21
"depends" : [ (array) unconfirmed transactions used as inputs for this transaction
22
"transactionid", (string) parent transaction id
23
... ]
24
"spentby" : [ (array) unconfirmed transactions spending outputs from this transaction
25
"transactionid", (string) child transaction id
26
... ]
27
}, ...
28
}
Copied!
Examples:
1
> hydra-cli getrawmempool true
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrawmempool", "params": [true] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!
Test example:
1
./hydra-cli getrawmempool
Copied!
Test result:
1
[
2
"d4e995b2e0b5ef44f90659323e662f408f7938b5b97c345a40192ca6d0b06704",
3
"9e41daae52ece96732305cb0873b8528e7011c866eb7c3c9bee2c22c03e5bf65",
4
"354297aef68f48044af17c3f01616597dad298304e34728fa9894b3ff73a0f33",
5
"e2c407e5468a3e885b73760e3c6115d6d493786fff5ec070e91ad9b4db58b2ef",
6
"15f9f80b536041ebf5c3958c7b7d9bab72c800882235fc782925137c2addbdd2",
7
"109483b1b06746cf4215f3786907b26213adc71a14145acccbba4f0952a751a3",
8
"b49e03dd14a242803bf8108a10a9f82120e21e7d4b0a9255c632e7b92d879136",
9
"40a295fa44931750c048feb817fad96e079ce193c4eda0770d68be6c1f7241c3",
10
"f1e4f8814a404adce808e9b0aed56f61ec151c745cba3a6ac1f0a917884adb59",
11
"b6772f160e21c4633f95b1c5831c6d0451cab1501c375730ea32de64860f1809",
12
"65894a5fcf0e19e13375ba0d0f2afa6e73f52512bc69cf8225c40af824f740d9",
13
"8199c4f6c9f8be79fff4fc9664755bc0502de92d9856083112e55caaa2cb1974",
14
"c3fb5ef13f87f2988c879c274cfbc1613240a12a66e9259388101d82364f1934",
15
"ca78e53edcfba07d4eee2a1bbfc07e26e79e5677104399c794e51d098c735056",
16
"7f66e7f6443ebd0d3a3a8e6bd83e3a5ffc6d32ef5a1ee6487c7abb5cfae7d409",
17
"97966a9f3baeac334cb547d553baf71bf7c68720f350444d7411e0855f39a574",
18
"78285303f6deef553cd5fcd5084db0bae3ccf504ac66f614cb29a5a6f6b5e815",
19
"e5ae989b9782c1afd2c6f71379e46d162ffbe804c5b8db70b7bc85d939df2efe",
20
"2f09732e25eab121a347471a91be55c798cde96aa7f8009da51c2a2d322e6410",
21
"c302d3177a64a4a3c7f2ba1ea196b69754475192afa8249eb18f6f055556c8e1",
22
"7f1de19f02347ea3744bcb11364c9883b91e4f4883b13f15e9e9f52595c1d3d6",
23
"c241f5896723fec65b3af4f94491679ae8a79c434b2e0749651cf416952abac0",
24
"4d8932af7a7073e2c4a5527767215f7bf5b8c7759a5b49d976f0031d5184fd18"
25
]
Copied!

getstorage

Get data stored by smart contracts
Argument:
1
1. "address" (string, required) The address to get the storage from
2
2. "blockNum" (string, optional) Number of block to get state from, "latest" keyword supported. Latest if not passed.
3
3. "index" (number, optional) Zero-based index position of the storage
Copied!
Examples:
1
> hydra-cli getstorage “contract address”
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getstorage", "params": ["address"] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!
Test example:
1
getstorage "fdb9d0873ba524ef3ea67c1719666968e1eeb110"
Copied!
Test result:
1
{
2
"000756ed9982214a7ba55dbe32d0321f5891e75d3c3c467d4b575d55991e03b1":
3
{
4
"52adc13b5e472402f13052709f282024cc52e564f96b2183a5737c545229228d": "0000000000000000000000000000000000000000000000000000000000000001"
5
},
6
}
Copied!

gettransactionreceipt

requires -logevents to be enabled
Argument:
1
1. "hash" (string, required) The contract transaction hash
Copied!
Result:
1
{
2
"blockHash": "XXX" (String), 32 bytes, the blockhash included this tx.
3
"blockNumber": n (Number), the blocknumber included this transaction.
4
"transaction": "XXX": (String), 32 bytes,the hash of this transaction.
5
"transactionIndex": n (numberic), the index in the block for this tx.
6
"from": "XXX" (String), 20 bytes,the sender address of this tx.
7
"to" : "XXXX" (String), 20 bytes,the receiver address of this tx. if this address is created by a contract,return null.
8
"cumulativeGasUsed": n (numberic), The total amount of gas used after execution of the current transaction
9
"gasUsed": n (numberic), The gas cost alone to execute the current transaction。
10
"contractAddress": "XXX" (String), 20 bytes,the created contract address.
11
if this tx is created by the contract, return the contract address. else return null.
12
"logs": []
13
}
Copied!
Test result:
1
[
2
{
3
"blockHash": "1e34edb316f9c442d1db71ad5bd5376650387c6deb275c63c459b6624880180b",
4
"blockNumber": 196529,
5
"transactionHash": "acccfb57aaeb94127560f4762d5372af3dcb4faddf9de3b2ce6bde0fdd1d57d5",
6
"transactionIndex": 2,
7
"from": "83c2436854450b0895d4c1d965720ef5e6a125be",
8
"to": "74045ec0dc26ec1861473828bc140ebc4c1f3eff",
9
"cumulativeGasUsed": 23619,
10
"gasUsed": 23619,
11
"contractAddress": "74045ec0dc26ec1861473828bc140ebc4c1f3eff",
12
"excepted": "None",
13
"log": [
14
]
15
}
16
]
Copied!

gettxout

Returns details about an unspent transaction output.
Arguments:
1
1. "txid" (string, required) The transaction id
2
2. "n" (numeric, required) vout number
3
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.
Copied!
Result:
1
{
2
"bestblock": "hash", (string) The hash of the block at the tip of the chain
3
"confirmations" : n, (numeric) The number of confirmations
4
"value" : x.xxx, (numeric) The transaction value in HYDRA
5
"scriptPubKey" :
6
{
7
"asm" : "code", (string)
8
"hex" : "hex", (string)
9
"reqSigs" : n, (numeric) Number of required signatures
10
"type" : "pubkeyhash",(string) The type, eg pubkeyhash
11
"addresses" : [ (array of string) array of hydra addresses
12
"address" (string) hydra address
13
,...
14
]
15
},
16
"coinbase" : true|false (boolean) Coinbase or not
17
}
Copied!
Examples:
Get unspent transactions
1
> hydra-cli listunspent
Copied!
View the details
1
> hydra-cli gettxout "txid" 1
Copied!
As a json rpc call
1
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettxout", "params": ["txid", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!

gettxoutproof

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
1. "txids" (string,required) A json array of txids to filter
2
[
3
"txid" (string) A transaction hash
4
,...
5
]
6
2. "blockhash" (string, optional) If specified, looks for txid in the block with this hash
Copied!
Result:
1
"data" (string) A string that is a serialized, hex-encoded data for the proof.
Copied!
Test example:
1
./hydra-cli gettxoutproof [\"5caa24c8c78f441a5c37dff602cdacc27b4530b03c09569f62dc3cd20e674918\"]
Copied!
Test result:
1
0000002081d3145a457b724b725171603a991b8d8186f0506c65722e436a6a33d039690ed689a1e4bdea746f8a3c47d6856765282fb5f7f20c9c43cc9e0170b6ba1214076010135d8683001b0000000052ef386ec7ae80719e408c3ea4193583bd0665fffd633d5e10b19e26375ac9b6386faa7484bfd98fc4789fd584229d5c20f72f772a8b3024ea94d1563e84e964b7e989413b1f509a5c14f24dadcf6da7e4f9e8559e5f6ff185cbc978fa1693fc0100000046304402205c0fbeff48e49b24848fba7428ea1c821ef4942135d60f51f6a4260e76941ac5022012a051fc518ec6b684a49eaf75631cdfa5574b170ccab6a0612da44585eab5600300000002fc77727661996828f410e89871d981a1c37f951d35d4ed196745d348cc74ca611849670ed23cdc629f56093cb030457bc2accd02f6df375c1a448fc7c824aa5c010d
Copied!

gettxoutsetinfo

Returns statistics about the unspent transaction output set. Note this call may take some time.
Result:
1
{
2
"height":n, (numeric) The current block height (index)
3
"bestblock": "hex", (string) The hash of the block at the tip of the chain
4
"transactions": n, (numeric) The number of transactions with unspent outputs
5
"txouts": n, (numeric) The number of unspent transaction outputs
6
"bogosize": n, (numeric) A meaningless metric for UTXO set size
7
"hash_serialized_2": "hash", (string) The serialized hash
8
"disk_size": n, (numeric) The estimated size of the chainstate on disk
9
"total_amount": x.xxx (numeric) The total amount
10
}
Copied!
Examples:
1
> hydra-cli gettxoutsetinfo
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettxoutsetinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!

listcontracts

list all the contracts and default accounts is 20
Argument:
1
1. start (numeric or string, optional) The starting account index, default 1
2
2. maxDisplay (numeric or string, optional) Max accounts to list, default 20
Copied!
Test example:
1
> ./hydra-cli listcontracts 1 5
Copied!
Result:
1
{
2
"82155d35dc1e0b5dc3d6ca7e536af42394a7003c": 0.00000000,
3
"c50116ca622b4dbd12205fb9cc61a64f7b63cb8a": 0.00000000,
4
"28d1140499604664be0037272eb287e1742dcafe": 0.00000000,
5
"b9fe4ba102c33ba078d90a2cb6fe8fa94fd114a1": 0.00000000,
6
"954999d28fd46c6de806f9587a82321437771ab2": 0.00000000
7
}
Copied!

preciousblock

Treats a block as if it were received before others with the same work.
A later preciousblock call can override the effect of an earlier one.
The effects of preciousblock are not retained across restarts.
Arguments:
1
1. "blockhash" (string, required) the hash of the block to mark as precious
Copied!
Examples:
1
> hydra-cli preciousblock "blockhash"
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "preciousblock", "params": ["blockhash"] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!

pruneblockchain

prune the spend tx to reduce the size of the block
Arguments:
1
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.
Copied!
Result:
1
n (numeric) Height of the last block pruned.
Copied!
Examples:
1
> hydra-cli pruneblockchain 1000
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "pruneblockchain", "params": [1000] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!

savemempool

Dumps the mempool to disk. It will fail until the previous dump is fully loaded.
Examples:
1
> hydra-cli savemempool
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "savemempool", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!

scantxoutset

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
1. "action" (string, required) The action to execute
2
"start" for starting a scan
3
"abort" for aborting the current scan (returns true when abort was successful)
4
"status" for progress report (in %) of the current scan
5
2. "scanobjects" (array, required) Array of scan objects
6
[ Every scan object is either a string descriptor or an object:
7
"descriptor", (string, optional) An output descriptor
8
{ (object, optional) An object with output descriptor and metadata
9
"desc": "descriptor", (string, required) An output descriptor
10
"range": n, (numeric, optional) Up to what child index HD chains should be explored (default: 1000)
11
},
12
...
13
]
Copied!
Result:
1
{
2
"unspents": [
3
{
4
"txid" : "transactionid", (string) The transaction id
5
"vout": n, (numeric) the vout value
6
"scriptPubKey" : "script", (string) the script key
7
"amount" : x.xxx, (numeric) The total amount in hydra of the unspent output
8
"height" : n, (numeric) Height of the unspent transaction output
9
}
10
,...],
11
"total_amount" : x.xxx, (numeric) The total amount of all found unspent outputs in hydra
12
]
Copied!

searchlogs

requires -logevents to be enabled
Arguments:
1
1. "fromBlock" (numeric, required) The number of the earliest block (latest may be given to mean the most recent block).
2
2. "toBlock" (string, required) The number of the latest block (-1 may be given to mean the most recent block).
3
3. "address" (string, optional) An address or a list of addresses to only get logs from particular account(s).
4
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
5. "minconf" (uint, optional, default=0) Minimal number of confirmations before a log is returned
Copied!
Examples:
1
> hydra-cli searchlogs 0 100 '{"addresses": ["12ae42729af478ca92c8c66773a3e32115717be4"]}' '{"topics": ["null","b436c2bf863ccd7b8f63171201efd4792066b4ce8e543dde9c3e9e9ab98e216c"]}'
2
3
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "searchlogs", "params": [0 100 {"addresses": ["12ae42729af478ca92c8c66773a3e32115717be4"]} {"topics": ["null","b436c2bf863ccd7b8f63171201efd4792066b4ce8e543dde9c3e9e9ab98e216c"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:3389/
Copied!

verifychain