From 19de466c407a40aa06d6b2d465d3900a4333ed7c Mon Sep 17 00:00:00 2001 From: thephez Date: Mon, 9 Oct 2017 10:47:12 -0400 Subject: [PATCH] Add GetBlockhashes details Minor correction in Empty RPC generation script --- .../dash-core/rpcs/rpcs/getblockhashes.md | 66 ++++++++++++++++++- scripts/create_empty_rpc_md.sh | 4 +- 2 files changed, 66 insertions(+), 4 deletions(-) diff --git a/_includes/devdoc/dash-core/rpcs/rpcs/getblockhashes.md b/_includes/devdoc/dash-core/rpcs/rpcs/getblockhashes.md index e3885780..3100f399 100644 --- a/_includes/devdoc/dash-core/rpcs/rpcs/getblockhashes.md +++ b/_includes/devdoc/dash-core/rpcs/rpcs/getblockhashes.md @@ -2,13 +2,75 @@ 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/getblockhashes.md" %}# +{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getblockhashes.md" %} ##### GetBlockHashes {% include helpers/subhead-links.md %} +{% assign summary_getBlockHashes="returns array of hashes of blocks within the timestamp range provided." %} + {% autocrossref %} -{% assign summary_getBlockHashes= %} +The `getblockhashes` RPC {{summary_getBlockHashes}} + +*Parameter #1---high block timestamp* + +{% itemplate ntpd1 %} +- n: "Block Timestamp" + t: "number (int)" + p: "Required
(exactly 1)" + d: "The block timestamp for the newest block hash that should be returned." + +{% enditemplate %} + +*Parameter #2---low block timestamp* + +{% itemplate ntpd1 %} +- n: "Block Timestamp" + t: "number (int)" + p: "Required
(exactly 1)" + d: "The block timestamp for the oldest block hash that should be returned." + +{% enditemplate %} + +*Result---the block header hashes in the give time range* + +{% itemplate ntpd1 %} +- n: "`result`" + t: "array" + p: "Required
(exactly 1)" + d: "The hashes of the blocks in the requested time range" + +- n: "→
`hash`" + t: "string (hex)" + p: "Required
(1 or more)" + d: "The hash of a block in the chain, encoded as hex in RPC byte order" + +{% enditemplate %} + +*Example from Dash Core 0.12.2* + +{% highlight bash %} +dash-cli -testnet getblockhashes 1507555793 1507554793 +{% endhighlight %} + +Result: + +{% highlight json %} +[ + "0000000010a16c6fbc6bd5cdc238c2beabcda334e97fde1500d59be4e6fc4b89", + "000000009910885e811230c403e55aac6547d6df04ee671b2e8348524f73cab8", + "000000004bbb3828db1c4d4491760336cec215087819ab656336f30d4095e3d2", + "00000000ad2df2149aca2261a9a87c41e139dfe8f73d91db7ec0c1837fee21a0", + "0000000074068a9e3a271d165da3deb28bc3f8c751dde97f460d8078d92a9d06" +] +{% endhighlight %} + +*See also* + +* [GetBlock][rpc getblock]: {{summary_getBlock}} +* [GetBlockHash][rpc getblockhash]: {{summary_getBlockHash}} +* [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}} + {% endautocrossref %} diff --git a/scripts/create_empty_rpc_md.sh b/scripts/create_empty_rpc_md.sh index 4c070352..8ae5fbae 100644 --- a/scripts/create_empty_rpc_md.sh +++ b/scripts/create_empty_rpc_md.sh @@ -12,9 +12,9 @@ if [ "$PARAMCOUNT" == 1 ]; then echo "This file is licensed under the MIT License (MIT) available on" >> $FILENAME echo "http://opensource.org/licenses/MIT." >> $FILENAME echo "{% endcomment %}" >> $FILENAME - echo '{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/'$FILENAME'" %}#' >> $FILENAME + echo '{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/'$FILENAME'" %}' >> $FILENAME echo "" >> $FILENAME - echo "##### '$RPCNAME'" >> $FILENAME + echo "##### $RPCNAME" >> $FILENAME echo "{% include helpers/subhead-links.md %}" >> $FILENAME echo "" >> $FILENAME echo "{% autocrossref %}" >> $FILENAME