Links

CLI Commands for All Nodes

CLI commands that all node operators use.

1. Node Operators CLI Command Reference

1.1. suggest_brain_key

Suggests a safe brain key to use for creating your account keys. A brain key is a long passphrase that provides enough entropy to generate cryptographic keys. This function will suggest a suitably random string that should be easy to write down (and, with effort, memorize).
The GUI Wallet generates a brain key for your password when creating a new account. But in the case of the GUI Wallet, rather than a long passphrase (i.e. set of words), it generates a string of 52 random letters (a-z & A-Z) and numbers (0-9).
For example, the suggest_brain_key method could give you:
"EDIFICE PALLID ANOESIA STRIDE PARREL SPORTY AXIFORM INOPINE SWOONED TONETIC CORKER OATEN PUSHER MIN CERN TACT"
And the GUI Wallet could produce the password of:
EyqFQDRpydZJDgTV8EJIcpmPLhfmdq6Yjbo45pNsBe7wSJSpvq0v
Although they look different, both are brain keys and will work for generating public and private keys.
return type, namespace, & method
brain_key_info graphene::wallet::wallet_api::suggest_brain_key()const;
Function Call
Return
Parameters
name
data type
description
details
ℹ This command has no parameters!
n/a
n/a
n/a
Example Call
suggest_brain_key
Return Format
struct brain_key_info
{
string brain_priv_key;
string wif_priv_key;
public_key_type pub_key;
};
Example Successful Return
suggest_brain_key
{
"brain_priv_key": "EDIFICE PALLID ANOESIA STRIDE PARREL SPORTY AXIFORM INOPINE SWOONED TONETIC CORKER OATEN PUSHER MIN CERN TACT",
"wif_priv_key": "5JyK47o1xFmA6fE4Z4Pgzcdd7dGhQnorW2sTPzPxeXH7QaT4eN6",
"pub_key": "PPY6TK9mXBaFr8ewaJa9zpgbRQVN7VkvAKay4hHGA2hDceDQvrRBv"
}
Note that the returned "pub_key" value will be prefixed with:
  • "PPY" in mainnet (Alice) as per the example above
  • "TEST" in the public testnet (Beatrice)

1.2. get_private_key_from_password

Returns the public-private key-pair for the owner, active, or memo role for a given account and its password.
return type, namespace, & method
pair<public_key_type, string> graphene::wallet::wallet_api::get_private_key_from_password(
string account,
string role,
string password
)const;
Function Call
Return
Parameters
name
data type
description
details
account
string
The account name we're creating keys for.
no quotes required.
role
string
The role we're creating keys for. One of: owner, active, or memo
no quotes required.
password
string
A brain key. It might be the password provided by the GUI wallet, or obtained from the suggest_brain_keycommand (brain_priv_key).
quotes required if there are spaces!
Example Call
get_private_key_from_password myaccountname1 owner "EDIFICE PALLID ANOESIA STRIDE PARREL SPORTY AXIFORM INOPINE SWOONED TONETIC CORKER OATEN PUSHER MIN CERN TACT"
Return Format
pair<public_key_type, string>
[
//the public key,
//the private key
]
Example Successful Return
get_private_key_from_password myaccountname1 owner "EDIFICE PALLID ANOESIA STRIDE PARREL SPORTY AXIFORM INOPINE SWOONED TONETIC CORKER OATEN PUSHER MIN CERN TACT"
[
"PPY8fAzCBgJhfL6YWsJUycw6SvU7VZnNgq4t5vuzEVP168PHVKJXn",
"5Kbhg1xaW7hceZhqJSqg3yZ4gsAUdFaA5uD4yBiHME2SYLsa7bU"
]

1.3. import_key

Imports the private key for an existing account for use in the CLI Wallet. The private key must match either an owner key or an active key for the named account.
return type, namespace, & method
bool graphene::wallet::wallet_api::import_key(
string account_name_or_id,
string wif_key);
Function Call
Return
Parameters
name
data type
description
details
account_name_or_id
string
The name or id of the account that owns the key.
no quotes required.
wif_key
string
The private key.
no quotes required.
Example Call
import_key myaccountname1 5Kbhg1xaW7hceZhqJSqg3yZ4gsAUdFaA5uD4yBiHME2SYLsa7bU
Return Format
true
#if successful
false
#if an error
Example Successful Return
import_key myaccountname1 5Kbhg1xaW7hceZhqJSqg3yZ4gsAUdFaA5uD4yBiHME2SYLsa7bU
true

1.4. upgrade_account

Upgrades an account to prime status. This makes the account holder a 'lifetime member'. This is necessary for the account to become a Witness or SON.
return type, namespace, & method
signed_transaction graphene::wallet::wallet_api::upgrade_account(
string name,
bool broadcast);
Function Call
Return
Parameters
name
data type
description
details
name
string
The name or id of the account to upgrade.
no quotes required.
broadcast
bool
true to broadcast the transaction on the network.
n/a
Note that this operation currently costs 5 PPY. That fee may change in the future.
Example Call
upgrade_account myaccountname1 true
Return Format
{
"ref_block_num": number,
"ref_block_prefix": number,
"expiration": "datetime",
"operations": [],
"extensions": [],
"signatures": []
}
Example Successful Return
upgrade_account myaccountname1 true
{
"ref_block_num": 10412,
"ref_block_prefix": 1003801100,
"expiration": "2015-02-05T00:11:00",
"operations": [[
8,{
"fee": {
"amount": 500000,
"asset_id": "1.3.0"
},
"account_to_upgrade": "1.2.1234",
"upgrade_to_lifetime_member": true,
"extensions": []
}
]
],
"extensions": [],
"signatures": [
"268bd8....."
]
}

