Add script to create basic RPC md file

Set up empty GetBlockHashes/Headers and GetSpentInfo RPCs
This commit is contained in:
thephez 2017-10-09 09:24:02 -04:00
parent 8a0e561d93
commit ac3b27cd7f
10 changed files with 115 additions and 3 deletions

View file

@ -305,8 +305,12 @@ CVE-2012-2459:
'`getblockcount` RPC': rpc getblockcount '`getblockcount` RPC': rpc getblockcount
'`getblockhash`': rpc getblockhash '`getblockhash`': rpc getblockhash
'`getblockhash` RPC': rpc getblockhash '`getblockhash` RPC': rpc getblockhash
'`getblockhashes`': rpc getblockhashes
'`getblockhashes` RPC': rpc getblockhashes
'`getblockheader`': rpc getblockheader '`getblockheader`': rpc getblockheader
'`getblockheader` RPC': rpc getblockheader '`getblockheader` RPC': rpc getblockheader
'`getblockheaders`': rpc getblockheaders
'`getblockheaders` RPC': rpc getblockheaders
'`getblocktemplate`': rpc getblocktemplate '`getblocktemplate`': rpc getblocktemplate
'`getblocktemplate` RPC': rpc getblocktemplate '`getblocktemplate` RPC': rpc getblocktemplate
'`getchaintips`': rpc getchaintips '`getchaintips`': rpc getchaintips
@ -353,6 +357,8 @@ CVE-2012-2459:
'`getreceivedbyaccount` RPC': rpc getreceivedbyaccount '`getreceivedbyaccount` RPC': rpc getreceivedbyaccount
'`getreceivedbyaddress`': rpc getreceivedbyaddress '`getreceivedbyaddress`': rpc getreceivedbyaddress
'`getreceivedbyaddress` RPC': rpc getreceivedbyaddress '`getreceivedbyaddress` RPC': rpc getreceivedbyaddress
'`getspentinfo`': rpc getspentinfo
'`getspentinfo` RPC': rpc getspentinfo
'`gettransaction`': rpc gettransaction '`gettransaction`': rpc gettransaction
'`gettransaction` RPC': rpc gettransaction '`gettransaction` RPC': rpc gettransaction
'`gettxout`': rpc gettxout '`gettxout`': rpc gettxout

View file

@ -289,7 +289,9 @@ devsearches:
- 'GetBlockChainInfo': "/en/developer-reference#getblockchaininfo" - 'GetBlockChainInfo': "/en/developer-reference#getblockchaininfo"
- 'GetBlockCount': "/en/developer-reference#getblockcount" - 'GetBlockCount': "/en/developer-reference#getblockcount"
- 'GetBlockHash': "/en/developer-reference#getblockhash" - 'GetBlockHash': "/en/developer-reference#getblockhash"
- 'GetBlockHashes': "/en/developer-reference#getblockhashes"
- 'GetBlockHeader': "/en/developer-reference#getblockheader" - 'GetBlockHeader': "/en/developer-reference#getblockheader"
- 'GetBlockHeaders': "/en/developer-reference#getblockheaders"
- 'GetBlockTemplate': "/en/developer-reference#getblocktemplate" - 'GetBlockTemplate': "/en/developer-reference#getblocktemplate"
- 'GetChainTips': "/en/developer-reference#getchaintips" - 'GetChainTips': "/en/developer-reference#getchaintips"
- 'GetConnectionCount': "/en/developer-reference#getconnectioncount" - 'GetConnectionCount': "/en/developer-reference#getconnectioncount"
@ -313,6 +315,7 @@ devsearches:
- 'GetRawTransaction': "/en/developer-reference#getrawtransaction" - 'GetRawTransaction': "/en/developer-reference#getrawtransaction"
- 'GetReceivedByAccount': "/en/developer-reference#getreceivedbyaccount" - 'GetReceivedByAccount': "/en/developer-reference#getreceivedbyaccount"
- 'GetReceivedByAddress': "/en/developer-reference#getreceivedbyaddress" - 'GetReceivedByAddress': "/en/developer-reference#getreceivedbyaddress"
- 'GetSpentInfo': "/en/developer-reference#getspentinfo"
- 'GetTransaction': "/en/developer-reference#gettransaction" - 'GetTransaction': "/en/developer-reference#gettransaction"
- 'GetTxout': "/en/developer-reference#gettxout" - 'GetTxout': "/en/developer-reference#gettxout"
- 'GetTxOutProof': "/en/developer-reference#gettxoutproof" - 'GetTxOutProof': "/en/developer-reference#gettxoutproof"

