3 Create Development Wallet
This section provides instructions for creating a wallet for use in developing or maintaining software. Before a user can make a change to program code of the product, he/she needs to create a wallet and keys for development.
Wallet — a repository of public-private key pair. Private key is stored in encrypted form and is needed to sign operations performed on the blockchain. Wallet is accessed using cleos
.
About Wallets A common misconception in cryptocurrency regarding wallets is that they store tokens. However, in reality, a wallet is used to store private keys in an encrypted file to sign transactions. Wallets do not serve as a storage medium for tokens. Tokens are not stored in the wallets. Wallets store only keys for signing operations.
A user builds a transaction object, usually through an interface, sends that object to the wallet to be signed, the wallet then returns that transaction object with a signature which is then broadcast to the network. When/if the network confirms that the transaction is valid, it is included into a block on the blockchain.
Step 1: Create a Wallet
The first step is to create a wallet. Use cleos
wallet create to create a new "default" wallet using the option --to-console
for simplicity. If using cleos
in production, it is wise to instead use --to-file
so your wallet password is not in your bash history. For development purposes and because these are development and not production keys --to-console
poses no security threat.
The cleos
application will return a password to save. Further information appears with a reminder that this password will be needed when unlocking the wallet, and that without a password, it will be impossible to recover the imported keys.
Running the default command creates a wallet named «default». If you want to create a wallet with a different name (for example, when creating more than one wallet) you can use the --name
option (or -n
).
As a result, a wallet with the second-wallet
name is created.
Step 2: Open the Wallet
Wallets are stored in the keosd
application. Wallets are kept in the closed state by default. To open the wallet, you have to use the open
operation.
It will return:
To obtain a list of open wallets use the list
operation.
It will return:
In the absence of purses in the open state, the following information will appear:
Step 3: Unlock a Wallet
Despite the fact that the wallet is open, the keosd
application keeps it in a locked state. To use the wallet, it must be unlocked by unlock
operation.
A password prompt will appear. Enter the password and press enter
.
Note:
You can enter the password directly on the command line by adding the
--password
option. For example,
You can get a list of open wallets by re-executing:
It should return:
The presence of the (*) symbol means that the wallet is in the unlocked state.
Step 4: Import keys into your wallet
After the wallet is created and unlocked, a pair of keys can be loaded into it - private and public. To do this, you can use the create_key
operation. This operation allows you to generate keys and automatically load them into the wallet. By default, a key with type K1
— privileged will be generated.
When having more than one wallet, you have specify the name of the wallet in the team, adding the -name <text>
option.
It will return something like the following:
Please note:
Unlike EOS, in CyberWay the public key code actually starts with the
GLS
characters.
Step 5: Import the Development Key
Every new CyberWay chain has a default "system" user called "cyber". This account is used to setup the chain by loading system contracts that dictate the governance and consensus of the CyberWay chain. Every new CyberWay chain comes with a development key, and this key is the same. Load this key to sign transactions on behalf of the system user (cyberway)
You'll be prompted for a private key, enter the cyberway development key provided below:
You now have a default wallet unlocked and loaded with a key, and are ready to proceed
Step 6: Lock a Wallet (Wallets)
Sometimes it is necessary to have your wallet locked. For instance, when the long-term interruptions in software development are occuring. To lock a single wallet you can use the lock
operation.
A message about locking the user's wallet should appear:
To lock all user wallets, use the lock_all
operation.
The following message on locking all user wallets should appear:
Important
Never use the development key for a production account! Doing so will most certainly result in the loss of access to your account, this private key is publicly known.
Our congratulations!!! You now have a default wallet unlocked and loaded with a key, and are ready to proceed!!!
Last updated