CLI Commands for SONs
CLI commands that sons use.

1. SONs CLI Command Reference

1.1. create_son

Creates a SON object owned by the given account. An account can have at most one SON object.
return type, namespace, & method
1
signed_transaction graphene::wallet::wallet_api::create_son(
2
string owner_account,
3
string url,
4
vesting_balance_id_type deposit_id,
5
vesting_balance_id_type pay_vb_id,
6
flat_map<sidechain_type, string> sidechain_public_keys,
7
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 SON.
no quotes required.
url
string
a URL to include in the SON record in the blockchain. Clients may display this when showing a list of SONs.
May be blank.
deposit_id
vesting_balance_id_type
vesting balance id for SON deposit.
This is the son vesting balance.
pay_vb_id
vesting_balance_id_type
vesting balance id for SON pay_vb
This is the normal vesting balance.
sidechain_public_keys
flat_map
The new set of sidechain public keys.
n/a
broadcast
bool
true to broadcast the transaction on the network.
n/a
Example Call
1
create_son myaccountname-son "www.my-awesome-son.com" 1.13.79 1.13.80 [[bitcoin, 023b907586045625367ecd62c5d889591586c87e57fa49be21614209489f00f1b9]] true
2
3
# The above command is structured like this:
4
# create_son <username> "<SON proposal url>" <son vesting balance ID> <normal vesting balance ID> [[bitcoin, <bitcoin public key>]] 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
create_son myaccountname-son "www.my-awesome-son.com" 1.13.79 1.13.80 [[bitcoin, 023b907586045625367ecd62c5d889591586c87e57fa49be21614209489f00f1b9]] true
2
{
3
"ref_block_num": 10412,
4
"ref_block_prefix": 1003801100,
5
"expiration": "2015-02-05T00:11:00",
6
"operations": [[
7
101,{
8
"fee": {
9
"amount": 0,
10
"asset_id": "1.3.0"
11
},
12
"owner_account": "1.2.12345",
13
"url": "www.my-awesome-son.com",
14
"deposit": "1.13.79",
15
"signing_key": "PPY2j4hy47qY...",
16
"sidechain_public_keys": [[
17
"bitcoin",
18
"bc1abc1234..."
19
]
20
],
21
"pay_vb": "1.13.80"
22
}
23
]
24
],
25
"extensions": [],
26
"signatures": [
27
"268bd8....."
28
]
29
}
Copied!

1.2. update_son

Update a SON object owned by the given account.
return type, namespace, & method
1
signed_transaction graphene::wallet::wallet_api::create_son(
2
string owner_account,
3
string url,
4
string block_signing_key,
5
flat_map<sidechain_type, string> sidechain_public_keys,
6
bool broadcast);
Copied!
Function Call
Return
Parameters
name
data type
description
details
owner_account
string
The name of the SON's owner account. Also accepts the ID of the owner account or the ID of the SON.
no quotes required.
url
string
Same as for create_son. The empty string makes it remain the same.
n/a
block_signing_key
string
A new signing key to replace the currently set signing key.
n/a
sidechain_public_keys
flat_map
The new set of sidechain public keys. An 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_son myaccountname-son "www.my-awesome-son.com" PPY8kvUXLpoXE9rJHwppR48LkqSouAzFZomAPb3hW9gnkSHZCsozi [[bitcoin, 023b907586045625367ecd62c5d889591586c87e57fa49be21614209489f00f1b9]] true
2
3
# The above command is structured like this:
4
# create_son <username> "<SON proposal url>" <new block signing public key> [[bitcoin, <bitcoin public key>]] 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_son myaccountname-son "www.my-awesome-son.com" PPY8kvUXLpoXE9rJHwppR48LkqSouAzFZomAPb3hW9gnkSHZCsozi [[bitcoin, 023b907586045625367ecd62c5d889591586c87e57fa49be21614209489f00f1b9]] true
2
{
3
"ref_block_num": 10412,
4
"ref_block_prefix": 1003801100,
5
"expiration": "2015-02-05T00:11:00",
6
"operations": [[
7
102,{
8
"fee": {
9
"amount": 0,
10
"asset_id": "1.3.0"
11
},
12
"son_id": "1.33.99",
13
"owner_account": "1.2.12345",
14
"new_url": "www.my-awesome-son.com",
15
"new_signing_key": "PPY8kvUXLpoXE9rJHwppR48LkqSouAzFZomAPb3hW9gnkSHZCsozi",
16
"new_sidechain_public_keys": [[
17
"bitcoin",
18
"bc1..."
19
]
20
]
21
}
22
]
23
],
24
"extensions": [],
25
"signatures": [
26
"268bd8....."
27
]
28
}
Copied!

1.3. update_son_vesting_balances

Updates the vesting balances associated with a given SON.
return type, namespace, & method
1
signed_transaction graphene::wallet::wallet_api::update_son_vesting_balances(
2
string owner_account,
3
optional<vesting_balance_id_type> new_deposit,
4
optional<vesting_balance_id_type> new_pay_vb,
5
bool broadcast);
Copied!
Function Call
Return
Parameters
name
data type
description
details
owner_account
string
The name or id of the SON account owner, or the id of the SON.
No quotes required.
new_deposit
vesting_balance_id_type
A vesting balance id that will replace the currently set son vesting balance.
Optional
new_pay_vb
vesting_balance_id_type
A vesting balance id that will replace the currently set normal vesting balance.
Optional
broadcast
bool
true to broadcast the transaction on the network.
n/a
Example Call
1
update_son_vesting_balances 1.33.99 1.13.81 1.13.82 true
2
3
# The above command is structured like this:
4
# update_son_vesting_balances <owner_account> <new_deposit> <new_pay_vb> 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_son_vesting_balances 1.33.99 1.13.81 1.13.82 true
2
{
3
"ref_block_num": 10412,
4
"ref_block_prefix": 1003801100,
5
"expiration": "2015-02-05T00:11:00",
6
"operations": [[
7
102,{
8
"fee": {
9
"amount": 0,
10
"asset_id": "1.3.0"
11
},
12
"son_id": "1.33.99",
13
"owner_account": "1.2.12345",
14
"new_deposit": "1.13.81",
15
"new_pay_vb": "1.13.82"
16
}
17
]
18
],
19
"extensions": [],
20
"signatures": [
21
"268bd8....."
22
]
23
}
Copied!

1.4. get_son

Returns information about the given SON.
return type, namespace, & method
1
son_object graphene::wallet::wallet_api::get_son(
2
string owner_account);
Copied!
Function Call
Return
Parameters
name
data type
description
details
owner_account
string
The name or id of the SON account owner, or the id of the SON.
No quotes required.
Example Call
1
get_son 1.33.99
Copied!
Return Format
1
{
2
"id": "string",
3
"son_account": "string",
4
"vote_id": "string",
5
"total_votes": number,
6
"url": "string",
7
"deposit": "string",
8
"signing_key": "string",
9
"pay_vb": "string",
10
"statistics": "string",
11
"status": "string",
12
"sidechain_public_keys": [[
13
"string",
14
"string"
15
]
16
]
17
}
Copied!
Example Successful Return
1
get_son 1.33.99
2
{
3
"id": "1.33.99",
4
"son_account": "1.2.12345",
5
"vote_id": "3:114",
6
"total_votes": 0,
7
"url": "www.my-awesome-son.com",
8
"deposit": "1.13.79",
9
"signing_key": "PPY2j4ySF...",
10
"pay_vb": "1.13.80",
11
"statistics": "2.25.4",
12
"status": "inactive",
13
"sidechain_public_keys": [[
14
"bitcoin",
15
"bc1..."
16
]
17
]
18
}
Copied!

1.5. vote_for_son

Vote for a given SON. An account can publish a list of all SONs they approve of. This command allows you to add or remove SONs 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 SON, you can only vote for the SON or not vote for the SON.
return type, namespace, & method
1
signed_transaction graphene::wallet::wallet_api::vote_for_son(
2
string voting_account,
3
string son,
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.
son
string
The name or id of the SON's owner account.
No quotes required.
approve
bool
true if you wish to vote in favor of that SON, false to remove your vote in favor of that SON.
n/a
broadcast
bool
true to broadcast the transaction on the network.
n/a
Example Call
1
vote_for_son 1.2.12345 some-son 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!

1.6. update_son_votes

Change all your votes for SONs in one transaction. This can add and remove votes, and set the number of SONs you think should be active too.
You cannot vote against a SON, you can only vote for the SON or not vote for the SON.
return type, namespace, & method
1
signed_transaction graphene::wallet::wallet_api::update_son_votes(
2
string voting_account,
3
std::vector<std::string> sons_to_approve,
4
std::vector<std::string> sons_to_reject,
5
uint16_t desired_number_of_sons,
6
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.
sons_to_approve
std::vector<std::string>
An array of SON names or ids that you had not previously voted for which you wish to add your vote.
This can be empty.
sons_to_reject
std::vector<std::string>
An array of SON names or ids that you had previously voted for which you wish to remove your vote.
This can be empty.
desired_number_of_sons
uint16_t
The number of SONs that you think the network should have. You must vote for at least this many SONs. You can set this to 0 (zero) to abstain from voting on the number of SONs.
n/a
broadcast
bool
true to broadcast the transaction on the network.
n/a
Example Call
1
update_son_votes 1.2.12345 [different-son, another-son] [] 3 true
Copied!
Return Format
Example Successful Return

1.7. list_sons

Lists all registered SONs, active or not.
return type, namespace, & method
1
map<string, son_id_type> graphene::wallet::wallet_api::list_sons(
2
const string& lowerbound,
3
uint32_t limit);
Copied!
Function Call
Return
Parameters
name
data type
description
details
lowerbound
string&
The name of the first SON to return. If the named SON does not exist, the list will start at the SON that comes next.
Use "" to start at the beginning.
limit
uint32_t
The maximum number of SON to return.
Max of 1000.
Example Call
1
list_sons "" 100
Copied!

1.8. list_active_sons

List all active SONs.
return type, namespace, & method
1
map<string, son_id_type> graphene::wallet::wallet_api::list_active_sons();
Copied!
Function Call
Return
Parameters
name
data type
description
details
No Parmeters!
n/a
n/a
n/a
Example Call
1
list_active_sons
Copied!

1.9. request_son_maintenance

Modify status of the SON owned by the given account to maintenance.
return type, namespace, & method
1
signed_transaction graphene::wallet::wallet_api::request_son_maintenance(
2
string owner_account,
3
bool broadcast);
Copied!
Function Call
Return
Parameters
name
data type
description
details
owner_account
string
The name or id of the account who owns the SON.
No quotes required.
broadcast
bool
true to broadcast the transaction on the network.
n/a
Example Call
1
request_son_maintenance mycool-son true
Copied!

1.10. cancel_request_son_maintenance

Modify status of the SON owned by the given account back to active.
return type, namespace, & method
1
signed_transaction graphene::wallet::wallet_api::cancel_request_son_maintenance(
2
string owner_account,
3
bool broadcast);
Copied!
Function Call
Return
Parameters
name
data type
description
details
owning_account
string
The name or id of the account who owns the SON.
No quotes required.
broadcast
bool
true to broadcast the transaction on the network.
n/a
Example Call
1
cancel_request_son_maintenance mycool-son true
Copied!

1.11. get_son_wallets

This will display the wallet information for all registered SONs. You can specify the maximum number of wallets to return.
return type, namespace, & method
1
vector<optional<son_wallet_object>> graphene::wallet::wallet_api::get_son_wallets(
2
uint32_t limit);
Copied!
Function Call
Return
Parameters
name
data type
description
details
limit
uint32_t
The maximum number of results to return.
n/a
Example Call
1
get_son_wallets 20
Copied!

1.12. get_active_son_wallet

This will display the wallet information for the current active SON.
return type, namespace, & method
1
optional<son_wallet_object> graphene::wallet::wallet_api::get_active_son_wallet();
Copied!
Function Call
Return
Parameters
name
data type
description
details
No Parameters!
n/a
n/a
n/a
Example Call
1
get_active_son_wallet
Copied!

1.13. get_son_wallet_by_time_point

This will display the wallet information for the SON that was active at a specific date and time.
return type, namespace, & method
1
optional<son_wallet_object> graphene::wallet::wallet_api::get_son_wallet_by_time_point(
2
time_point_sec time_point);
Copied!
Function Call
Return
Parameters
name
data type
description
details
time_point
time_point_sec
The date and time. Formatted like this:
"2020-10-31T13:43:39"
Quotes are required!
Example Call
1
get_son_wallet_by_time_point "2020-10-31T13:43:39"
Copied!

2. Sidechains CLI Command Reference

2.1. add_sidechain_address

This command allows a user to register two Bitcoin addresses: one used to create their deposit address, and one that will be used for their withdraw address. Collectively these are a "sidechain address".
return type, namespace, & method
1
signed_transaction graphene::wallet::wallet_api::add_sidechain_address(
2
string account,
3
sidechain_type sidechain,
4
string deposit_public_key,
5
string withdraw_public_key,
6
string withdraw_address,
7
bool broadcast);
Copied!
Function Call
Return
Parameters
name
data type
description
details
account
string
The name or id of the account who owns the address.
No quotes required.
sidechain
sidechain_type
One of: bitcoin, (more will be added later).
n/a
deposit_public_key
string
The public key of a Bitcoin address. This will be used to generate the deposit address in the return of this function.
n/a
withdraw_public_key
string
The public key of a different Bitcoin address. This will be used for the withdraw address.
n/a
withdraw_address
string
The Bitcoin address that is connected to the withdraw_public_key.
n/a
broadcast
bool
true to broadcast the transaction on the network.
n/a
Example Call
add_sidechain_address mypeerplays-account bitcoin 02cf1b2c34eed7537a63eb5e86c914b6c5f641d87f07798dd777773d96c4df82e9 022bccebf0f97231c1a499ed2145f744444b2df51d24e8ba71016ebd186bec2ab9 1KTE52KRoYf8G3SPJtKUufU9tRansAGyud true

2.2. delete_sidechain_address

This will delete a sidechain address that was previously registered with the add_sidechain_address command. Only one sidechain address can exist per user and sidechain. (A sidechain address in the case of Bitcoin consists of both a deposit and a withdraw address.)
return type, namespace, & method
1
signed_transaction graphene::wallet::wallet_api::delete_sidechain_address(
2
string account,
3
sidechain_type sidechain,
4
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 SON's owner account.
No quotes required.
approve
bool
true if you wish to vote in favor of that SON, false to remove your vote in favor of that SON.
n/a
broadcast
bool
true to broadcast the transaction on the network.
n/a
Example Call
1
vote_for_son 1.2.12345 some-son true true
Copied!

2.3. get_sidechain_address_by_account_and_sidechain

This returns a registered sidechain address for a given account and sidechain.
return type, namespace, & method
1
fc::optional<sidechain_address_object> graphene::wallet::wallet_api::get_sidechain_address_by_account_and_sidechain(
2
string account,
3
sidechain_type sidechain);
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 SON's owner account.
No quotes required.
approve
bool
true if you wish to vote in favor of that SON, false to remove your vote in favor of that SON.
n/a
broadcast
bool
true to broadcast the transaction on the network.
n/a
Example Call
1
vote_for_son 1.2.12345 some-son true true
Copied!

2.4. get_sidechain_addresses_by_account

This returns all the registered sidechain addresses for a given account.
return type, namespace, & method
1
vector<optional<sidechain_address_object>> graphene::wallet::wallet_api::get_sidechain_addresses_by_account(
2
string account);
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 SON's owner account.
No quotes required.
approve
bool
true if you wish to vote in favor of that SON, false to remove your vote in favor of that SON.
n/a
broadcast
bool
true to broadcast the transaction on the network.
n/a
Example Call
1
vote_for_son 1.2.12345 some-son true true
Copied!

2.5. get_sidechain_addresses_by_sidechain

This returns all the registered sidechain addresses for a given sidechain.
return type, namespace, & method
1
vector<optional<sidechain_address_object>> graphene::wallet::wallet_api::get_sidechain_addresses_by_sidechain(
2
sidechain_type sidechain);
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 SON's owner account.
No quotes required.
approve
bool
true if you wish to vote in favor of that SON, false to remove your vote in favor of that SON.
n/a
broadcast
bool
true to broadcast the transaction on the network.
n/a
Example Call
1
vote_for_son 1.2.12345 some-son true true
Copied!

2.6. get_sidechain_addresses_count

This returns the number of registered sidechain addresses.
return type, namespace, & method
1
uint64_t graphene::wallet::wallet_api::get_sidechain_addresses_count();
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 SON's owner account.
No quotes required.
approve
bool
true if you wish to vote in favor of that SON, false to remove your vote in favor of that SON.
n/a
broadcast
bool
true to broadcast the transaction on the network.
n/a
Example Call
1
vote_for_son 1.2.12345 some-son true true
Copied!