View file

@ -91,7 +91,7 @@ These RPCs are all Dash-specific and not found in Bitcoin Core
* [GetDifficulty][rpc getdifficulty]: {{summary_getDifficultly}} * [GetDifficulty][rpc getdifficulty]: {{summary_getDifficultly}}
* [GetMemPoolInfo][rpc getmempoolinfo]: {{summary_getMemPoolInfo}} {{UPDATED0_12_0}} * [GetMemPoolInfo][rpc getmempoolinfo]: {{summary_getMemPoolInfo}} {{UPDATED0_12_0}}
* [GetRawMemPool][rpc getrawmempool]: {{summary_getRawMemPool}} {{UPDATED0_13_0}} * [GetRawMemPool][rpc getrawmempool]: {{summary_getRawMemPool}} {{UPDATED0_13_0}}
* [GetSpentInfo][rpc getspentifo]: {{summary_getSpentInfo}} * [GetSpentInfo][rpc getspentinfo]: {{summary_getSpentInfo}}
* [GetTxOut][rpc gettxout]: {{summary_getTxOut}} * [GetTxOut][rpc gettxout]: {{summary_getTxOut}}
* [GetTxOutProof][rpc gettxoutproof]: {{summary_getTxOutProof}} {{NEW0_11_0}} * [GetTxOutProof][rpc gettxoutproof]: {{summary_getTxOutProof}} {{NEW0_11_0}}
* [GetTxOutSetInfo][rpc gettxoutsetinfo]: {{summary_getTxOutSetInfo}} * [GetTxOutSetInfo][rpc gettxoutsetinfo]: {{summary_getTxOutSetInfo}}

View file

