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).
brain_key_info graphene::wallet::wallet_api::suggest_brain_key()const;Parameters
name
data type
description
details
ℹ This command has no parameters!
n/a
n/a
n/a
Example Call
suggest_brain_keyReturn 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"
}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.
pair<public_key_type, string> graphene::wallet::wallet_api::get_private_key_from_password(
string account,
string role,
string password
)const;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.
bool graphene::wallet::wallet_api::import_key(
string account_name_or_id,
string wif_key);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 5Kbhg1xaW7hceZhqJSqg3yZ4gsAUdFaA5uD4yBiHME2SYLsa7bUReturn Format
true
#if successful
false
#if an errorExample Successful Return
import_key myaccountname1 5Kbhg1xaW7hceZhqJSqg3yZ4gsAUdFaA5uD4yBiHME2SYLsa7bU
true1.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.
signed_transaction graphene::wallet::wallet_api::upgrade_account(
string name,
bool broadcast);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
Example Call
upgrade_account myaccountname1 trueReturn 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.
signed_transaction graphene::wallet::wallet_api::create_vesting_balance(
string owner_account,
string amount,
string asset_symbol,
vesting_balance_type vesting_type,
bool broadcast);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 trueReturn 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.
string graphene::wallet::wallet_api::get_private_key(
public_key_type pubkey);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 PPY8kvUXLpoXE9rJHwppR48LkqSouAzFZomAPb3hW9gnkSHZCsoziReturn Format
stringExample 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().
map<public_key_type, string> graphene::wallet::wallet_api::dump_private_keys();Parameters
name
data type
description
details
ℹ This command has no parameters!
n/a
n/a
n/a
Example Call
dump_private_keysReturn 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.
account_object graphene::wallet::wallet_api::get_account(
string account_name_or_id);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.12345Return 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
}Last updated
Was this helpful?
