Wallet Management
The Akave CLI includes a built-in wallet subsystem to prevent needing to pass raw private keys with every command, minimizing the risk of exposure.
Run akavecli wallet --help to see available wallet commands:
balanceShows the AKVT token balance for a walletcreateCreates a new walletexport-keyExports private key for a walletimportImport a wallet using a private keylistLists all wallets
Wallet Storage
Wallets are stored in: ~/.akave_wallets
Usage Examples
Create a New Wallet
akavecli wallet createThis will:
- Create a new wallet
- Store it in the keystore directory
- Assign it a wallet name
You can then use it with bucket and file commands via the --account flag:
akavecli bucket create mybucket --account <wallet-name>Note: If you do not use the --account flag, the CLI uses the first available wallet.
List Wallets
akavecli wallet listThis shows all wallets stored in the keystore.
Import a Private Key
If you have a private key (e.g., exported from MetaMask), you can import it using:
akavecli wallet import <wallet-name> <private-key>The CLI will create a wallet entry for that key, which you can then reference using --account <wallet-name>.
Export a Private Key
To export the private key for a wallet, use:
akavecli wallet export-key <wallet-name>Use this only when necessary (e.g., migrating to a different wallet system). Treat the exported key as extremely sensitive.
Using Wallets in Commands
Every state-changing command that interacts with the network should be associated with a wallet.
Example:
akavecli bucket create mybucket \
--account mywallet \
--node-address connect.akave.ai:5500If --account is not provided, and at least one wallet exists, the first wallet in the keystore will be used.
Using --private-key Directly (Advanced/Optional)
The recommended way is to use wallets. However, the --private-key flag is still available for advanced flows or automated environments.
--private-key, avoid typing the raw key in the command line directly. Use a file or environment variable instead as shown below.Approach 1: Private Key File
- Create a secure directory and file:
mkdir -p ~/.key
echo "your-private-key-content" > ~/.key/user.akvf.key
chmod 600 ~/.key/user.akvf.key- Use it in commands:
akavecli bucket create mybucket \
--private-key "$(cat ~/.key/user.akvf.key)" \
--node-address connect.akave.ai:5500Approach 2: Environment Variable
- Set the variable for the current session:
export AKAVE_PRIVATE_KEY="<your-private-key>"- Use it in commands:
akavecli bucket create mybucket \
--private-key "$AKAVE_PRIVATE_KEY" \
--node-address connect.akave.ai:5500- Clear when done:
unset AKAVE_PRIVATE_KEYIf you add the export line to your shell RC (~/.bashrc or ~/.zshrc), it will be available in every new shell session. Be sure your machine is secure and not shared if you choose this approach.
Next Steps
Now that you have completed the wallet setup, you can proceed to Bucket and File Commands for bucket and file management.