From 64a160198bfb6f9d01ce929721ab645e1fcead55 Mon Sep 17 00:00:00 2001 From: thephez Date: Wed, 11 Oct 2017 14:08:19 -0400 Subject: [PATCH] Add result detail and example to GetBlockTemplate --- .../dash-core/rpcs/rpcs/getblocktemplate.md | 310 ++++++++++++++++++ 1 file changed, 310 insertions(+) diff --git a/_includes/devdoc/dash-core/rpcs/rpcs/getblocktemplate.md b/_includes/devdoc/dash-core/rpcs/rpcs/getblocktemplate.md index 83575a3b..73df5c9d 100644 --- a/_includes/devdoc/dash-core/rpcs/rpcs/getblocktemplate.md +++ b/_includes/devdoc/dash-core/rpcs/rpcs/getblocktemplate.md @@ -18,6 +18,316 @@ information, please see the following resources: * [BIP22][] * [BIP23][] +*Parameters: none* + +*Result---block template* + +{% itemplate ntpd1 %} +- n: "`result`" + t: "object" + p: "Required
(exactly 1)" + d: "A object containing a block template" + +- n: "→
`capabilities`" + t: "array (string)" + p: "Required
(1 or more)" + d: "The client side supported features" + +- n: "→ →
Capability" + t: "string" + p: "Optional
(0 or more)" + d: "A client side supported feature" + +- n: "→
`version`" + t: "number (int)" + p: "Required
(exactly 1)" + d: "The block version" + +- n: "→
`rules`" + t: "array (string)" + p: "Required
(1 or more)" + d: "The specific block rules that are to be enforced" + +- n: "→ →
Block Rule" + t: "string" + p: "Optional
(0 or more)" + d: "A specific block rule to be enforced" + +- n: "→
`vbavailable`" + t: "object" + p: "Required
(exactly 1)" + d: "Contains the set of pending, supported versionbit (BIP 9) softfork deployments" + +- n: "→ →
Bit Number" + t: "number" + p: "Required
(0 or more)" + d: "The bit number the named softfork rule" + +- n: "→
`vbrequired`" + t: "number" + p: "Required
(exactly 1)" + d: "The bit mask of versionbits the server requires set in submissions" + +- n: "→
`previousblockhash`" + t: "string (hex)" + p: "Required
(exactly 1)" + d: "The hash of current highest block" + +- n: "→
`transactions`" + t: "array (objects)" + p: "Optional
(0 or more)" + d: "The contents of non-coinbase transactions that should be included in the next block" + +- n: "→ →
Transaction" + t: "object" + p: "Optional (0 or more)" + d: "Object containing a non-coinbase transaction to include in the next block" + +- n: "→ → →
`data`" + t: "string (hex)" + p: "Optional (0 or more)" + d: "The transaction data encoded in hexadecimal (byte-for-byte)" + +- n: "→ → →
`hash`" + t: "string (hex)" + p: "Optional (0 or more)" + d: "The hash/id encoded in little-endian hexadecimal" + +- n: "→ → →
`depends`" + t: "array (numbers)" + p: "Required
(0 or more)" + d: "An array holding TXIDs of unconfirmed transactions this transaction depends upon (parent transactions)." + +- n: "→ → → →
Transaction number" + t: "number" + p: "Optional
(1 or more)" + d: "The transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is" + +- n: "→ → →
`fee`" + t: "number" + p: "Required
(exactly 1)" + d: "The difference in value between transaction inputs and outputs (in duffs). For coinbase transactions, this is a negative number of the total collected block fees (ie., not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one" + +- n: "→ → →
`sigops`" + t: "number" + p: "Required
(exactly 1)" + d: "The total number of SigOps. If key not present, the count is unknown and clients MUST NOT assume there aren't any" + +- n: "→ → →
`required`" + t: "boolean" + p: "Optional
(exactly 1)" + d: "If provided and true, this transaction must be in the final block" + +- n: "→
`coinbaseaux`" + t: "object" + p: "Required
(exactly 1)" + d: "A object containing data that should be included in the coinbase scriptSig content" + +- n: "→ →
Flags" + t: "string" + p: "Required
(0 or more)" + d: "" + +- n: "→
`coinbasevalue`" + t: "number" + p: "Required
(exactly 1)" + d: "The maximum allowable input to coinbase transaction, including the generation award and transaction fees (in duffs)" + +- n: "→
`coinbasetxn`" + t: "object" + p: "Required
(exactly 1)" + d: "Information for the coinbase transaction)" + +- n: "→
`target`" + t: "string" + p: "Required
(exactly 1)" + d: "The hash target" + +- n: "→
`mintime`" + t: "number" + p: "Required
(exactly 1)" + d: "The minimum timestamp appropriate for next block time in seconds since epoch" + +- n: "→
`mutable`" + t: "array (string)" + p: "Required
(exactly 1)" + d: "The list of ways the block template may be changed" + +- n: "→ →
Value" + t: "string" + p: "Required
(0 or more)" + d: "A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'" + +- n: "→
`noncerange`" + t: "string" + p: "Required
(exactly 1)" + d: "A range of valid nonces" + +- n: "→
`sigoplimit`" + t: "number" + p: "Required
(exactly 1)" + d: "The limit of sigops in blocks" + +- n: "→
`sizelimit`" + t: "number" + p: "Required
(exactly 1)" + d: "The limit of block size" + +- n: "→
`curtime`" + t: "number" + p: "Required
(exactly 1)" + d: "The current timestamp in seconds since epoch" + +- n: "→
`bits`" + t: "string" + p: "Required
(exactly 1)" + d: "The compressed target of next block" + +- n: "→
`height`" + t: "number" + p: "Required
(exactly 1)" + d: "The height of the next block" + +- n: "→
`masternode`" + t: "object" + p: "Required
(exactly 1)" + d: "The masternode payee that must be included in the next block" + +- n: "→ →
`payee`" + t: "string" + p: "Required
(exactly 1)" + d: "Payee address" + +- n: "→ →
`script`" + t: "string" + p: "Required
(exactly 1)" + d: "Payee scriptPubKey" + +- n: "→ →
`amount`" + t: "number" + p: "Required
(exactly 1)" + d: "Required amount to pay" + +- n: "→
`masternode_payments_started`" + t: "boolean" + p: "Required
(exactly 1)" + d: "True if masternode payments started" + +- n: "→
`masternode_payments_enforced`" + t: "boolean" + p: "Required
(exactly 1)" + d: "True if masternode payments enforced" + +- n: "→
`superblock`" + t: "array (objects)" + p: "Required
(0 or more)" + d: "The superblock payees that must be included in the next block" + +- n: "→ →
Superblock Payee" + t: "object" + p: "Optional (0 or more)" + d: "Object containing a superblock payee's information" + +- n: "→ → →
`payee`" + t: "string" + p: "Required
(exactly 1)" + d: "Payee address" + +- n: "→ → →
`script`" + t: "string" + p: "Required
(exactly 1)" + d: "Payee scriptPubKey" + +- n: "→ → →
`amount`" + t: "number" + p: "Required
(exactly 1)" + d: "Required amount to pay" + +- n: "→
`superblocks_started`" + t: "boolean" + p: "Required
(exactly 1)" + d: "True if superblock payments started" + +- n: "→
`superblocks_enabled`" + t: "boolean" + p: "Required
(exactly 1)" + d: "True if superblock payments enabled" + +{% enditemplate %} + +*Example from Dash Core 0.12.2* + +{% highlight bash %} +dash-cli -testnet getblocktemplate +{% endhighlight %} + +Result: + +{% highlight json %} +{ + "capabilities": [ + "proposal" + ], + "version": 536870913, + "rules": [ + "dip0001" + ], + "vbavailable": { + "csv": 0 + }, + "vbrequired": 0, + "previousblockhash": "000000003d5c325259275fbf51a5dd623a13aade887cf83e5fdc3b\ + 11898a71ce", + "transactions": [ + { + "data": "01000000013e9e7e2116d8546a54d8531092d50e2da705a6f229f91a6d129f\ + 3f3e529d2bdb010000006a473044022044569ec727012e06bd4fa853fdcb2d\ + c268f193ca00b68649f3dee0c0ca3207ff02206dc8656025c2f503e58779e6\ + 8a14ed18a7134f2c7d2c4235269bd70a3d6d5bd301210226d4ce54b37c1886\ + 92844201edbfb19e37cdbe7138a133b92b7d3d43ec157da6feffffff02a00b\ + d100000000001976a914d7b47d4b40a23c389f5a17754d7f60f511c7d0ec88\ + ac43321005140000001976a914616fdfd6eae0548f0b0f51bef165974abc10\ + 511688ac1e1f0000", + "hash": "9fd01aafcb4c59741ddfef41da2ec0eb3e1cc5b740150320b29534abdcd67e77", + "depends": [ + ], + "fee": 226, + "sigops": 2 + } + ], + "coinbaseaux": { + "flags": "" + }, + "coinbasevalue": 13230000226, + "longpollid": "000000003d5c325259275fbf51a5dd623a13aade887cf83e5fdc3b11898a\ + 71ce316", + "target": "00000001231e0000000000000000000000000000000000000000000000000000", + "mintime": 1507737402, + "mutable": [ + "time", + "transactions", + "prevblock" + ], + "noncerange": "00000000ffffffff", + "sigoplimit": 40000, + "sizelimit": 2000000, + "curtime": 1507738818, + "bits": "1d01231e", + "height": 7967, + "masternode": { + "payee": "yaJc6tADbEjxQBAC69ugWNoTFpzxqkcgWd", + "script": "76a914996911b133d83de25d1f169c7046d74b728a757b88ac", + "amount": 6615000108 + }, + "masternode_payments_started": true, + "masternode_payments_enforced": true, + "superblock": [ + ], + "superblocks_started": true, + "superblocks_enabled": true +} +{% endhighlight %} + *See also* * [SetGenerate][rpc setgenerate]: {{summary_setGenerate}}