mirror of
https://github.com/seigler/dash-docs
synced 2025-07-28 02:06:13 +00:00
Continue updating existing Block Chain RPCs
- GetTxOut, GetTxOutProof, GetTxOutSetInfo, VerifyChain, VerifyTxOutProof Update previous block hash type to indicate X11 instead of double SHA256
This commit is contained in:
parent
d93da23e46
commit
8a0e561d93
7 changed files with 55 additions and 76 deletions
|
@ -57,12 +57,12 @@ The `getrawmempool` RPC {{summary_getRawMemPool}}
|
|||
d: "The size of the serialized transaction in bytes"
|
||||
|
||||
- n: "→ →<br>`fee`"
|
||||
t: "number (bitcoins)"
|
||||
t: "amount (Dash)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The transaction fee paid by the transaction in decimal Dash"
|
||||
|
||||
- n: "→ →<br>`modifiedfee`"
|
||||
t: "number (bitcoins)"
|
||||
t: "amount (Dash)"
|
||||
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 Dash"
|
||||
|
||||
|
|
|
@ -63,9 +63,9 @@ The `gettxout` RPC {{summary_getTxOut}}
|
|||
d: "The number of confirmations received for the transaction containing this output or `0` if the transaction hasn't been confirmed yet"
|
||||
|
||||
- n: "→<br>`value`"
|
||||
t: "number (bitcoins)"
|
||||
t: "number (Dash)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The amount of bitcoins spent to this output. May be `0`"
|
||||
d: "The amount of Dash spent to this output. May be `0`"
|
||||
|
||||
- n: "→<br>`scriptPubKey`"
|
||||
t: "string : object"
|
||||
|
@ -114,15 +114,15 @@ The `gettxout` RPC {{summary_getTxOut}}
|
|||
|
||||
{% enditemplate %}
|
||||
|
||||
*Example from Bitcoin Core 0.10.0*
|
||||
*Example from Dash Core 0.12.2*
|
||||
|
||||
Get the UTXO from the following transaction from the first output index ("0"),
|
||||
searching the memory pool if necessary.
|
||||
|
||||
|
||||
{% highlight bash %}
|
||||
bitcoin-cli -testnet gettxout \
|
||||
d77aee99e8bdc11f40b8a9354956f0346fec5535b82c77c8b5c06047e3bca86a \
|
||||
dash-cli -testnet gettxout \
|
||||
e0a06b47f0de6f3851a228d5ac377ac38b495adf04298c43e951e679c5b0aa8f \
|
||||
0 true
|
||||
{% endhighlight %}
|
||||
|
||||
|
@ -130,20 +130,20 @@ Result:
|
|||
|
||||
{% highlight json %}
|
||||
{
|
||||
"bestblock" : "00000000c92356f7030b1deeab54b3b02885711320b4c48523be9daa3e0ace5d",
|
||||
"confirmations" : 0,
|
||||
"value" : 0.00100000,
|
||||
"scriptPubKey" : {
|
||||
"asm" : "OP_DUP OP_HASH160 a11418d3c144876258ba02909514d90e71ad8443 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
"hex" : "76a914a11418d3c144876258ba02909514d90e71ad844388ac",
|
||||
"reqSigs" : 1,
|
||||
"type" : "pubkeyhash",
|
||||
"addresses" : [
|
||||
"mvCfAJSKaoFXoJEvv8ssW7wxaqRPphQuSv"
|
||||
]
|
||||
},
|
||||
"version" : 1,
|
||||
"coinbase" : false
|
||||
"bestblock": "000000005651f6d7859793dee07d476a2f2a7338e66bbb41caf4b544c5b0318d",
|
||||
"confirmations": 2,
|
||||
"value": 25.00000000,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 b66266c5017a759817f3bb99e8d9124bf5bb2e74 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
"hex": "76a914b66266c5017a759817f3bb99e8d9124bf5bb2e7488ac",
|
||||
"reqSigs": 1,
|
||||
"type": "pubkeyhash",
|
||||
"addresses": [
|
||||
"ycwoiAibTjpwnoCZSX7S4kiB2H8wULw9qo"
|
||||
]
|
||||
},
|
||||
"version": 1,
|
||||
"coinbase": false
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
|
|
|
@ -53,38 +53,28 @@ specify the block in which the transaction is included in manually (by block hea
|
|||
|
||||
{% enditemplate %}
|
||||
|
||||
*Example from Bitcoin Core 0.11.0*
|
||||
*Example from Dash Core 0.12.2*
|
||||
|
||||
Get the hex-encoded proof that "txid" was included in block 0000000000000000140e84bf183d8d5207d65fbfae596bdf48f684d13d951847:
|
||||
Get the hex-encoded proof that "txid" was included in block 000000012d774f3c7668f32bc448efeb93b317f312dd863679de3a007d47817f:
|
||||
|
||||
{% highlight bash %}
|
||||
bitcoin-cli gettxoutproof \
|
||||
dash-cli gettxoutproof \
|
||||
'''
|
||||
[
|
||||
"f20e44c818ec332d95119507fbe36f1b8b735e2c387db62adbe28e50f7904683"
|
||||
"e0a06b47f0de6f3851a228d5ac377ac38b495adf04298c43e951e679c5b0aa8f"
|
||||
]
|
||||
''' \
|
||||
'0000000000000000140e84bf183d8d5207d65fbfae596bdf48f684d13d951847'
|
||||
'000000012d774f3c7668f32bc448efeb93b317f312dd863679de3a007d47817f'
|
||||
{% endhighlight %}
|
||||
|
||||
Result (wrapped):
|
||||
|
||||
{% highlight text %}
|
||||
03000000394ab3f08f712aa0f1d26c5daa4040b50e96d31d4e8e3c130000000000000000\
|
||||
ca89aaa0bbbfcd5d1210c7888501431256135736817100d8c2cf7e4ab9c02b168115d455\
|
||||
04dd1418836b20a6cb0800000d3a61beb3859abf1b773d54796c83b0b937968cc4ce3c0f\
|
||||
71f981b2407a3241cb8908f2a88ac90a2844596e6019450f507e7efb8542cbe54ea55634\
|
||||
c87bee474ee48aced68179564290d476e16cff01b483edcd2004d555c617dfc08200c083\
|
||||
08ba511250e459b49d6a465e1ab1d5d8005e0778359c2993236c85ec66bac4bfd974131a\
|
||||
dc1ee0ad8b645f459164eb38325ac88f98c9607752bc1b637e16814f0d9d8c2775ac3f20\
|
||||
f85260947929ceef16ead56fcbfd77d9dc6126cce1b5aacd9f834690f7508ee2db2ab67d\
|
||||
382c5e738b1b6fe3fb079511952d33ec18c8440ef291eb8d3546a971ee4aa5e574b7be7f\
|
||||
5aff0b1c989b2059ae5a611c8ce5c58e8e8476246c5e7c6b70e0065f2a6654e2e6cf4efb\
|
||||
6ae19bf2548a7d9febf5b0aceaff28610922e1b9e23e52f650a4a11d2986c9c2b09bb168\
|
||||
a70a7d4ac16e4d389bc2868ee91da1837d2cd79288bdc680e9c35ebb3ddfd045d69d767b\
|
||||
164ec69d5db9f995c045d10af5bd90cd9d1116c3732e14796ef9d1a57fa7bb718c07989e\
|
||||
d06ff359bf2009eaf1b9e000c054b87230567991b447757bc6ca8e1bb6e9816ad604dbd6\
|
||||
0600
|
||||
01000020ed72cc6a7294782a7711d8fa7ef74716ef062dc50bb0820f7eec923801000000\
|
||||
aa5d17c5128043803b67c7ab03e4d3ffbc9604b54f877f1c5cf9ed3adeaa19b2cd7ed659\
|
||||
f838011d10a70a480200000002033c89c2baecba9fc983c85dcf365c2d9cc93aca1dee2e\
|
||||
5ac18124464056542e8faab0c579e651e9438c2904df5a498bc37a37acd528a251386fde\
|
||||
f0476ba0e00105
|
||||
{% endhighlight %}
|
||||
|
||||
*See also*
|
||||
|
|
|
@ -54,29 +54,29 @@ The `gettxoutsetinfo` RPC {{summary_getTxOutSetInfo}}
|
|||
d: "A SHA256(SHA256()) hash of the serialized UTXO set; useful for comparing two nodes to see if they have the same set (they should, if they always used the same serialization format and currently have the same best block). The hash is encoded as hex in RPC byte order"
|
||||
|
||||
- n: "→<br>`total_amount`"
|
||||
t: "number (bitcoins)"
|
||||
t: "number (Dash)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The total number of bitcoins in the UTXO set"
|
||||
d: "The total amount of Dash in the UTXO set"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Example from Bitcoin Core 0.10.0*
|
||||
*Example from Dash Core 0.12.2*
|
||||
|
||||
{% highlight bash %}
|
||||
bitcoin-cli -testnet gettxoutsetinfo
|
||||
dash-cli -testnet gettxoutsetinfo
|
||||
{% endhighlight %}
|
||||
|
||||
Result:
|
||||
|
||||
{% highlight json %}
|
||||
{
|
||||
"height" : 315293,
|
||||
"bestblock" : "00000000c92356f7030b1deeab54b3b02885711320b4c48523be9daa3e0ace5d",
|
||||
"transactions" : 771920,
|
||||
"txouts" : 2734587,
|
||||
"bytes_serialized" : 102629817,
|
||||
"hash_serialized" : "4753470fda0145760109e79b8c218a1331e84bb4269d116857b8a4597f109905",
|
||||
"total_amount" : 13131746.33839451
|
||||
"height": 4755,
|
||||
"bestblock": "0000000025da0abc9e9937f1c65b3f544a57bb7e8817422f7ff2a89ff32696f4",
|
||||
"transactions": 4748,
|
||||
"txouts": 10602,
|
||||
"bytes_serialized": 463925,
|
||||
"hash_serialized": "fce0776d7961b409c4d8a46363c8d049879321861f7f40db97b0432e59532320",
|
||||
"total_amount": 2243585.70000000
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
|
|
|
@ -43,16 +43,15 @@ The `verifychain` RPC {{summary_verifyChain}}
|
|||
|
||||
{% enditemplate %}
|
||||
|
||||
*Example from Bitcoin Core 0.10.0*
|
||||
*Example from Dash Core 0.12.2*
|
||||
|
||||
Verify the most recent 10,000 blocks in the most through way:
|
||||
Verify the most recent 400 blocks in the most through way:
|
||||
|
||||
{% highlight bash %}
|
||||
bitcoin-cli -testnet verifychain 4 10000
|
||||
dash-cli -testnet verifychain 4 400
|
||||
{% endhighlight %}
|
||||
|
||||
Result (took 4 minutes and 25 seconds on a generic PC laptop; it
|
||||
would've taken much longer on mainnet):
|
||||
Result (took < 1 second on a mobile workstation; it would've taken much longer on mainnet):
|
||||
|
||||
{% highlight json %}
|
||||
true
|
||||
|
|
|
@ -33,34 +33,24 @@ The `verifytxoutproof` RPC {{summary_verifyTxOutProof}}
|
|||
|
||||
{% enditemplate %}
|
||||
|
||||
*Example from Bitcoin Core 0.11.0*
|
||||
*Example from Dash Core 0.12.2*
|
||||
|
||||
Verify a proof:
|
||||
|
||||
{% highlight bash %}
|
||||
bitcoin-cli verifytxoutproof \
|
||||
03000000394ab3f08f712aa0f1d26c5daa4040b50e96d31d4e8e3c130000000000000000\
|
||||
ca89aaa0bbbfcd5d1210c7888501431256135736817100d8c2cf7e4ab9c02b168115d455\
|
||||
04dd1418836b20a6cb0800000d3a61beb3859abf1b773d54796c83b0b937968cc4ce3c0f\
|
||||
71f981b2407a3241cb8908f2a88ac90a2844596e6019450f507e7efb8542cbe54ea55634\
|
||||
c87bee474ee48aced68179564290d476e16cff01b483edcd2004d555c617dfc08200c083\
|
||||
08ba511250e459b49d6a465e1ab1d5d8005e0778359c2993236c85ec66bac4bfd974131a\
|
||||
dc1ee0ad8b645f459164eb38325ac88f98c9607752bc1b637e16814f0d9d8c2775ac3f20\
|
||||
f85260947929ceef16ead56fcbfd77d9dc6126cce1b5aacd9f834690f7508ee2db2ab67d\
|
||||
382c5e738b1b6fe3fb079511952d33ec18c8440ef291eb8d3546a971ee4aa5e574b7be7f\
|
||||
5aff0b1c989b2059ae5a611c8ce5c58e8e8476246c5e7c6b70e0065f2a6654e2e6cf4efb\
|
||||
6ae19bf2548a7d9febf5b0aceaff28610922e1b9e23e52f650a4a11d2986c9c2b09bb168\
|
||||
a70a7d4ac16e4d389bc2868ee91da1837d2cd79288bdc680e9c35ebb3ddfd045d69d767b\
|
||||
164ec69d5db9f995c045d10af5bd90cd9d1116c3732e14796ef9d1a57fa7bb718c07989e\
|
||||
d06ff359bf2009eaf1b9e000c054b87230567991b447757bc6ca8e1bb6e9816ad604dbd6\
|
||||
0600
|
||||
dash-cli verifytxoutproof \
|
||||
01000020ed72cc6a7294782a7711d8fa7ef74716ef062dc50bb0820f7eec923801000000\
|
||||
aa5d17c5128043803b67c7ab03e4d3ffbc9604b54f877f1c5cf9ed3adeaa19b2cd7ed659\
|
||||
f838011d10a70a480200000002033c89c2baecba9fc983c85dcf365c2d9cc93aca1dee2e\
|
||||
5ac18124464056542e8faab0c579e651e9438c2904df5a498bc37a37acd528a251386fde\
|
||||
f0476ba0e00105
|
||||
{% endhighlight %}
|
||||
|
||||
Result:
|
||||
|
||||
{% highlight json %}
|
||||
[
|
||||
"f20e44c818ec332d95119507fbe36f1b8b735e2c387db62adbe28e50f7904683"
|
||||
"e0a06b47f0de6f3851a228d5ac377ac38b495adf04298c43e951e679c5b0aa8f"
|
||||
]
|
||||
{% endhighlight %}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue