CLI Commands for Witnesses
CLI commands that witnesses use.
Creates a witness object owned by the given account. An account can have at most one witness object.
return type, namespace, & method
signed_transaction graphene::wallet::wallet_api::create_witness(
string owner_account,
string url,
bool broadcast);
Function Call
Return
Parameters
name | data type | description | details |
owner_account | string | The name or id of the account which is creating the witness. | no quotes required. |
url | string | a URL to include in the witness record in the blockchain. Clients may display this when showing a list of witnesses. | May be blank. |
broadcast | bool | true to broadcast the transaction on the network. | n/a |
Example Call
create_witness myaccountname1 "www.my-awesome-witness.com" true
Return Format
{
"ref_block_num": number,
"ref_block_prefix": number,
"expiration": "datetime",
"operations": [],
"extensions": [],
"signatures": []
}
Update a witness object owned by the given account.
return type, namespace, & method
signed_transaction graphene::wallet::wallet_api::update_witness(
string witness_name,
string url,
string block_signing_key,
bool broadcast);
Function Call
Return
Parameters
name | data type | description | details |
witness_name | string | The name of the witness's owner account. Also accepts the ID of the owner account or the ID of the witness. | no quotes required. |
url | string | Same as for create_witness. An empty string makes it remain the same. | n/a |
block_signing_key | string | The new block signing public key. The empty string makes it remain the same. | n/a |
broadcast | bool | true to broadcast the transaction on the network. | n/a |
Example Call
update_witness myaccountname-witness "www.my-awesome-witness.com" PPY62L3VYXS8XqorUe2kn63j4TAQpX4YkMJkfFfmmD1nd8Qjo4Bxz true
Return Format
{
"ref_block_num": number,
"ref_block_prefix": number,
"expiration": "datetime",
"operations": [],
"extensions": [],
"signatures": []
}
Example Successful Return
update_witness myaccountname-witness "www.my-awesome-witness.com" PPY62L3VYXS8XqorUe2kn63j4TAQpX4YkMJkfFfmmD1nd8Qjo4Bxz true
{
"ref_block_num": 10412,
"ref_block_prefix": 1003801100,
"expiration": "2015-02-05T00:11:00",
"operations": [[
21,{
"fee": {
"amount": 50000,
"asset_id": "1.3.0"
},
"witness": "1.6.99",
"witness_account": "1.2.1234",
"new_signing_key": "PPY62L3VYXS8XqorUe2kn63j4TAQpX4YkMJkfFfmmD1nd8Qjo4Bxz",
"new_initial_secret": "5n00bd4aus04a9057c09b19b05f723f2e23deb32"
}
]
],
"extensions": [],
"signatures": [
"268bd8....."
]
}
Returns information about the given witness.
return type, namespace, & method
witness_object graphene::wallet::wallet_api::get_witness(
string owner_account);
Function Call
Return
Parameters
name | data type | description | details |
owner_account | string | The name or id of the witness account owner, or the id of the witness. | No quotes required. |
Example Call
get_witness 1.6.99
Return Format
{
"id": "string",
"witness_account": "string",
"last_aslot": number,
"signing_key": "string",
"next_secret_hash": "string",
"previous_secret": "string",
"vote_id": "string",
"total_votes": number,
"url": "string",
"total_missed": number,
"last_confirmed_block_num": number
}
Example Successful Return
get_witness 1.6.99
{
"id": "1.6.99",
"witness_account": "1.2.1234",
"last_aslot": 0,
"signing_key": "PPY62L3VYX...",
"next_secret_hash": "7197f...",
"previous_secret": "0000000000000000000000000000000000000000",
"vote_id": "1:99",
"total_votes": 0,
"url": "www.my-awesome-witness.com",
"total_missed": 0,
"last_confirmed_block_num": 0
}
Vote for a given witness. An account can publish a list of all witnesses they approve of. This command allows you to add or remove witnesses from this list. Each account's vote is weighted according to the number of PPY owned by that account at the time the votes are tallied. Note that you can't vote against a witness, you can only vote for the witness or not vote for the witness.
return type, namespace, & method
signed_transaction graphene::wallet::wallet_api::vote_for_witness(
string voting_account,
string witness,
bool approve,
bool broadcast);
Function Call
Return
Parameters
name | data type | description | details |
voting_account | string | The name or id of the account who is voting with their PPY. | No quotes required. |
witness | string | The name or id of the witness' owner account. | No quotes required. |
approve | bool | true if you wish to vote in favor of that witness, false to remove your vote in favor of that witness. | n/a |
broadcast | bool | true to broadcast the transaction on the network. | n/a |
Example Call
vote_for_witness 1.2.12345 some-witness true true
Return Format
{
"ref_block_num": number,
"ref_block_prefix": number,
"expiration": "datetime",
"operations": [],
"extensions": [],
"signatures": []
}
Last modified 2yr ago