Skip to content

docs: create entry for getstakeversions in rpcapi #819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 31, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion docs/json_rpc_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ The following is an overview of the RPC methods which are implemented by dcrd, b
|4|[searchrawtransactions](#searchrawtransactions)|Y|Query for transactions related to a particular address.|None|
|5|[node](#node)|N|Attempts to add or remove a peer. |None|
|6|[generate](#generate)|N|When in simnet or regtest mode, generate a set number of blocks. |None|
|7|[getstakeversions](#getstakeversions)|Y|Get stake versions per block. |None|


<a name="ExtMethodDetails" />
Expand Down Expand Up @@ -645,7 +646,7 @@ The following is an overview of the RPC methods which are implemented by dcrd, b
|Parameters|1. address (string, required) - decred address <br /> 2. verbose (int, optional, default=true) - specifies the transaction is returned as a JSON object instead of hex-encoded string <br />3. skip (int, optional, default=0) - the number of leading transactions to leave out of the final response <br /> 4. count (int, optional, default=100) - the maximum number of transactions to return <br /> 5. (vinextra int, optional, default=0) - Specify that extra data from previous output will be returned in vin|
|Description|Returns raw data for transactions involving the passed address. Returned transactions are pulled from both the database, and transactions currently in the mempool. Transactions pulled from the mempool will have the `"confirmations"` field set to 0. Usage of this RPC requires the optional `--addrindex` flag to be activated, otherwise all responses will simply return with an error stating the address index has not yet been built up. Similarly, until the address index has caught up with the current best height, all requests will return an error response in order to avoid serving stale data.|
|Returns (verbose=0)|`(json array of strings)`<br />`serializedtx`: hex-encoded bytes of the serialized transaction<br />`["serializedtx", ... ]` |
|Returns (verbose=1)|`(array of json objects)`<br/>`hex`: (string) hex-encoded transaction<br />`txid`: (string) the hash of the transaction<br />`version`: (numeric) the transaction version<br />`locktime`: (numeric) the transaction lock time<br />`vin`: the transaction inputs as json objects<br />`coinbase`: (string) the hex-encoded bytes of the signature script<br />`sequence`: (numeric) the script sequence number<br />`txid`: (string) the hash of the origin transaction<br />`vout`: (numeric) the index of the output being redeemed from the origin transaction<br />`scriptSig`: the signature script used to redeem the origin transaction<br />`asm`: (string) disassembly of the script<br />`hex`: (string) hex-encoded bytes of the script<br />`prevOut`: Data from the origin transaction output with index vout.<br />`addresses`: (array of string) previous output addresses<br />`value`: (numeric) previous output value<br />`sequence`: (numeric) the script sequence number<br />`vout`: (array of json objects) the transaction outputs as json objects<br />`value`: (numeric) the value in BTC<br />`n`: (numeric) the index of this transaction output<br />`scriptPubKey`: (json object) the public key script used to pay coins<br />`asm`: (string) disassembly of the script<br />`hex`: (string) hex-encoded bytes of the script<br />`reqSigs`: (numeric) the number of required signatures<br />`type`: (string) the type of the script (e.g. 'pubkeyhash')<br />`addresses`: (json array of string) the decred addresses associated with this output <br />`address`, (string) the decred address<br />`blockhash`: Hash of the block the transaction is part of.<br />`confirmations`: Number of numeric confirmations of block.<br /> `time`: Transaction time in seconds since the epoch.<br />`blocktime`: Block time in seconds since the epoch.<br/><br /><font color="orange">For coinbase transactions:</font><br /><br />`[{"hex": "data", "txid": "hash", "version": n, "locktime": n,"vin": [{"coinbase": "data", "sequence": n},{"txid": "hash", "vout": n, "scriptSig": {"asm": "asm", "hex": "data"}, "prevOut": {"addresses": ["value", ...], "value": n.nnn}, "sequence": n}, ...],"vout": [{ "value": n,"n": n, "scriptPubKey": {"asm": "asm", "hex": "data", "reqSigs": n, "type": "scripttype", "addresses": ["address", ...]}}, ...], "blockhash":"hash", "confirmations":n, "time":t, "blocktime":t },...]`<br /><br /><font color="orange">For non-coinbase transactions:</font><br /><br />`[{"hex": "data", "txid": "hash", "version": n, "locktime": n,"vin": [{"txid": "hash", "vout": n, "scriptSig": {"asm": "asm", "hex": "data"}, "prevOut": {"addresses": ["value",...], "value": n.nnn}, "sequence": n}, ...],"vout": [{ "value": n,"n": n, "scriptPubKey": {"asm": "asm", "hex": "data", "reqSigs": n, "type": "scripttype", "addresses": ["address", ...]}}, ...], "blockhash":"hash", "confirmations":n, "time":t, "blocktime":t },...]`|
|Returns (verbose=1)|`(array of json objects)`<br/>`hex`: (string) hex-encoded transaction<br />`txid`: (string) the hash of the transaction<br />`version`: (numeric) the transaction version<br />`locktime`: (numeric) the transaction lock time<br />`vin`: the transaction inputs as json objects<br />`coinbase`: (string) the hex-encoded bytes of the signature script<br />`sequence`: (numeric) the script sequence number<br />`txid`: (string) the hash of the origin transaction<br />`vout`: (numeric) the index of the output being redeemed from the origin transaction<br />`scriptSig`: the signature script used to redeem the origin transaction<br />`asm`: (string) disassembly of the script<br />`hex`: (string) hex-encoded bytes of the script<br />`prevOut`: Data from the origin transaction output with index vout.<br />`addresses`: (array of string) previous output addresses<br />`value`: (numeric) previous output value<br />`sequence`: (numeric) the script sequence number<br />`vout`: (array of json objects) the transaction outputs as json objects<br />`value`: (numeric) the value in BTC<br />`n`: (numeric) the index of this transaction output<br />`scriptPubKey`: (json object) the public key script used to pay coins<br />`asm`: (string) disassembly of the script<br />`hex`: (string) hex-encoded bytes of the script<br />`reqSigs`: (numeric) the number of required signatures<br />`type`: (string) the type of the script (e.g. 'pubkeyhash')<br />`addresses`: (json array of string) the decred addresses associated with this output <br />`address`: (string) the decred address<br />`blockhash`: Hash of the block the transaction is part of.<br />`confirmations`: Number of numeric confirmations of block.<br /> `time`: Transaction time in seconds since the epoch.<br />`blocktime`: Block time in seconds since the epoch.<br/><br /><font color="orange">For coinbase transactions:</font><br /><br />`[{"hex": "data", "txid": "hash", "version": n, "locktime": n,"vin": [{"coinbase": "data", "sequence": n},{"txid": "hash", "vout": n, "scriptSig": {"asm": "asm", "hex": "data"}, "prevOut": {"addresses": ["value", ...], "value": n.nnn}, "sequence": n}, ...],"vout": [{ "value": n,"n": n, "scriptPubKey": {"asm": "asm", "hex": "data", "reqSigs": n, "type": "scripttype", "addresses": ["address", ...]}}, ...], "blockhash":"hash", "confirmations":n, "time":t, "blocktime":t },...]`<br /><br /><font color="orange">For non-coinbase transactions:</font><br /><br />`[{"hex": "data", "txid": "hash", "version": n, "locktime": n,"vin": [{"txid": "hash", "vout": n, "scriptSig": {"asm": "asm", "hex": "data"}, "prevOut": {"addresses": ["value",...], "value": n.nnn}, "sequence": n}, ...],"vout": [{ "value": n,"n": n, "scriptPubKey": {"asm": "asm", "hex": "data", "reqSigs": n, "type": "scripttype", "addresses": ["address", ...]}}, ...], "blockhash":"hash", "confirmations":n, "time":t, "blocktime":t },...]`|
[Return to Overview](#ExtMethodOverview)<br />

***
Expand All @@ -672,6 +673,16 @@ The following is an overview of the RPC methods which are implemented by dcrd, b
|Returns|`(json array of strings)`<br/> `blockhash`: hash of the generated block <br/>`["blockhash", ...]` |
[Return to Overview](#MethodOverview)<br />

<a name="getstakeversions"/>

| | |
|---|---|
|Method|getstakeversions|
|Parameters|1. `hash`: (string, required) The start block hash. <br /> 2. `count`: (numeric, required) The number of blocks that will be returned. |
|Description| Returns the stake versions statistics. |
|Returns|`stakeversions`: (array of object) Array of stake versions per block. <br /> `hash`: (string) Hash of the block. <br /> `height`: (numeric) Height of the block. <br /> `blockversion`: (numeric) The block version. <br /> `stakeversion`: (numeric) The stake version of the block. <br /> `votes`: (array of object) The version and bits of each vote in the block. <br /> `version`: (numeric) The version of the vote. <br /> `bits`: (numeric) The bits assigned by the vote. <br /><br /> `{"stakeversions": [{ "hash": "value", "height": n, "blockversion": n, "stakeversion": n,"votes": [{ "version": n, "bits": n },...]},...]}` |
[Return to Overview](#MethodOverview)<br />

***

<a name="WSExtMethods" />
Expand Down