Wallet Management

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:

  • balance Shows the AKVT token balance for a wallet
  • create Creates a new wallet
  • export-key Exports private key for a wallet
  • import Import a wallet using a private key
  • list Lists all wallets

Wallet Storage

Wallets are stored in: ~/.akave_wallets

Usage Examples

Create a New Wallet

akavecli wallet create

This 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 list

This 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>.

⚠️
Never share your private key with anyone. Do not paste it into shared logs, screenshots, or public repositories.

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:5500

If --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.

ℹ️
If you must use --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

  1. Create a secure directory and file:
mkdir -p ~/.key
echo "your-private-key-content" > ~/.key/user.akvf.key
chmod 600 ~/.key/user.akvf.key
  1. Use it in commands:
akavecli bucket create mybucket \
    --private-key "$(cat ~/.key/user.akvf.key)" \
    --node-address connect.akave.ai:5500

Approach 2: Environment Variable

  1. Set the variable for the current session:
export AKAVE_PRIVATE_KEY="<your-private-key>"
  1. Use it in commands:
akavecli bucket create mybucket \
    --private-key "$AKAVE_PRIVATE_KEY" \
    --node-address connect.akave.ai:5500
  1. Clear when done:
unset AKAVE_PRIVATE_KEY

If 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.

Last updated on