mirror of
https://github.com/seigler/dash-docs
synced 2025-07-28 18:26:13 +00:00
Continue updating existing Block Chain RPCs
- GetBlockHeader, GetChainTips, GetDifficulty, GetMemPoolInfo, GetRawMemPool
This commit is contained in:
parent
815069243b
commit
4b356105b0
5 changed files with 95 additions and 107 deletions
|
@ -73,11 +73,6 @@ The `getblockheader` RPC {{summary_getBlockHeader}}
|
||||||
p: "Required<br>(exactly 1)"
|
p: "Required<br>(exactly 1)"
|
||||||
d: "This block's version number. See [block version numbers][section block versions]"
|
d: "This block's version number. See [block version numbers][section block versions]"
|
||||||
|
|
||||||
- n: "→<br>`versionHex`"
|
|
||||||
t: "number (hex)"
|
|
||||||
p: "Required<br>(exactly 1)"
|
|
||||||
d: "This block's hex version number. See [block version numbers][section block versions]"
|
|
||||||
|
|
||||||
- n: "→<br>`merkleroot`"
|
- n: "→<br>`merkleroot`"
|
||||||
t: "string (hex)"
|
t: "string (hex)"
|
||||||
p: "Required<br>(exactly 1)"
|
p: "Required<br>(exactly 1)"
|
||||||
|
@ -120,30 +115,41 @@ The `getblockheader` RPC {{summary_getBlockHeader}}
|
||||||
|
|
||||||
{% enditemplate %}
|
{% enditemplate %}
|
||||||
|
|
||||||
*Example from Bitcoin Core 0.12.1*
|
*Changes from Bitcoin - Following items not present in Dash result*
|
||||||
|
|
||||||
|
{% itemplate ntpd1 %}
|
||||||
|
|
||||||
|
- n: "→<br>`versionHex`"
|
||||||
|
t: "number (hex)"
|
||||||
|
p: "Required<br>(exactly 1)"
|
||||||
|
d: "This block's hex version number. See [block version numbers][section block versions]"
|
||||||
|
|
||||||
|
{% enditemplate %}
|
||||||
|
|
||||||
|
*Example from Dash Core 0.12.2*
|
||||||
|
|
||||||
Get a block header in raw hex:
|
Get a block header in raw hex:
|
||||||
|
|
||||||
{% highlight bash %}
|
{% highlight bash %}
|
||||||
bitcoin-cli -testnet getblockheader \
|
dash-cli -testnet getblockheader \
|
||||||
00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09 \
|
00000000eb0af5aec7b673975a22593dc0cc763f71ba8de26292410273437078 \
|
||||||
false
|
false
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
Result (wrapped):
|
Result (wrapped):
|
||||||
|
|
||||||
{% highlight text %}
|
{% highlight text %}
|
||||||
010000007de867cc8adc5cc8fb6b898ca4462cf9fd667d7830a275277447e608\
|
01000020f61396cfd2747e94cfa088fe1f7875d8171accc22d6e5616edca0cb8\
|
||||||
00000000338f121232e169d3100edd82004dc2a1f0e1f030c6c488fa61eafa93\
|
00000000c31eb96ee1d9e78d61a601371a348c19e4e59698d0ff7869334b72cb\
|
||||||
0b0528fe021f7449ffff001d36b4af9a
|
7ffb76893b41d6593016011d09b2aa3c
|
||||||
|
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
Get the same block in JSON:
|
Get the same block in JSON:
|
||||||
|
|
||||||
{% highlight bash %}
|
{% highlight bash %}
|
||||||
bitcoin-cli -testnet getblockheader \
|
dash-cli -testnet getblockheader \
|
||||||
00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09
|
00000000eb0af5aec7b673975a22593dc0cc763f71ba8de26292410273437078
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
Result:
|
Result:
|
||||||
|
@ -151,20 +157,19 @@ Result:
|
||||||
{% highlight json %}
|
{% highlight json %}
|
||||||
|
|
||||||
{
|
{
|
||||||
"hash": "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09",
|
"hash": "00000000eb0af5aec7b673975a22593dc0cc763f71ba8de26292410273437078",
|
||||||
"confirmations": 437926,
|
"confirmations": 7,
|
||||||
"height": 1000,
|
"height": 4635,
|
||||||
"version": 1,
|
"version": 536870913,
|
||||||
"versionHex": "00000001",
|
"merkleroot": "8976fb7fcb724b336978ffd09896e5e4198c341a3701a6618de7d9e16eb91ec3",
|
||||||
"merkleroot": "fe28050b93faea61fa88c4c630f0e1f0a1c24d0082dd0e10d369e13212128f33",
|
"time": 1507213627,
|
||||||
"time": 1232346882,
|
"mediantime": 1507213022,
|
||||||
"mediantime": 1232344831,
|
"nonce": 1017819657,
|
||||||
"nonce": 2595206198,
|
"bits": "1d011630",
|
||||||
"bits": "1d00ffff",
|
"difficulty": 0.920228600314536,
|
||||||
"difficulty": 1,
|
"chainwork": "000000000000000000000000000000000000000000000000000001e06428c09a",
|
||||||
"chainwork": "000000000000000000000000000000000000000000000000000003e903e903e9",
|
"previousblockhash": "00000000b80ccaed16566e2dc2cc1a17d875781ffe88a0cf947e74d2cf9613f6",
|
||||||
"previousblockhash": "0000000008e647742775a230787d66fdf92c46a48c896bfbc85cdc8acc67e87d",
|
"nextblockhash": "000000003b1aa290db62ae7cfb4dbb67c8e1402a40ef387587f930b8ec3b45db"
|
||||||
"nextblockhash": "00000000a2887344f8db859e372e7e4bc26b23b9de340f725afbf2edb265b4c6"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
|
@ -38,6 +38,16 @@ The `getchaintips` RPC {{summary_getChainTips}}
|
||||||
p: "Required<br>(exactly 1)"
|
p: "Required<br>(exactly 1)"
|
||||||
d: "The hash of the highest block in the chain, encoded as hex in RPC byte order"
|
d: "The hash of the highest block in the chain, encoded as hex in RPC byte order"
|
||||||
|
|
||||||
|
- n: "→<br>`difficulty`"
|
||||||
|
t: "number (real)"
|
||||||
|
p: "Required<br>(exactly 1)"
|
||||||
|
d: "The difficulty of the highest-height block in the best block chain (Added in Dash Core 0.12.1)"
|
||||||
|
|
||||||
|
- n: "→<br>`chainwork`"
|
||||||
|
t: "string (hex)"
|
||||||
|
p: "Required<br>(exactly 1)"
|
||||||
|
d: "The estimated number of block header hashes checked from the genesis block to this block, encoded as big-endian hex (Added in Dash Core 0.12.1)"
|
||||||
|
|
||||||
- n: "→ →<br>`branchlen`"
|
- n: "→ →<br>`branchlen`"
|
||||||
t: "number (int)"
|
t: "number (int)"
|
||||||
p: "Required<br>(exactly 1)"
|
p: "Required<br>(exactly 1)"
|
||||||
|
@ -50,32 +60,22 @@ The `getchaintips` RPC {{summary_getChainTips}}
|
||||||
|
|
||||||
{% enditemplate %}
|
{% enditemplate %}
|
||||||
|
|
||||||
*Example from Bitcoin Core 0.10.0*
|
*Example from Dash Core 0.12.2*
|
||||||
|
|
||||||
{% highlight bash %}
|
{% highlight bash %}
|
||||||
bitcoin-cli -testnet getchaintips
|
dash-cli -testnet getchaintips
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
{% highlight json %}
|
{% highlight json %}
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"height" : 312647,
|
"height": 4655,
|
||||||
"hash" : "000000000b1be96f87b31485f62c1361193304a5ad78acf47f9164ea4773a843",
|
"hash": "00000000629c276241d9526d85297f2675d6edebcc7fd0c39e8f4263d729b8c1",
|
||||||
"branchlen" : 0,
|
"difficulty": 0.9622782802772231,
|
||||||
"status" : "active"
|
"chainwork": "000000000000000000000000000000000000000000000000000001f1e286e12a",
|
||||||
},
|
"branchlen": 0,
|
||||||
{
|
"status": "active"
|
||||||
"height" : 282072,
|
}
|
||||||
"hash" : "00000000712340a499b185080f94b28c365d8adb9fc95bca541ea5e708f31028",
|
|
||||||
"branchlen" : 5,
|
|
||||||
"status" : "valid-fork"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"height" : 281721,
|
|
||||||
"hash" : "000000006e1f2a32199629c6c1fbd37766f5ce7e8c42bab0c6e1ae42b88ffe12",
|
|
||||||
"branchlen" : 1,
|
|
||||||
"status" : "valid-headers"
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
|
|
|
@ -25,16 +25,16 @@ The `getdifficulty` RPC {{summary_getDifficulty}}
|
||||||
|
|
||||||
{% enditemplate %}
|
{% enditemplate %}
|
||||||
|
|
||||||
*Example from Bitcoin Core 0.10.0*
|
*Example from Dash Core 0.12.2*
|
||||||
|
|
||||||
{% highlight bash %}
|
{% highlight bash %}
|
||||||
bitcoin-cli -testnet getdifficulty
|
dash-cli -testnet getdifficulty
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
Result:
|
Result:
|
||||||
|
|
||||||
{% highlight text %}
|
{% highlight text %}
|
||||||
1.00000000
|
1.069156225528583
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
*See also*
|
*See also*
|
||||||
|
|
|
@ -50,19 +50,19 @@ The `getmempoolinfo` RPC {{summary_getMemPoolInfo}}
|
||||||
|
|
||||||
{% enditemplate %}
|
{% enditemplate %}
|
||||||
|
|
||||||
*Example from Bitcoin Core 0.14.1*
|
*Example from Dash Core 0.12.2*
|
||||||
|
|
||||||
{% highlight bash %}
|
{% highlight bash %}
|
||||||
bitcoin-cli -testnet getmempoolinfo
|
dash-cli -testnet getmempoolinfo
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
Result:
|
Result:
|
||||||
|
|
||||||
{% highlight json %}
|
{% highlight json %}
|
||||||
{
|
{
|
||||||
"size": 1237,
|
"size": 1,
|
||||||
"bytes": 591126,
|
"bytes": 3471,
|
||||||
"usage": 1900416,
|
"usage": 8544,
|
||||||
"maxmempool": 300000000,
|
"maxmempool": 300000000,
|
||||||
"mempoolminfee": 0.00000000
|
"mempoolminfee": 0.00000000
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,12 +59,12 @@ The `getrawmempool` RPC {{summary_getRawMemPool}}
|
||||||
- n: "→ →<br>`fee`"
|
- n: "→ →<br>`fee`"
|
||||||
t: "number (bitcoins)"
|
t: "number (bitcoins)"
|
||||||
p: "Required<br>(exactly 1)"
|
p: "Required<br>(exactly 1)"
|
||||||
d: "The transaction fee paid by the transaction in decimal bitcoins"
|
d: "The transaction fee paid by the transaction in decimal Dash"
|
||||||
|
|
||||||
- n: "→ →<br>`modifiedfee`"
|
- n: "→ →<br>`modifiedfee`"
|
||||||
t: "number (bitcoins)"
|
t: "number (bitcoins)"
|
||||||
p: "Required<br>(exactly 1)"
|
p: "Required<br>(exactly 1)"
|
||||||
d: "*Added in Bitcoin Core 0.12.0*<br><br>The transaction fee with fee deltas used for mining priority in decimal bitcoins"
|
d: "*Added in Bitcoin Core 0.12.0*<br><br>The transaction fee with fee deltas used for mining priority in decimal Dash"
|
||||||
|
|
||||||
- n: "→ →<br>`time`"
|
- n: "→ →<br>`time`"
|
||||||
t: "number (int)"
|
t: "number (int)"
|
||||||
|
@ -101,21 +101,6 @@ The `getrawmempool` RPC {{summary_getRawMemPool}}
|
||||||
p: "Required<br>(exactly 1)"
|
p: "Required<br>(exactly 1)"
|
||||||
d: "*Added in Bitcoin Core 0.12.0*<br><br>The modified fees (see `modifiedfee` above) of in-mempool descendants (including this one)"
|
d: "*Added in Bitcoin Core 0.12.0*<br><br>The modified fees (see `modifiedfee` above) of in-mempool descendants (including this one)"
|
||||||
|
|
||||||
- n: "→ →<br>`ancestorcount`"
|
|
||||||
t: "number (int)"
|
|
||||||
p: "Required<br>(exactly 1)"
|
|
||||||
d: "*Added in Bitcoin Core 0.13.0*<br><br>The number of in-mempool ancestor transactions (including this one)"
|
|
||||||
|
|
||||||
- n: "→ →<br>`ancestorsize`"
|
|
||||||
t: "number (int)"
|
|
||||||
p: "Required<br>(exactly 1)"
|
|
||||||
d: "*Added in Bitcoin Core 0.13.0*<br><br>The size of in-mempool ancestors (including this one)"
|
|
||||||
|
|
||||||
- n: "→ →<br>`ancestorfees`"
|
|
||||||
t: "number (int)"
|
|
||||||
p: "Required<br>(exactly 1)"
|
|
||||||
d: "*Added in Bitcoin Core 0.13.0*<br><br>The modified fees (see `modifiedfee` above) of in-mempool ancestors (including this one)"
|
|
||||||
|
|
||||||
- n: "→ →<br>`depends`"
|
- n: "→ →<br>`depends`"
|
||||||
t: "array"
|
t: "array"
|
||||||
p: "Required<br>(exactly 1)"
|
p: "Required<br>(exactly 1)"
|
||||||
|
@ -128,7 +113,26 @@ The `getrawmempool` RPC {{summary_getRawMemPool}}
|
||||||
|
|
||||||
{% enditemplate %}
|
{% enditemplate %}
|
||||||
|
|
||||||
*Examples from Bitcoin Core 0.13.1*
|
*Changes from Bitcoin - Following items not present in Dash result*
|
||||||
|
|
||||||
|
{% itemplate ntpd1 %}
|
||||||
|
- n: "→ TXID→<br>`ancestorcount`"
|
||||||
|
t: "number (int)"
|
||||||
|
p: "Required<br>(exactly 1)"
|
||||||
|
d: "*Added in Bitcoin Core 0.13.0*<br><br>The number of in-mempool ancestor transactions (including this one)"
|
||||||
|
|
||||||
|
- n: "→ TXID→<br>`ancestorsize`"
|
||||||
|
t: "number (int)"
|
||||||
|
p: "Required<br>(exactly 1)"
|
||||||
|
d: "*Added in Bitcoin Core 0.13.0*<br><br>The size of in-mempool ancestors (including this one)"
|
||||||
|
|
||||||
|
- n: "→ TXID→<br>`ancestorfees`"
|
||||||
|
t: "number (int)"
|
||||||
|
p: "Required<br>(exactly 1)"
|
||||||
|
d: "*Added in Bitcoin Core 0.13.0*<br><br>The modified fees (see `modifiedfee` above) of in-mempool ancestors (including this one)"
|
||||||
|
{% enditemplate %}
|
||||||
|
|
||||||
|
*Examples from Dash Core 0.12.2*
|
||||||
|
|
||||||
The default (`false`):
|
The default (`false`):
|
||||||
|
|
||||||
|
@ -140,52 +144,31 @@ Result:
|
||||||
|
|
||||||
{% highlight json %}
|
{% highlight json %}
|
||||||
[
|
[
|
||||||
"b104586f229e330caf42c475fd52684e9eb5e2d02f0fcd216d9554c5347b0873",
|
"9dc994e03e387ff2d2709fbe86edede9f3d7aaddea7f75694495e415561b22fe"
|
||||||
"094f7dcbc7494510d4daeceb2941ed73b1bd011bf527f6c3b7c897fee85c11d4"
|
|
||||||
]
|
]
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
Verbose output (`true`):
|
Verbose output (`true`):
|
||||||
|
|
||||||
{% highlight bash %}
|
{% highlight bash %}
|
||||||
bitcoin-cli getrawmempool true
|
dash-cli getrawmempool true
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
Result:
|
Result:
|
||||||
|
|
||||||
{% highlight json %}
|
{% highlight json %}
|
||||||
{
|
{
|
||||||
"b104586f229e330caf42c475fd52684e9eb5e2d02f0fcd216d9554c5347b0873": {
|
"9dc994e03e387ff2d2709fbe86edede9f3d7aaddea7f75694495e415561b22fe": {
|
||||||
"size": 485,
|
"size": 3471,
|
||||||
"fee": 0.00009700,
|
"fee": 0.00080520,
|
||||||
"modifiedfee": 0.00009700,
|
"modifiedfee": 0.00080520,
|
||||||
"time": 1479423635,
|
"time": 1507217951,
|
||||||
"height": 439431,
|
"height": 4660,
|
||||||
"startingpriority": 15327081.81818182,
|
"startingpriority": 553299903846.1538,
|
||||||
"currentpriority": 21536936.36363636,
|
"currentpriority": 553299903846.1538,
|
||||||
"descendantcount": 1,
|
"descendantcount": 1,
|
||||||
"descendantsize": 485,
|
"descendantsize": 3471,
|
||||||
"descendantfees": 9700,
|
"descendantfees": 80520,
|
||||||
"ancestorcount": 1,
|
|
||||||
"ancestorsize": 485,
|
|
||||||
"ancestorfees": 9700,
|
|
||||||
"depends": [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"094f7dcbc7494510d4daeceb2941ed73b1bd011bf527f6c3b7c897fee85c11d4": {
|
|
||||||
"size": 554,
|
|
||||||
"fee": 0.00005540,
|
|
||||||
"modifiedfee": 0.00005540,
|
|
||||||
"time": 1479423327,
|
|
||||||
"height": 439430,
|
|
||||||
"startingpriority": 85074.91071428571,
|
|
||||||
"currentpriority": 3497174.4375,
|
|
||||||
"descendantcount": 1,
|
|
||||||
"descendantsize": 554,
|
|
||||||
"descendantfees": 5540,
|
|
||||||
"ancestorcount": 1,
|
|
||||||
"ancestorsize": 554,
|
|
||||||
"ancestorfees": 5540,
|
|
||||||
"depends": [
|
"depends": [
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue