Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
From install, to setup, to running.
CLI stands for "Command Line Interface" which means that the program uses the text-based command line window to take user input and show its output.
The Peerplays CLI wallet is a program (named cli_wallet
) that is installed along with the node software when installing a Peerplays node on a server. It's used as a way to store your Peerplays account keys locally, and as a way to interact with the Peerplays chain for account and asset-related transactions. You can also use the CLI wallet to look up information from the chain.
The wallet is encrypted with a password of your choosing. Additionally, it stores all keys locally, never exposing your keys to anyone as it signs transactions locally before transmitting them to the connected node. The node then broadcasts the signed transactions to the network.
The wallet creates a local wallet.json file that contains the encrypted private keys required to access the funds in your account.
If you have installed a Peerplays witness, API, seed, or SON node you already have the CLI wallet installed.
The CLI wallet requires a connection to a running node to reach the blockchain. You can run the wallet using your own node or another node that allows external connections. Either way, the node needs to be synced with the chain.
Once your node has synced with the blockchain, you can simply run the program:
Since the node must be running, you will either have to open a new command line window or run the node in the background to run the CLI wallet.
You can choose to connect to someone else's running and synced node. In that case, you can specify the connection as a program parameter:
The <Websocket Address>
in the code above must be replaced with the address of some public node. The address will use the websocket or secure WebSocket protocol (ws://
or wss://
respectively). Some node operators may have mapped their websocket address to a more friendly-looking domain name which can be used here as well.
It is completely safe to use the CLI wallet with an external node because your private keys are never sent to the remote server. 👍
If you have started the CLI wallet successfully, you will receive the new >>>
prompt. At this point, you'll be asked to set a password. Here's what you'll see:
Type set_password
followed by a password of your choice and hit enter. It will look like this:
If the password was saved successfully, the prompt will change to locked >>>
. At this point, the CLI wallet is locked and nobody can access it without the password you just set.
Be sure to remember/back up/save/write down your password (securely of course) because it can't be recovered if you lose it.
Then to unlock your wallet, you'll use the unlock
command with your password and hit enter.
If successful, the prompt will now read unlocked >>>
. Your wallet is now unlocked and ready for use.
After the CLI wallet has been unlocked, if there are any funds in the wallet, they are accessible. In general, lock
the wallet and unlock
when it’s needed.
To lock it, type lock
and hit enter.
The prompt will return to locked >>>
.
If the current password needs to be changed, unlock the wallet and use set_password
to do so.
Type set_password
and the new password then hit enter.
You can get more detailed information by issuing the gethelp
command. Detailed explanations for most calls are available. For example:
You can also use the help
command to get a list of all commands supported by the wallet. Note that you can use the help
and gethelp
commands even if the wallet is locked!
A guide for node operators
This document explains installing the CLI Wallet, setting it up during its first use, and the basics of running the wallet.
This reference doc contains the following commands:
suggest_brain_key
get_private_key_from_password
import_key
upgrade_account
create_vesting_balance
get_private_key
dump_private_keys
get_account
This reference doc contains the following commands:
create_witness
update_witness
get_witness
vote_for_witness
This reference doc contains the following commands in section 1:
create_son
update_son
update_son_vesting_balance
get_son
vote_for_son
update_son_votes
list_sons
list_active_sons
request_son_maintenance
cancel_request_son_maintenance
get_son_wallets
get_active_son_wallet
get_son_wallet_by_time_point
This reference doc contains the following commands in section 2:
add_sidechain_address
delete_sidechain_address
get_sidechain_address_by_account_and_sidechain
get_sidechain_addresses_by_account
get_sidechain_addresses_by_sidechain
get_sidechain_addresses_count
CLI commands that all node operators use.
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.
Parameters
Example Call
Return Format
Example Successful Return
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)
Returns the public-private key-pair for the owner
, active
, or memo
role for a given account and its password.
Parameters
Example Call
Return Format
Example Successful Return
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.
Parameters
Example Call
Return Format
Example Successful Return
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.
Parameters
Note that this operation currently costs 5 PPY. That fee may change in the future.
Example Call
Return Format
Example Successful Return
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.
Parameters
Example Call
Return Format
Get the WIF private key corresponding to a public key. The private key must already be in the wallet.
Parameters
Example Call
Return Format
Example Successful Return
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()
.
Parameters
Example Call
Return Format
Example Successful Return
Returns information about the given account.
Parameters
Example Call
Return Format
Example Successful Return
CLI commands that witnesses use.
Creates a witness object owned by the given account. An account can have at most one witness object.
Parameters
Example Call
Return Format
Update a witness object owned by the given account.
Parameters
Example Call
Return Format
Example Successful Return
Returns information about the given witness.
Parameters
Example Call
Return Format
Example Successful Return
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.
Parameters
Example Call
Return Format
There are three types of keys on chain and it can be generated using the CLI wallet. The types of keys are:
Active
Owner
Memo
Follow the below steps to generate keys in the wallet
In a new command line window, we can access the cli_wallet program after all the blocks have been downloaded from the chain. Note that "your-password-here" is a password that you're creating for the cli_wallet and doesn't necessarily have to be the password you used while creating Peerplays account.
The CLI wallet will show unlocked >>>
when successfully unlocked.
The below command will return an array with your owner key in the form of ["PPYxxx", "xxxx"] ["TESTxxx", "xxx"].
Note that the "created-username" and "created-password" used here are the username and password from the Peerplays-DEX account created.
The second value in the returned array is the private key of your owner key. Now we'll import that into the cli_wallet.
The below command will return an array with your active key in the form of ["PPYxxx", "xxxx"] / ["TESTxxx", "xxx"].
Note that the "created-username" and "created-password" used here are the username and password from the Peerplays-DEX account
The second value in the returned array is the private key of your active key. Now we'll import that into the cli_wallet.
The keys that begin with "PPY"/"TEST" are the public keys.
The cli commands includes voting for various sidechain operators
The document explains about SON voting for multiple sidechain listeners like bitcoin, ethereum, & hive and also provide the command which allows the user to change several SON account voting in a single call.
The latest update on the wallet command allows the user to choose the sidechain operators like Bitcoin, Hive, and Ethereum for voting. It allows you to Vote for any active 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. An account can publish a list of all SONs they approve and the cli allows you to add or remove SONs from this list.
The CLI command is given below:
Parameters
Syntax
Example Call
The following examples showcase voting/revoking scenario for various sidechains:
Account named account01
vote for account named sonaccount01
to become an active son for bitcoin sidechain.
Account named account01
revokes its vote for account named sonaccount01
from the bitcoin sidechain.
Account named sonaccount01
vote for account named sonaccount01
to become an active SON for ethereum sidechain.
Account named sonaccount01
revokes its vote for account named sonaccount01
from ethereum sidechain.
The signed transaction changing your vote for the given SON
This command allows you to add or remove one or more SON from this list in one call. An account can publish a list of all SONs they approve. Each account's vote is weighted according to the number the core asset shares owned by that account at the time the votes are tallied. When you are changing your vote on several SONs, this may be easier than multiple vote_for_sons
and set_desired_witness
& committee_member_count
calls.
The cli command is given below:
Syntax
Example call
Account named account05
votes for accounts named sonaccount01
, sonaccount02
, sonaccount03
, sonaccount04
, sonaccount05
and revokes its votes for accounts named sonaccount06
,sonaccount07
to become an active SONs. The total number of votes for active SONs is 5 for hive network.
Account named eth-6-son
votes for accounts named eth-2-son
, eth-3-son
, eth-5-son
, eth-6-son
to become active SON on ethereum and no account is revoked from the sidechain. The total number of votes for active SONs is 5 for ethereum network.
The signed transaction changing your vote for the given witnesses
Note that you cannot vote against a SON, you can either vote for the SON or ignore voting for the SON.
CLI commands that sons use.
Creates a SON object owned by the given account. An account can have at most one SON object.
Parameters
Example Call
Return Format
Example Successful Return
Update a SON object owned by the given account.
Parameters
Example Call
Return Format
Example Successful Return
Updates the vesting balances associated with a given SON.
Parameters
Example Call
Return Format
Example Successful Return
Returns information about the given SON.
Parameters
Example Call
Return Format
Example Successful Return
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.
Parameters
Example Call
Return Format
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.
Parameters
Example Call
Return Format
Example Successful Return
Lists all registered SONs, active or not.
Parameters
Example Call
List all active SONs.
Parameters
Example Call
Modify status of the SON owned by the given account to maintenance.
Parameters
Example Call
Modify status of the SON owned by the given account back to active.
Parameters
Example Call
This will display the wallet information for all registered SONs. You can specify the maximum number of wallets to return.
Parameters
Example Call
This will display the wallet information for the current active SON.
Parameters
Example Call
This will display the wallet information for the SON that was active at a specific date and time.
Parameters
Example Call
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".
Parameters
Example Call
add_sidechain_address mypeerplays-account bitcoin 02cf1b2c34eed7537a63eb5e86c914b6c5f641d87f07798dd777773d96c4df82e9 022bccebf0f97231c1a499ed2145f744444b2df51d24e8ba71016ebd186bec2ab9 1KTE52KRoYf8G3SPJtKUufU9tRansAGyud true
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.)
Parameters
Example Call
This returns a registered sidechain address for a given account and sidechain.
Parameters
Example Call
This returns all the registered sidechain addresses for a given account.
Parameters
Example Call
This returns all the registered sidechain addresses for a given sidechain.
Parameters
Example Call
This returns the number of registered sidechain addresses.
Parameters
Example Call
A list of CLI wallet commands is available here:
name | data type | description | details |
---|
name | data type | description | details |
---|
name
data type
description
details
ℹ This command has no parameters!
n/a
n/a
n/a
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_key
command (brain_priv_key
).
quotes required if there are spaces!
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.
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
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
name
data type
description
details
pubkey
public_key_type
The public key you wish to get the private key for.
no quotes required.
name
data type
description
details
ℹ This command has no parameters!
n/a
n/a
n/a
name
data type
description
details
account_name_or_id
string
The name or id of the account to provide information about.
No quotes required.
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
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
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.
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
voting_account | string | the name or id of the account who is voting with their shares | No quotes required |
son | string | the name or id of the SONs' owner account | No quotes required |
sidechain | sidechain_type | the name of the sidechain - ethereum, hive or bitcoin | No quotes required |
approve | bool |
| n/a |
broadcast = false | bool |
| n/a |
voting_account | string | the name or id of the account who is voting with their shares | No quotes required |
son_to_approve | std::vector std::string | the names or ids of the sons owner accounts you wish to approve (these will be added to the list of sons you currently approve). This list can be empty. | Quotes required |
sons_to_reject | std::vector std::string | the names or ids of the SONs owner accounts you wish to reject (these will be removed from the list of SONs you have approved). This list can be empty. | Quotes required |
sidechain | sidechain_type | the name of the sidechain - ethereum, hive or bitcoin | No quotes required |
desired_number_of_sons | unit16_t | the parameter helps the user to vote for /suggest the number of active SONs in sidechain | Mention the value in numbers |
broadcast = false | bool |
| n/a |
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 |
pay_vb_id | vesting_balance_id_type | vesting balance id for SON pay_vb | This is the |
sidechain_public_keys | flat_map | The new set of sidechain public keys. | n/a |
broadcast | bool |
| n/a |
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 |
| n/a |
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 | Optional |
new_pay_vb | vesting_balance_id_type | A vesting balance id that will replace the currently set | Optional |
broadcast | bool |
| n/a |
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. |
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 |
| n/a |
broadcast | bool |
| n/a |
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 |
| n/a |
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 |
limit | uint32_t | The maximum number of SON to return. | Max of 1000. |
name | data type | description | details |
No Parmeters! | n/a | n/a | n/a |
name | data type | description | details |
owner_account | string | The name or id of the account who owns the SON. | No quotes required. |
broadcast | bool |
| n/a |
name | data type | description | details |
owning_account | string | The name or id of the account who owns the SON. | No quotes required. |
broadcast | bool |
| n/a |
name | data type | description | details |
limit | uint32_t | The maximum number of results to return. | n/a |
name | data type | description | details |
No Parameters! | n/a | n/a | n/a |
name | data type | description | details |
time_point | time_point_sec | The date and time. Formatted like this:
| Quotes are required! |
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: | 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 |
| n/a |
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 |
| n/a |
broadcast | bool |
| n/a |
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 |
| n/a |
broadcast | bool |
| n/a |
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 |
| n/a |
broadcast | bool |
| n/a |
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 |
| n/a |
broadcast | bool |
| n/a |
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 |
| n/a |
broadcast | bool |
| n/a |