RPC - Add getbestchainlock (#160)

* RPC - Add getbestchainlock

* Add missing markdown file
This commit is contained in:
thephez 2019-09-30 16:06:46 -04:00 committed by GitHub
parent 1b23f2c8e4
commit 471899ae2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 78 additions and 0 deletions

View file

@ -117,6 +117,7 @@ These RPCs are all Dash-specific and not found in Bitcoin Core
{% autocrossref %}
* [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}}
* [GetBestChainLock][rpc getbestchainlock]: {{summary_getBestChainLock}} {{DASH_NEW0_14_1}}
* [GetBlock][rpc getblock]: {{summary_getBlock}} {{DASH_UPDATED0_14_1}}
* [GetBlockChainInfo][rpc getblockchaininfo]: {{summary_getBlockChainInfo}} {{DASH_UPDATED0_14_1}}
* [GetBlockCount][rpc getblockcount]: {{summary_getBlockCount}}

View 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 %}

View file

@ -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_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_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_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." %}

View file

@ -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"></td>
</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>
<td class="tg-b7b8">Blockchain</td>
<td class="tg-b7b8"><a href="#getblock">GetBlock</a></td>

View file

@ -103,6 +103,7 @@ http://opensource.org/licenses/MIT.
[rpc getaddressutxos]: /en/developer-reference#getaddressutxos
[rpc getbalance]: /en/developer-reference#getbalance
[rpc getbestblockhash]: /en/developer-reference#getbestblockhash
[rpc getbestchainlock]: /en/developer-reference#getbestchainlock
[rpc getblock]: /en/developer-reference#getblock
[rpc getblockchaininfo]: /en/developer-reference#getblockchaininfo
[rpc getblockcount]: /en/developer-reference#getblockcount