Blockchain integrated
The Akave SDK CLI (akavesdk
) is a powerful command-line tool for managing storage and metadata on Akave’s decentralized network. Designed for developers, this SDK enables bucket and file management, efficient file streaming, and blockchain-based data operations through the IPC API.
Installation
Requirements
Clone repository
Install dependency (Requirements: Go 1.22+)
Go to : https://go.dev/doc/install
Mac OS Go install example
Mac OS Installation instructions for Go (for all latest OS installation instructions go to https://go.dev/dl/)
If you don’t already have Go installed, you can add it with:
If Go is installed and you need to upgrade to version 1.22+ use:
After installing or upgrading, confirm the version:
Ubuntu OS Go install example
Download package, check online for new version if needed.
Install Go package
Set path
Add to ~/.bashrc
After installing or upgrading, confirm the version:
Build
Clone repository
Build the SDK CLI
Test & make binary system wide available
To make the akavesdk
binary executable from any location without specifying the full path, you’ll need to move it to a directory in the system's PATH
. Here’s how to do it on Ubuntu, macOS, and other Unix-based systems.
1. Ubuntu/Debian
On Ubuntu and most Debian-based distributions, you can move the binary to /usr/local/bin/
, which is a common directory for user-installed binaries.
2. macOS
macOS also uses /usr/local/bin/
for user-installed binaries. The same command will work:
3. Other Unix-Based Systems (e.g., CentOS, Fedora)
For Red Hat-based distributions like CentOS and Fedora, /usr/local/bin/
is also typically in the PATH
, so you can use the same command:
4. Alternative Locations (If /usr/local/bin
is Unavailable)
/usr/local/bin
is Unavailable)On some systems, you might also consider /usr/bin/
. However, this is usually reserved for system binaries, so /usr/local/bin/
is preferred. If you must use /usr/bin/
, you can do so like this:
Verifying the Installation
After moving the binary, you can confirm it's accessible by all users with:
This command should run without needing the full path, indicating that it’s correctly in the PATH
.
Run
Get a Wallet Address and Add the Chain to MetaMask
To start, you’ll need an Akave wallet address. Visit https://faucet.akave.ai, where you can connect, add the Akave chain to MetaMask, and request funds from the faucet.
Always be careful when dealing with your private key. Double-check that you’re not hardcoding it anywhere or committing it to Git. Remember: anyone with access to your private key has complete control over your funds.
Ensure you’re not reusing a private key that’s been deployed on other EVM chains. Each blockchain has its own attack vectors, and reusing keys across chains exposes you to cross-chain vulnerabilities. Keep separate keys to maintain isolation and protect your assets.
Blockchain explorer
Node Address
Public endpoint blockchain based network (--node-address=connect.akave.ai:5500
)
IPC API Commands (Preferred)
The IPC API is the recommended approach for interacting with Akave’s decentralized storage. It provides access to Akave’s smart contracts, enabling secure, blockchain-based bucket and file operations.
Bucket Commands
Create Bucket: Creates a new bucket using the IPC API.
Delete Bucket: Soft deletes a bucket.
View Bucket: Retrieves details of a specific bucket.
List Buckets: Lists all buckets stored in the network.
To secure your key; you can put it in a keyfile and use this: (temporary untill new release)
File Commands
Make sure the minimum file size is 127 bytes! Keep max size to test at 100MB
List Files: Lists all files in a specified bucket.
File Info: Fetches metadata of a specific file.
Upload File: Uploads a file to a specified bucket.
Download File: Downloads a file from a specified bucket.
Note: IPC-based commands are highly recommended as they ensure data integrity through blockchain-based operations, making them ideal for decentralized storage use cases.
Approach to Protect Your Private Key
Using --private-key "$(cat ~/.key/user.akvf.key)"
offers protection because:
Secure Storage: The private key is stored in a hidden file (e.g.,
~/.key/user.akvf.key
) rather than directly on the command line, reducing its visibility.Prevents Command History Exposure: If the private key is directly typed in the command, it may be stored in the shell's history file (e.g.,
~/.bash_history
). By using a file reference, only the file path is stored in history, keeping the key itself hidden.File Permissions: Saving the private key in a file allows you to restrict permissions (using
chmod 600 ~/.key/user.akvf.key
), ensuring only your user can read it.Ease of Use and Consistency: You can reuse the stored key across multiple commands without retyping it, making it convenient for automation and reducing the risk of accidental exposure.
How to Implement This Securely
Create and Secure the Private Key File: Save your private key to a secure, hidden directory:
mkdir -p ~/.key
creates the hidden directory if it doesn’t already exist.echo "your-private-key-content" > ~/.key/user.akvf.key
writes the private key to the file.chmod 600 ~/.key/user.akvf.key
restricts access so only your user account can read the file.
Example: Use the Command with the Private Key File: reference the key file in your command:
This command reads the private key from
~/.key/user.akvf.key
.It passes the key to the
--private-key
option forakavecli ipc bucket create
.The
--node-address
flag specifies the node to connect to.
Steps to Set Up an Environment Variable for Your Private Key
Save the Private Key to an Environment Variable Temporarily
You can set the private key as an environment variable in your terminal session. This will store the key in memory for the current session only, and it will not be accessible after you close the terminal.
Now, the environment variable
AKAVE_PRIVATE_KEY
holds the private key securely.Use the Environment Variable in the Command
Modify your command to reference the environment variable instead of reading the key from the file:
By referencing
$AKAVE_PRIVATE_KEY
, the command will use the key stored in memory rather than reading it directly from a file each time.Clear the Environment Variable When Done
To remove the key from memory, unset the environment variable once you’re finished:
Optional: Add the Environment Variable in Your .bashrc
or .zshrc
.bashrc
or .zshrc
If you frequently need the private key across sessions, you can add this line to your .bashrc
or .zshrc
file:
Then, source the file to load the variable:
Using this approach keeps your private key secure while making it accessible for the command without exposing it on the command line or in history.
Last updated