mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 09:46:12 +00:00
RPC - Add getbestchainlock (#160)
* RPC - Add getbestchainlock * Add missing markdown file
This commit is contained in:
parent
1b23f2c8e4
commit
471899ae2d
8 changed files with 78 additions and 0 deletions
|
@ -357,6 +357,8 @@ DIP8:
|
||||||
'`getbalance` RPC': rpc getbalance
|
'`getbalance` RPC': rpc getbalance
|
||||||
'`getbestblockhash`': rpc getbestblockhash
|
'`getbestblockhash`': rpc getbestblockhash
|
||||||
'`getbestblockhash` RPC': rpc getbestblockhash
|
'`getbestblockhash` RPC': rpc getbestblockhash
|
||||||
|
'`getbestchainlock`': rpc getbestchainlock
|
||||||
|
'`getbestchainlock` RPC': rpc getbestchainlock
|
||||||
'`getblock`': rpc getblock
|
'`getblock`': rpc getblock
|
||||||
'`getblock` RPC': rpc getblock
|
'`getblock` RPC': rpc getblock
|
||||||
'`getblockchaininfo`': rpc getblockchaininfo
|
'`getblockchaininfo`': rpc getblockchaininfo
|
||||||
|
|
|
@ -200,6 +200,7 @@ devsearches:
|
||||||
- 'GetAddressUtxos': "/en/developer-reference#getaddressutxos"
|
- 'GetAddressUtxos': "/en/developer-reference#getaddressutxos"
|
||||||
- 'GetBalance': "/en/developer-reference#getbalance"
|
- 'GetBalance': "/en/developer-reference#getbalance"
|
||||||
- 'GetBestBlockHash': "/en/developer-reference#getbestblockhash"
|
- 'GetBestBlockHash': "/en/developer-reference#getbestblockhash"
|
||||||
|
- 'GetBestChainLock': "/en/developer-reference#getbestchainlock"
|
||||||
- 'GetBlock': "/en/developer-reference#getblock"
|
- 'GetBlock': "/en/developer-reference#getblock"
|
||||||
- 'GetBlockChainInfo': "/en/developer-reference#getblockchaininfo"
|
- 'GetBlockChainInfo': "/en/developer-reference#getblockchaininfo"
|
||||||
- 'GetBlockCount': "/en/developer-reference#getblockcount"
|
- 'GetBlockCount': "/en/developer-reference#getblockcount"
|
||||||
|
|
|
@ -117,6 +117,7 @@ These RPCs are all Dash-specific and not found in Bitcoin Core
|
||||||
{% autocrossref %}
|
{% autocrossref %}
|
||||||
|
|
||||||
* [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}}
|
* [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}}
|
||||||
|
* [GetBestChainLock][rpc getbestchainlock]: {{summary_getBestChainLock}} {{DASH_NEW0_14_1}}
|
||||||
* [GetBlock][rpc getblock]: {{summary_getBlock}} {{DASH_UPDATED0_14_1}}
|
* [GetBlock][rpc getblock]: {{summary_getBlock}} {{DASH_UPDATED0_14_1}}
|
||||||
* [GetBlockChainInfo][rpc getblockchaininfo]: {{summary_getBlockChainInfo}} {{DASH_UPDATED0_14_1}}
|
* [GetBlockChainInfo][rpc getblockchaininfo]: {{summary_getBlockChainInfo}} {{DASH_UPDATED0_14_1}}
|
||||||
* [GetBlockCount][rpc getblockcount]: {{summary_getBlockCount}}
|
* [GetBlockCount][rpc getblockcount]: {{summary_getBlockCount}}
|
||||||
|
|
64
_includes/devdoc/dash-core/rpcs/rpcs/getbestchainlock.md
Normal file
64
_includes/devdoc/dash-core/rpcs/rpcs/getbestchainlock.md
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
{% comment %}
|
||||||
|
This file is licensed under the MIT License (MIT) available on
|
||||||
|
http://opensource.org/licenses/MIT.
|
||||||
|
{% endcomment %}
|
||||||
|
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getbestchainlock.md" %}
|
||||||
|
|
||||||
|
<!--__-->
|
||||||
|
|
||||||
|
##### GetBestChainLock
|
||||||
|
{% include helpers/subhead-links.md %}
|
||||||
|
|
||||||
|
{% assign summary_getBestChainLock="returns the block hash of the best chainlock." %}
|
||||||
|
|
||||||
|
{% autocrossref %}
|
||||||
|
|
||||||
|
The `getbestchainlock` RPC {{summary_getBestChainLock}}
|
||||||
|
|
||||||
|
Throws an error if there is no known chainlock yet.
|
||||||
|
|
||||||
|
*Parameters: none*
|
||||||
|
|
||||||
|
*Result*
|
||||||
|
|
||||||
|
{% itemplate ntpd1 %}
|
||||||
|
- n: "`result`"
|
||||||
|
t: "object/null"
|
||||||
|
p: "Required<br>(exactly 1)"
|
||||||
|
d: "An object containing the requested block, or JSON `null` if an error occurred"
|
||||||
|
|
||||||
|
- n: "→<br>`blockhash`"
|
||||||
|
t: "string (hex)"
|
||||||
|
p: "Required<br>(exactly 1)"
|
||||||
|
d: "The hash of the block encoded as hex in RPC byte order."
|
||||||
|
|
||||||
|
- n: "→<br>`height`"
|
||||||
|
t: "number (int)"
|
||||||
|
p: "Required<br>(exactly 1)"
|
||||||
|
d: "The height of this block on its block chain"
|
||||||
|
|
||||||
|
- n: "→<br>`known_block`"
|
||||||
|
t: "boolean"
|
||||||
|
p: "Required<br>(exactly 1)"
|
||||||
|
d: "True if the block is known by this node"
|
||||||
|
|
||||||
|
{% enditemplate %}
|
||||||
|
|
||||||
|
*Example from Dash Core 0.14.1*
|
||||||
|
|
||||||
|
{% highlight bash %}
|
||||||
|
dash-cli -testnet getbestchainlock
|
||||||
|
{% endhighlight %}
|
||||||
|
|
||||||
|
Result:
|
||||||
|
{% highlight json %}
|
||||||
|
{
|
||||||
|
"blockhash": "000000000036ab34d3005941d4224fc5887526355c98b769e27e5ece05f48860",
|
||||||
|
"height": 182106,
|
||||||
|
"known_block": true
|
||||||
|
}
|
||||||
|
{% endhighlight %}
|
||||||
|
|
||||||
|
*See also: none*
|
||||||
|
|
||||||
|
{% endautocrossref %}
|
|
@ -36,6 +36,7 @@ This file is licensed under the terms of its source texts{%endcomment%}
|
||||||
{% assign summary_getAddressesByAccount="returns a list of every address assigned to a particular account." %}
|
{% assign summary_getAddressesByAccount="returns a list of every address assigned to a particular account." %}
|
||||||
{% assign summary_getBalance="gets the balance in decimal dash across all accounts or for a particular account." %}
|
{% assign summary_getBalance="gets the balance in decimal dash across all accounts or for a particular account." %}
|
||||||
{% assign summary_getBestBlockHash="returns the header hash of the most recent block on the best block chain." %}
|
{% assign summary_getBestBlockHash="returns the header hash of the most recent block on the best block chain." %}
|
||||||
|
{% assign summary_getBestChainLock="returns the block hash of the best chainlock." %}
|
||||||
{% assign summary_getBlock="gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block." %}
|
{% assign summary_getBlock="gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block." %}
|
||||||
{% assign summary_getBlockChainInfo="provides information about the current state of the block chain." %}
|
{% assign summary_getBlockChainInfo="provides information about the current state of the block chain." %}
|
||||||
{% assign summary_getBlockCount="returns the number of blocks in the local best block chain." %}
|
{% assign summary_getBlockCount="returns the number of blocks in the local best block chain." %}
|
||||||
|
|
|
@ -67,6 +67,12 @@ th.tg-sort-header::-moz-selection { background:transparent; }th.tg-sort-header::
|
||||||
<td class="tg-baqh">Y</td>
|
<td class="tg-baqh">Y</td>
|
||||||
<td class="tg-baqh"></td>
|
<td class="tg-baqh"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="tg-yw4l">Blockchain</td>
|
||||||
|
<td class="tg-yw4l"><a href="#getbestchainlock">GetBestChainLock</a></td>
|
||||||
|
<td class="tg-baqh">Y</td>
|
||||||
|
<td class="tg-baqh">Added in 0.14.1</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="tg-b7b8">Blockchain</td>
|
<td class="tg-b7b8">Blockchain</td>
|
||||||
<td class="tg-b7b8"><a href="#getblock">GetBlock</a></td>
|
<td class="tg-b7b8"><a href="#getblock">GetBlock</a></td>
|
||||||
|
|
|
@ -103,6 +103,7 @@ http://opensource.org/licenses/MIT.
|
||||||
[rpc getaddressutxos]: /en/developer-reference#getaddressutxos
|
[rpc getaddressutxos]: /en/developer-reference#getaddressutxos
|
||||||
[rpc getbalance]: /en/developer-reference#getbalance
|
[rpc getbalance]: /en/developer-reference#getbalance
|
||||||
[rpc getbestblockhash]: /en/developer-reference#getbestblockhash
|
[rpc getbestblockhash]: /en/developer-reference#getbestblockhash
|
||||||
|
[rpc getbestchainlock]: /en/developer-reference#getbestchainlock
|
||||||
[rpc getblock]: /en/developer-reference#getblock
|
[rpc getblock]: /en/developer-reference#getblock
|
||||||
[rpc getblockchaininfo]: /en/developer-reference#getblockchaininfo
|
[rpc getblockchaininfo]: /en/developer-reference#getblockchaininfo
|
||||||
[rpc getblockcount]: /en/developer-reference#getblockcount
|
[rpc getblockcount]: /en/developer-reference#getblockcount
|
||||||
|
|
|
@ -140,6 +140,8 @@ untrusted source.
|
||||||
|
|
||||||
{% include devdoc/dash-core/rpcs/rpcs/getbestblockhash.md %}
|
{% include devdoc/dash-core/rpcs/rpcs/getbestblockhash.md %}
|
||||||
|
|
||||||
|
{% include devdoc/dash-core/rpcs/rpcs/getbestchainlock.md %}
|
||||||
|
|
||||||
{% include devdoc/dash-core/rpcs/rpcs/getblock.md %}
|
{% include devdoc/dash-core/rpcs/rpcs/getblock.md %}
|
||||||
|
|
||||||
{% include devdoc/dash-core/rpcs/rpcs/getblockchaininfo.md %}
|
{% include devdoc/dash-core/rpcs/rpcs/getblockchaininfo.md %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue