Dash RPC (Gobject)

- Add details for count and get sub-commands

Also added description for govobj types
This commit is contained in:
thephez 2017-10-19 15:36:25 -04:00
parent 0326f13f9b
commit 9e6395fd3d
3 changed files with 302 additions and 9 deletions

View file

@ -7,12 +7,299 @@ http://opensource.org/licenses/MIT.
##### GObject
{% include helpers/subhead-links.md %}
{% assign summary_gObject="" %}
{% assign summary_gObject="provides a set of commands for managing governance objects and displaying information about them." %}
{% autocrossref %}
The `gobject` RPC {{summary_gObject}}
###### GObject Check
###### GObject Prepare
###### GObject Submit
###### GObject Deserialize
###### GObject Count
The `gobject count` RPC returns the count of governance objects and votes.
*Parameters: none*
*Result---count of governance objects and votes*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The count of governance objects and votes"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet gobject count
{% endhighlight %}
Result (wrapped):
{% highlight text %}
Governance Objects: 177 (Proposals: 177, Triggers: 0, Watchdogs: 0/0, \
Other: 0; Erased: 5), Votes: 9680
{% endhighlight %}
###### GObject Get
The `gobject get` RPC returns a governance object by hash.
*Parameter #1---object hash*
{% itemplate ntpd1 %}
- n: "`governance-hash`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The hash of a governance object"
{% enditemplate %}
*Result---governance object details*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Information about the governance object"
- n: "→<br>`DataHex`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "Governance object info as hex string"
- n: "→<br>`DataString`"
t: "string"
p: "Required<br>(exactly 1)"
d: "Governance object info as string"
- n: "→<br>`Hash`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "Hash of this governance object"
- n: "→<br>`CollateralHash`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "Hash of the collateral payment transaction"
- n: "→<br>`ObjectType`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Object types:<br>`1` - Unknown<br>`2` - Proposal<br>`3` - Trigger<br>`4` - Watchdog"
- n: "→<br>`CreationTime`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Object creation time as Unix epoch time"
- n: "→<br>`FundingResult`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Funding vote details"
- n: "→ →<br>`AbsoluteYesCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Yes` votes minus number of `No` votes"
- n: "→ →<br>`YesCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Yes` votes"
- n: "→ →<br>`NoCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `No` votes"
- n: "→ →<br>`AbstainCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Abstain` votes"
- n: "→<br>`ValidResult`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Object validity vote details"
- n: "→ →<br>`AbsoluteYesCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Yes` votes minus number of `No` votes"
- n: "→ →<br>`YesCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Yes` votes"
- n: "→ →<br>`NoCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `No` votes"
- n: "→ →<br>`AbstainCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Abstain` votes"
- n: "→<br>`DeleteResult`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Delete vote details"
- n: "→ →<br>`AbsoluteYesCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Yes` votes minus number of `No` votes"
- n: "→ →<br>`YesCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Yes` votes"
- n: "→ →<br>`NoCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `No` votes"
- n: "→ →<br>`AbstainCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Abstain` votes"
- n: "→<br>`EndorsedResult`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Endorsed vote details"
- n: "→ →<br>`AbsoluteYesCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Yes` votes minus number of `No` votes"
- n: "→ →<br>`YesCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Yes` votes"
- n: "→ →<br>`NoCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `No` votes"
- n: "→ →<br>`AbstainCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Abstain` votes"
- n: "→<br>`fLocalValidity`"
t: "boolean"
p: "Required<br>(exactly 1)"
d: "Valid by the blockchain"
- n: "→<br>`IsValidReason`"
t: "string"
p: "Required<br>(exactly 1)"
d: "`fLocalValidity` error result. Empty if no error returned."
- n: "→<br>`fCachedValid`"
t: "boolean"
p: "Required<br>(exactly 1)"
d: "Minimum network support has been reached flagging this object as a valid and understood governance object (e.g, the serialized data is correct format, etc)"
- n: "→<br>`fCachedFunding`"
t: "boolean"
p: "Required<br>(exactly 1)"
d: "Minimum network support has been reached for this object to be funded (doesn't mean it will be for sure though)"
- n: "→<br>`fCachedDelete`"
t: "boolean"
p: "Required<br>(exactly 1)"
d: "Minimum network support has been reached saying this object should be deleted from the system entirely"
- n: "→<br>`fCachedEndorsed`"
t: "boolean"
p: "Required<br>(exactly 1)"
d: "Minimum network support has been reached flagging this object as endorsed"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet gobject get \
42253a7bec554b97a65d2889e6cb9a1cf308b3d47a778c704bf9cdc1fe1bf6ff
{% endhighlight %}
Result (wrapped):
{% highlight json %}
{
"DataHex": "5b5b2270726f706f73616c222c7b22656e645f65706f6368223a2231353037343339353130222c226e616d65223a227465737470726f706f73616c5f2d5f6162636465666768696a6b6c6d6e6f707172737475767778797a3031323334353637383931353037323530343338222c227061796d656e745f61646472657373223a22795668577955345933756456784d5234464b3333556741534a41436831436835516a222c227061796d656e745f616d6f756e74223a2232222c2273746172745f65706f6368223a2231353037323530343338222c2274797065223a312c2275726c223a2268747470733a2f2f7777772e6461736863656e7472616c2e6f72672f702f746573745f70726f706f73616c5f31353037323530343338227d5d5d",
"DataString": "[[\"proposal\",{\"end_epoch\":\"1507439510\",\"name\":\"testproposal_-_abcdefghijklmnopqrstuvwxyz01234567891507250438\",\"payment_address\":\"yVhWyU4Y3udVxMR4FK33UgASJACh1Ch5Qj\",\"payment_amount\":\"2\",\"start_epoch\":\"1507250438\",\"type\":1,\"url\":\"https://www.dashcentral.org/p/test_proposal_1507250438\"}]]",
"Hash": "42253a7bec554b97a65d2889e6cb9a1cf308b3d47a778c704bf9cdc1fe1bf6ff",
"CollateralHash": "cb09bd0310c0a67cde9387ad4d8908a7ad9f5d89c5afd58e9332b8bd26a646c7",
"ObjectType": 1,
"CreationTime": 1507246694,
"FundingResult": {
"AbsoluteYesCount": 0,
"YesCount": 0,
"NoCount": 0,
"AbstainCount": 0
},
"ValidResult": {
"AbsoluteYesCount": 0,
"YesCount": 0,
"NoCount": 0,
"AbstainCount": 0
},
"DeleteResult": {
"AbsoluteYesCount": 31,
"YesCount": 31,
"NoCount": 0,
"AbstainCount": 0
},
"EndorsedResult": {
"AbsoluteYesCount": 0,
"YesCount": 0,
"NoCount": 0,
"AbstainCount": 0
},
"fLocalValidity": true,
"IsValidReason": "",
"fCachedValid": true,
"fCachedFunding": false,
"fCachedDelete": false,
"fCachedEndorsed": false
}
{% endhighlight %}
###### GObject Getvotes
###### GObject Getcurrentvotes
###### GObject List
###### GObject Diff
###### GObject Vote-alias
###### GObject Vote-conf
###### GObject Vote-many
{% highlight bash %}
dash-cli -testnet gobject
{% endhighlight %}

View file

@ -2283,12 +2283,12 @@ contract, or setting. Masternodes ignore this request if they are not fully sync
Governance Object Types (defined by src/governance-object.h)
| Object Type | Description
|------|--------------
| 0 | GOVERNANCE_OBJECT_UNKNOWN
| 1 | GOVERNANCE_OBJECT_PROPOSAL
| 2 | GOVERNANCE_OBJECT_TRIGGER
| 3 | GOVERNANCE_OBJECT_WATCHDOG
| Type | Name | Description
|------|-------------------------|------------
| 0 | GOVERNANCE_OBJECT_UNKNOWN |
| 1 | GOVERNANCE_OBJECT_PROPOSAL | Submitted proposal (requires collateral transaction - currently 5 Dash)
| 2 | GOVERNANCE_OBJECT_TRIGGER | Masternode generated. Removed after activation/execution. Used for superblocks.
| 3 | GOVERNANCE_OBJECT_WATCHDOG | Masternode generated. Two hour expiration time.
The following annotated hexdump shows a `govobj` message. (The
message header has been omitted.)

View file

@ -3,7 +3,7 @@ This file is licensed under the terms of its source texts{%endcomment%}
{% assign summary_abandonTransaction="marks an in-wallet transaction and all its in-wallet descendants as abandoned. This allows their inputs to be respent." %}
{% assign summary_addMultiSigAddress="adds a P2SH multisig address to the wallet." %}
{% assign summary_addNode="attempts to add or remove a node from the addnode list, or to try a connection to a node once." %}
{% assign summary_addWitnessAddress="adds a witness address for a script (with pubkey or redeemscript known)." %}
{% assign summary_addWitnessAddress="adds a witness address for a script (with pubkey or redeem script known)." %}
{% assign summary_backupWallet="safely copies `wallet.dat`<!--noref--> to the specified file, which can be a directory or a path with filename." %}
{% assign summary_bumpFee="replaces an unconfirmed wallet transaction that signaled RBF with a new transaction that pays a higher fee." %}
{% assign summary_clearBanned="clears list of banned nodes." %}
@ -17,8 +17,10 @@ This file is licensed under the terms of its source texts{%endcomment%}
{% assign summary_dumpWallet="creates or overwrites a file with all wallet keys in a human-readable format." %}
{% assign summary_encryptWallet="encrypts the wallet with a passphrase. This is only to enable encryption for the first time. After encryption is enabled, you will need to enter the passphrase to use private keys." %}
{% assign summary_estimateFee="estimates the transaction fee per kilobyte that needs to be paid for a transaction to be included within a certain number of blocks." %}
{% assign summary_estimatePriority="estimates the priority that a transaction needs in order to be included within a certain number of blocks as a free high-priority transaction." %}
{% assign summary_estimatePriority="estimates the priority (coin age) that a transaction needs in order to be included within a certain number of blocks as a free high-priority transaction." %}
{% assign summary_fundRawTransaction="adds inputs to a transaction until it has enough in value to meet its out value." %}
{% assign summary_gObject="provides a set of commands for managing governance objects and displaying information about them." %}
{% assign summary_gObjectCheck="." %}
{% assign summary_generate="mines blocks immediately (before the RPC call returns)." %}
{% assign summary_generateToAddress="mines blocks immediately to a specified address." %}
{% assign summary_getAccount="returns the name of the account associated with the given address." %}
@ -90,6 +92,8 @@ This file is licensed under the terms of its source texts{%endcomment%}
{% assign summary_listTransactions="returns the most recent transactions that affect the wallet." %}
{% assign summary_listUnspent="returns an array of unspent transaction outputs belonging to this wallet." %}
{% assign summary_lockUnspent="temporarily locks or unlocks specified transaction outputs. A locked transaction output will not be chosen by automatic coin selection when spending bitcoins. Locks are stored in memory only, so nodes start with zero locked outputs and the locked output list is always cleared when a node stops or fails." %}
{% assign summary_masternode="" %}
{% assign summary_masternodeBroadcast="" %}
{% assign summary_masternodeList="returns a list of masternodes in different modes." %}
{% assign summary_mnSync="returns the sync status, updates to the next step or resets it entirely." %}
{% assign summary_move="moves a specified amount from one account in your wallet to another using an off-block-chain transaction." %}
@ -119,12 +123,14 @@ This file is licensed under the terms of its source texts{%endcomment%}
{% assign summary_signMessage="signs a message with the private key of an address." %}
{% assign summary_signMessageWithPrivKey="signs a message with a given private key." %}
{% assign summary_signRawTransaction="signs a transaction in the serialized transaction format using private keys stored in the wallet or provided in the call." %}
{% assign summary_spork-rpc="" %}
{% assign summary_stop="safely shuts down the Dash Core server." %}
{% assign summary_submitBlock="accepts a block, verifies it is a valid addition to the block chain, and broadcasts it to the network. Extra parameters are ignored by Dash Core but may be used by mining pools or other programs." %}
{% assign summary_validateAddress="returns information about the given Bitcoin address." %}
{% assign summary_verifyChain="verifies each entry in the local block chain database." %}
{% assign summary_verifyMessage="verifies a signed message." %}
{% assign summary_verifyTxOutProof="verifies that a proof points to one or more transactions in a block, returning the transactions the proof commits to and throwing an RPC error if the block is not in our best block chain." %}
{% assign summary_voteRaw="" %}
{% assign summary_walletLock="removes the wallet encryption key from memory, locking the wallet. After calling this method, you will need to call `walletpassphrase` again before being able to call any methods which require the wallet to be unlocked." %}
{% assign summary_walletPassphrase="stores the wallet decryption key in memory for the indicated number of seconds. Issuing the `walletpassphrase` command while the wallet is already unlocked will set a new unlock time that overrides the old one." %}
{% assign summary_walletPassphraseChange="changes the wallet passphrase from 'old passphrase' to 'new passphrase'." %}