CLI Commands for Witnesses
CLI commands that witnesses use.

1. Witnesses CLI Command Reference

1.1. create_witness

Creates a witness object owned by the given account. An account can have at most one witness object.
return type, namespace, & method
1
signed_transaction graphene::wallet::wallet_api::create_witness(
2
string owner_account,
3
string url,
4
bool broadcast);
Copied!
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
1
create_witness myaccountname1 "www.my-awesome-witness.com" true
Copied!
Return Format
1
{
2
"ref_block_num": number,
3
"ref_block_prefix": number,
4
"expiration": "datetime",
5
"operations": [],
6
"extensions": [],
7
"signatures": []
8
}
Copied!

1.2. update_witness

Update a witness object owned by the given account.
return type, namespace, & method
1
signed_transaction graphene::wallet::wallet_api::update_witness(
2
string witness_name,
3
string url,
4
string block_signing_key,
5
bool broadcast);
Copied!
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
1
update_witness myaccountname-witness "www.my-awesome-witness.com" PPY62L3VYXS8XqorUe2kn63j4TAQpX4YkMJkfFfmmD1nd8Qjo4Bxz true
Copied!
Return Format
1
{
2
"ref_block_num": number,
3
"ref_block_prefix": number,
4
"expiration": "datetime",
5
"operations": [],
6
"extensions": [],
7
"signatures": []
8
}
Copied!
Example Successful Return
1
update_witness myaccountname-witness "www.my-awesome-witness.com" PPY62L3VYXS8XqorUe2kn63j4TAQpX4YkMJkfFfmmD1nd8Qjo4Bxz true
2
{
3
"ref_block_num": 10412,
4
"ref_block_prefix": 1003801100,
5
"expiration": "2015-02-05T00:11:00",
6
"operations": [[
7
21,{
8
"fee": {
9
"amount": 50000,
10
"asset_id": "1.3.0"
11
},
12
"witness": "1.6.99",
13
"witness_account": "1.2.1234",
14
"new_signing_key": "PPY62L3VYXS8XqorUe2kn63j4TAQpX4YkMJkfFfmmD1nd8Qjo4Bxz",
15
"new_initial_secret": "5n00bd4aus04a9057c09b19b05f723f2e23deb32"
16
}
17
]
18
],
19
"extensions": [],
20
"signatures": [
21
"268bd8....."
22
]
23
}
Copied!

1.3. get_witness

Returns information about the given witness.
return type, namespace, & method
1
witness_object graphene::wallet::wallet_api::get_witness(
2
string owner_account);
Copied!
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
1
get_witness 1.6.99
Copied!
Return Format
1
{
2
"id": "string",
3
"witness_account": "string",
4
"last_aslot": number,
5
"signing_key": "string",
6
"next_secret_hash": "string",
7
"previous_secret": "string",
8
"vote_id": "string",
9
"total_votes": number,
10
"url": "string",
11
"total_missed": number,
12
"last_confirmed_block_num": number
13
}
Copied!
Example Successful Return
1
get_witness 1.6.99
2
{
3
"id": "1.6.99",
4
"witness_account": "1.2.1234",
5
"last_aslot": 0,
6
"signing_key": "PPY62L3VYX...",
7
"next_secret_hash": "7197f...",
8
"previous_secret": "0000000000000000000000000000000000000000",
9
"vote_id": "1:99",
10
"total_votes": 0,
11
"url": "www.my-awesome-witness.com",
12
"total_missed": 0,
13
"last_confirmed_block_num": 0
14
}
Copied!

1.4. vote_for_witness

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
1
signed_transaction graphene::wallet::wallet_api::vote_for_witness(
2
string voting_account,
3
string witness,
4
bool approve,
5
bool broadcast);
Copied!
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
1
vote_for_witness 1.2.12345 some-witness true true
Copied!
Return Format
1
{
2
"ref_block_num": number,
3
"ref_block_prefix": number,
4
"expiration": "datetime",
5
"operations": [],
6
"extensions": [],
7
"signatures": []
8
}
Copied!