@ -0,0 +1,14 @@
{% 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/getblockhashes.md" %}#
##### GetBlockHashes
{% include helpers/subhead-links.md %}
{% autocrossref %}
{% assign summary_getBlockHashes= %}
{% endautocrossref %}

View file

@ -0,0 +1,14 @@
{% 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/getblockheaders.md" %}#
##### GetBlockHeaders
{% include helpers/subhead-links.md %}
{% autocrossref %}
{% assign summary_getBlockHeaders= %}
{% endautocrossref %}

View file

@ -0,0 +1,14 @@
{% 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/getspentinfo.md" %}#
##### GetSpentInfo
{% include helpers/subhead-links.md %}
{% autocrossref %}
{% assign summary_getSpentInfo= %}
{% endautocrossref %}

View file

@ -35,7 +35,9 @@ This file is licensed under the terms of its source texts{%endcomment%}
{% 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." %}
{% assign summary_getBlockHash="returns the header hash of a block at the given height in the local best block chain." %} {% assign summary_getBlockHash="returns the header hash of a block at the given height in the local best block chain." %}
{% assign summary_getBlockHashes= %}
{% assign summary_getBlockHeader="gets a block header with a particular header hash from the local block database either as a JSON object or as a serialized block header." %} {% assign summary_getBlockHeader="gets a block header with a particular header hash from the local block database either as a JSON object or as a serialized block header." %}
{% assign summary_getBlockHeaders= %}
{% assign summary_getBlockTemplate="gets a block template or proposal for use with mining software." %} {% assign summary_getBlockTemplate="gets a block template or proposal for use with mining software." %}
{% assign summary_getChainTips="returns information about the highest-height block (tip) of each local block chain." %} {% assign summary_getChainTips="returns information about the highest-height block (tip) of each local block chain." %}
{% assign summary_getConnectionCount="returns the number of connections to other nodes." %} {% assign summary_getConnectionCount="returns the number of connections to other nodes." %}
@ -59,6 +61,7 @@ This file is licensed under the terms of its source texts{%endcomment%}
{% assign summary_getRawTransaction="gets a hex-encoded serialized transaction or a JSON object describing the transaction. By default, Bitcoin Core only stores complete transaction data for UTXOs and your own transactions, so the RPC may fail on historic transactions unless you use the non-default `txindex=1` in your Bitcoin Core startup settings." %} {% assign summary_getRawTransaction="gets a hex-encoded serialized transaction or a JSON object describing the transaction. By default, Bitcoin Core only stores complete transaction data for UTXOs and your own transactions, so the RPC may fail on historic transactions unless you use the non-default `txindex=1` in your Bitcoin Core startup settings." %}
{% assign summary_getReceivedByAccount="returns the total amount received by addresses in a particular account from transactions with the specified number of confirmations. It does not count coinbase transactions." %} {% assign summary_getReceivedByAccount="returns the total amount received by addresses in a particular account from transactions with the specified number of confirmations. It does not count coinbase transactions." %}
{% assign summary_getReceivedByAddress="returns the total amount received by the specified address in transactions with the specified number of confirmations. It does not count coinbase transactions." %} {% assign summary_getReceivedByAddress="returns the total amount received by the specified address in transactions with the specified number of confirmations. It does not count coinbase transactions." %}
{% assign summary_getSpentInfo= %}
{% assign summary_getTransaction="gets detailed information about an in-wallet transaction." %} {% assign summary_getTransaction="gets detailed information about an in-wallet transaction." %}
{% assign summary_getTxOut="returns details about a transaction output. Only unspent transaction outputs (UTXOs) are guaranteed to be available." %} {% assign summary_getTxOut="returns details about a transaction output. Only unspent transaction outputs (UTXOs) are guaranteed to be available." %}
{% assign summary_getTxOutProof="returns a hex-encoded proof that one or more specified transactions were included in a block." %} {% assign summary_getTxOutProof="returns a hex-encoded proof that one or more specified transactions were included in a block." %}

View file

@ -118,7 +118,9 @@ http://opensource.org/licenses/MIT.
[rpc getblockchaininfo]: /en/developer-reference#getblockchaininfo [rpc getblockchaininfo]: /en/developer-reference#getblockchaininfo
[rpc getblockcount]: /en/developer-reference#getblockcount [rpc getblockcount]: /en/developer-reference#getblockcount
[rpc getblockhash]: /en/developer-reference#getblockhash [rpc getblockhash]: /en/developer-reference#getblockhash
[rpc getblockhashes]: /en/developer-reference#getblockhashes
[rpc getblockheader]: /en/developer-reference#getblockheader [rpc getblockheader]: /en/developer-reference#getblockheader
[rpc getblockheaders]: /en/developer-reference#getblockheaders
[rpc getblocktemplate]: /en/developer-reference#getblocktemplate [rpc getblocktemplate]: /en/developer-reference#getblocktemplate
[rpc getchaintips]: /en/developer-reference#getchaintips [rpc getchaintips]: /en/developer-reference#getchaintips
[rpc getconnectioncount]: /en/developer-reference#getconnectioncount [rpc getconnectioncount]: /en/developer-reference#getconnectioncount
@ -142,6 +144,7 @@ http://opensource.org/licenses/MIT.
[rpc getrawtransaction]: /en/developer-reference#getrawtransaction [rpc getrawtransaction]: /en/developer-reference#getrawtransaction
[rpc getreceivedbyaccount]: /en/developer-reference#getreceivedbyaccount [rpc getreceivedbyaccount]: /en/developer-reference#getreceivedbyaccount
[rpc getreceivedbyaddress]: /en/developer-reference#getreceivedbyaddress [rpc getreceivedbyaddress]: /en/developer-reference#getreceivedbyaddress
[rpc getspentinfo]: /en/developer-reference#getspentinfo
[rpc gettransaction]: /en/developer-reference#gettransaction [rpc gettransaction]: /en/developer-reference#gettransaction
[rpc gettxout]: /en/developer-reference#gettxout [rpc gettxout]: /en/developer-reference#gettxout
[rpc gettxoutproof]: /en/developer-reference#gettxoutproof [rpc gettxoutproof]: /en/developer-reference#gettxoutproof
@ -476,8 +479,8 @@ http://opensource.org/licenses/MIT.
[netcat]: https://en.wikipedia.org/wiki/Netcat [netcat]: https://en.wikipedia.org/wiki/Netcat
[nop opcodes]: https://en.bitcoin.it/wiki/Script#Reserved_words [nop opcodes]: https://en.bitcoin.it/wiki/Script#Reserved_words
[offline transactions]: http://bitcoin.stackexchange.com/a/34122/21052 [offline transactions]: http://bitcoin.stackexchange.com/a/34122/21052
[open a pull request]: https://github.com/bitcoin-dot-org/bitcoin.org#working-with-github [open a pull request]: https://github.com/thephez/dash.org#working-with-github
[open an issue]: https://github.com/bitcoin-dot-org/bitcoin.org/issues/new [open an issue]: https://github.com/thephez/dash.org/issues/new
[Payment Request Generator]: https://github.com/gavinandresen/paymentrequest/blob/master/php/demo_website/createpaymentrequest.php [Payment Request Generator]: https://github.com/gavinandresen/paymentrequest/blob/master/php/demo_website/createpaymentrequest.php
[Piotr Piasecki's testnet faucet]: https://tpfaucet.appspot.com/ [Piotr Piasecki's testnet faucet]: https://tpfaucet.appspot.com/
[prime symbol]: https://en.wikipedia.org/wiki/Prime_%28symbol%29 [prime symbol]: https://en.wikipedia.org/wiki/Prime_%28symbol%29

View file

@ -138,8 +138,12 @@ untrusted source.
{% include devdoc/dash-core/rpcs/rpcs/getblockhash.md %} {% include devdoc/dash-core/rpcs/rpcs/getblockhash.md %}
{% include devdoc/dash-core/rpcs/rpcs/getblockhashes.md %}
{% include devdoc/dash-core/rpcs/rpcs/getblockheader.md %} {% include devdoc/dash-core/rpcs/rpcs/getblockheader.md %}
{% include devdoc/dash-core/rpcs/rpcs/getblockheaders.md %}
{% include devdoc/dash-core/rpcs/rpcs/getblocktemplate.md %} {% include devdoc/dash-core/rpcs/rpcs/getblocktemplate.md %}
{% include devdoc/dash-core/rpcs/rpcs/getchaintips.md %} {% include devdoc/dash-core/rpcs/rpcs/getchaintips.md %}
@ -186,6 +190,8 @@ untrusted source.
{% include devdoc/dash-core/rpcs/rpcs/getreceivedbyaddress.md %} {% include devdoc/dash-core/rpcs/rpcs/getreceivedbyaddress.md %}
{% include devdoc/dash-core/rpcs/rpcs/getspentinfo.md %}
{% include devdoc/dash-core/rpcs/rpcs/gettransaction.md %} {% include devdoc/dash-core/rpcs/rpcs/gettransaction.md %}
{% include devdoc/dash-core/rpcs/rpcs/gettxout.md %} {% include devdoc/dash-core/rpcs/rpcs/gettxout.md %}

View file

@ -0,0 +1,49 @@
#!/bin/bash
#echo "$# parameters"
#echo "$@";
PARAMCOUNT=$#
#echo "$PARAMCOUNT parameters"
if [ "$PARAMCOUNT" == 1 ]; then
FILENAME=${1,,}.md
RPCNAME=$1
echo "{% comment %}" >> $FILENAME
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 "" >> $FILENAME
echo "##### '$RPCNAME'" >> $FILENAME
echo "{% include helpers/subhead-links.md %}" >> $FILENAME
echo "" >> $FILENAME
echo "{% autocrossref %}" >> $FILENAME
echo "" >> $FILENAME
echo "{% assign summary_${RPCNAME,}="" %}" >> $FILENAME
echo "" >> $FILENAME
echo "{% endautocrossref %}" >> $FILENAME
cat $FILENAME
echo " "
echo "Next copy the created file ('$FILENAME') to ../_includes/devdoc/dash-core/rpcs/rpcs"
else
echo "Incorrect number of parameters (Should be exactly 1)"
echo "Usage: create_empty_rpc_md RPCNAME"
echo "Example: create_empty_rpc_md GetBlock"
fi
#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/getaddressutxos.md" %}#
#
###### GetAddressUtxos
#{% include helpers/subhead-links.md %}
#
#{% autocrossref %}
#
#{% assign summary_getAddressUtxos="" %}
#
#
#{% endautocrossref %}