1.5. create_vesting_balance

Creates a vesting deposit owned by the given account. This is used to supply vested assets to operate certain nodes, such as a SON node. In the case of SONs, 100 PPY (at the time of writing) must be set aside in two separate vesting deposits (50 PPY each) to dedicate to the operation of the SON node transactions.
return type, namespace, & method
signed_transaction graphene::wallet::wallet_api::create_vesting_balance(
string owner_account,
string amount,
string asset_symbol,
vesting_balance_type vesting_type,
bool broadcast);
Function Call
Return
Parameters
name
data type
description
details
owner_account
string
The name or id of the vesting balance owner and creator.
no quotes required.
amount
string
The amount to vest.
In nominal units. For example, enter 0.5 for half of a PPY.
asset_symbol
string
The symbol of the asset to vest.
no quotes required.
vesting_type
vesting_balance_type
One of normal, gpos, or son.
no quotes required.
broadcast
bool
true to broadcast the transaction on the network.
n/a
Example Call
create_vesting_balance myaccountname-son 50 PPY son true
Return Format
{
"ref_block_num": number,
"ref_block_prefix": number,
"expiration": "datetime",
"operations": [],
"extensions": [],
"signatures": []
}

1.6. get_private_key

Get the WIF private key corresponding to a public key. The private key must already be in the wallet.
return type, namespace, & method
string graphene::wallet::wallet_api::get_private_key(
public_key_type pubkey);
Function Call
Return
Parameters
name
data type
description
details
pubkey
public_key_type
The public key you wish to get the private key for.
no quotes required.
Example Call
get_private_key PPY8kvUXLpoXE9rJHwppR48LkqSouAzFZomAPb3hW9gnkSHZCsozi
Return Format
string
Example Successful Return
get_private_key PPY5D13DULV2gKLQ324bmyTVFGW2wm9QYz6uVEmnUmkifRyxcSifk
"5JCLzEW4T4ALFKZeKef7qF8T2MhndmtZoj2sbcXhNTVZWen2Xn1"

1.7. dump_private_keys

Displays all private keys owned by the wallet. The keys are printed in WIF format. You can import these keys into another wallet using import_key().
return type, namespace, & method
map<public_key_type, string> graphene::wallet::wallet_api::dump_private_keys();
Function Call
Return
Parameters
name
data type
description
details
ℹ This command has no parameters!
n/a
n/a
n/a
Example Call
dump_private_keys
Return Format
[[
"Public Key String 1",
"Private Key String 1"
],[
"Public Key String 2",
"Private Key String 2"
],[
"Public Key String 3",
"Private Key String 3"
],[
"Public Key String n...",
"Private Key String n..."
]
]
Example Successful Return
dump_private_keys
[[
"PPY7sxBKU1...",
"5Jh04o8q..."
],[
"PPY6oAqs9...",
"5JMR32LV..."
],[
"PPY586S...",
"5JN59ePX..."
],[
And so on...
]
]

1.8. get_account

Returns information about the given account.
return type, namespace, & method
account_object graphene::wallet::wallet_api::get_account(
string account_name_or_id);
Function Call
Return
Parameters
name
data type
description
details
account_name_or_id
string
The name or id of the account to provide information about.
No quotes required.
Example Call
get_account 1.2.12345
Return Format
{
"id": "string",
"membership_expiration_date": "datetime",
"registrar": "string",
"referrer": "string",
"lifetime_referrer": "string",
"network_fee_percentage": number,
"lifetime_referrer_fee_percentage": number,
"referrer_rewards_percentage": number,
"name": "string",
"owner": {
"weight_threshold": number,
"account_auths": [],
"key_auths": [],
"address_auths": []
},
"active": {
"weight_threshold": number,
"account_auths": [],
"key_auths": [],
"address_auths": []
},
"options": {
"memo_key": "string",
"voting_account": "string",
"num_witness": number,
"num_committee": number,
"votes": [],
"extensions": []
},
"statistics": "string",
"whitelisting_accounts": [],
"blacklisting_accounts": [],
"whitelisted_accounts": [],
"blacklisted_accounts": [],
"owner_special_authority": [],
"active_special_authority": [],
"top_n_control_flags": number
}
Example Successful Return
get_account 1.2.12345
{
"id": "1.2.12345",
"membership_expiration_date": "2106-02-07T06:28:15",
"registrar": "1.2.12345",
"referrer": "1.2.12345",
"lifetime_referrer": "1.2.12345",
"network_fee_percentage": 10000,
"lifetime_referrer_fee_percentage": 0,
"referrer_rewards_percentage": 0,
"name": "myawesome-son",
"owner": {
"weight_threshold": 1,
"account_auths": [],
"key_auths": [[
"PPY8XGp5...",
1
]
],
"address_auths": []
},
"active": {
"weight_threshold": 1,
"account_auths": [],
"key_auths": [[
"PPY2j4ySFX...",
1
]
],
"address_auths": []
},
"options": {
"memo_key": "PPY15sZ1A...",
"voting_account": "1.2.8",
"num_witness": 0,
"num_committee": 0,
"votes": [],
"extensions": []
},
"statistics": "2.6.12345",
"whitelisting_accounts": [],
"blacklisting_accounts": [],
"whitelisted_accounts": [],
"blacklisted_accounts": [],
"owner_special_authority": [
0,{}
],
"active_special_authority": [
0,{}
],
"top_n_control_flags": 0
}