### Verify Akave CLI Installation Source: https://docs.akave.xyz/akave-sdk-cli/streaming Demonstrates how to confirm that the `akavecli` binary has been successfully installed and is accessible from the system's PATH by running a version command. A successful execution indicates correct installation. ```bash akavecli version ``` -------------------------------- ### Verify Go Installation Source: https://docs.akave.xyz/akave-sdk-cli/blockchain-integrated Checks the installed Go version to confirm successful installation and proper PATH configuration after setting up the environment. ```bash go version ``` -------------------------------- ### Install or Upgrade Go on macOS Source: https://docs.akave.xyz/akave-sdk-cli/blockchain-integrated Commands to install Go using Homebrew if not already present, or upgrade to a specific version (1.23.5+) if Go is already installed. Includes a command to verify the Go version after installation or upgrade. ```Shell brew install go ``` ```Shell brew upgrade go ``` ```Shell go version ``` -------------------------------- ### Install Akave CLI Binary System-Wide Source: https://docs.akave.xyz/akave-sdk-cli/streaming Provides instructions for making the `akavecli` binary accessible from any location by moving it to a directory included in the system's PATH. Covers common Unix-based systems like Ubuntu, macOS, and CentOS/Fedora, suggesting preferred (`/usr/local/bin/`) and alternative (`/usr/bin/`) installation paths. ```bash sudo mv bin/akavecli /usr/local/bin/ ``` ```bash sudo mv bin/akavecli /usr/bin/ ``` -------------------------------- ### Start MCPHost with Ollama for Local LLM Integration Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/akave-mcp These shell commands demonstrate how to start the MCPHost server, connecting it to an Ollama model. It shows options for using a default configuration location, specifying a custom configuration file, and enabling debug logging for detailed output during operation. ```Shell # Using default config location mcphost -m ollama:mistral # Or specify a custom config file mcphost -m ollama:mistral --config /path/to/your/mcp.json # For debugging mcphost --debug -m ollama:mistral --config /path/to/your/mcp.json ``` -------------------------------- ### Clone Akave SDK Repository Source: https://docs.akave.xyz/akave-sdk-cli/blockchain-integrated Instructions to clone the Akave SDK repository from GitHub and navigate into its directory to begin development or setup. ```Shell git clone https://github.com/akave-ai/akavesdk.git cd akavesdk ``` -------------------------------- ### Install Go on Linux Source: https://docs.akave.xyz/akave-sdk-cli/blockchain-integrated Removes any existing Go installation and extracts the downloaded Go archive to `/usr/local`, making it available system-wide. This command requires root privileges. ```bash rm -rf /usr/local/go && tar -C /usr/local -xzf go1.23.5.linux-amd64.tar.gz ``` -------------------------------- ### List Akave Link Storage Buckets Source: https://docs.akave.xyz/js-docker-example-code Shows how to retrieve a list of all existing storage buckets by sending a GET request to the /buckets endpoint. Examples are provided for both the JavaScript API wrapper and a direct curl command. ```javascript apiRequest('GET', '/buckets'); ``` ```curl curl -X GET http://localhost:8000/buckets ``` -------------------------------- ### View Akave Link Bucket Details Source: https://docs.akave.xyz/js-docker-example-code Illustrates how to fetch details for a specific storage bucket by sending a GET request to the /buckets/:bucketName endpoint. Examples are provided for both the JavaScript API wrapper and a direct curl command. ```javascript apiRequest('GET', '/buckets/myBucket'); ``` ```curl curl -X GET http://localhost:8000/buckets/myBucket ``` -------------------------------- ### Use Configured AWS CLI Profile with Akave O3 Commands Source: https://docs.akave.xyz/akave-o3/introduction/setup This example illustrates how to utilize the previously configured `akave-o3` AWS CLI profile when executing commands. It specifically shows listing S3 buckets using `aws s3api list-buckets` while specifying the Akave O3 endpoint URL, demonstrating how to interact with Akave O3 services via the CLI. ```Bash aws s3api list-buckets \ --profile akave-o3 \ --endpoint-url https://o3-rc1.akave.xyz ``` -------------------------------- ### CORS Configuration for Browser Web Uploads Source: https://docs.akave.xyz/akave-o3/cors/cors-examples Configures a CORS rule to enable POST, PUT, and GET methods from 'https://app.example.com', facilitating direct browser uploads. It allows all headers, exposes `ETag`, and sets `MaxAgeSeconds` to 3600 for preflight requests. ```JSON { "CORSRules": [ { "AllowedHeaders": ["*"], "AllowedMethods": ["POST", "PUT", "GET"], "AllowedOrigins": ["https://app.example.com"], "ExposeHeaders": ["ETag"], "MaxAgeSeconds": 3600 } ] } ``` -------------------------------- ### CORS Configuration for Specific Frontend Origin Source: https://docs.akave.xyz/akave-o3/cors/cors-examples Specifies a CORS rule that permits GET and PUT requests exclusively from 'https://frontend.example.com'. It includes 'Authorization' in `AllowedHeaders` and exposes 'ETag' headers, with a `MaxAgeSeconds` of 600 for preflight requests. ```JSON { "CORSRules": [ { "AllowedHeaders": ["Authorization"], "AllowedMethods": ["GET", "PUT"], "AllowedOrigins": ["https://frontend.example.com"], "ExposeHeaders": ["ETag"], "MaxAgeSeconds": 600 } ] } ``` -------------------------------- ### AI Model Interaction Examples for Akave MCP Tools Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/akave-mcp These examples illustrate how an AI model can automatically leverage Akave MCP tools based on natural language prompts. They demonstrate how simple commands like 'List all my buckets' or 'Read the file...' are interpreted by the AI to invoke the appropriate underlying Akave storage operations. ```Shell # The AI model will automatically use the list_buckets tool List all my buckets ``` ```Shell # The AI model will use the get_object tool Read the file 'example.md' from bucket 'my-bucket' ``` ```Shell # The AI model will use the put_object tool Upload the content 'Hello World' to 'greeting.txt' in bucket 'my-bucket' ``` -------------------------------- ### Verify Akave CLI Installation Source: https://docs.akave.xyz/akave-sdk-cli/blockchain-integrated Confirms that the `akavecli` binary is correctly installed and accessible from the system's PATH by checking its version. This command should run successfully without needing the full path to the executable. ```bash akavecli version ``` -------------------------------- ### Install Go on Ubuntu Linux Source: https://docs.akave.xyz/akave-sdk-cli/streaming Downloads and installs the Go programming language (version 1.23.5) on Ubuntu Linux. This process involves extracting the Go archive to `/usr/local` and setting the `PATH` environment variable to make the `go` command accessible system-wide. Finally, it confirms the installed Go version. ```bash wget https://go.dev/dl/go1.23.5.linux-amd64.tar.gz rm -rf /usr/local/go && tar -C /usr/local -xzf go1.23.5.linux-amd64.tar.gz export PATH=$PATH:/usr/local/go/bin go version ``` -------------------------------- ### Configure AWS CLI Profile for Akave O3 Source: https://docs.akave.xyz/akave-o3/introduction/setup This snippet demonstrates how to set up a dedicated AWS CLI profile named `akave-o3`. It guides the user through providing their AWS Access Key ID, Secret Access Key, a default region (`akave-network`), and output format (`json`) to streamline future interactions with Akave O3 without repeatedly exporting credentials. ```Bash aws configure --profile akave-o3 ``` -------------------------------- ### Install MCPHost for Local LLM Integration Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/akave-mcp This Go command installs the MCPHost utility, which acts as a bridge for integrating Akave MCP with local Large Language Models (LLMs) like Ollama. It fetches the latest version of the `mcphost` executable from GitHub, making it available for use. ```Go go install github.com/mark3labs/mcphost@latest ``` -------------------------------- ### Install Rclone on macOS using Homebrew Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/rclone This snippet provides commands to install Rclone on macOS using the Homebrew package manager. It includes commands for initial installation and upgrading an existing installation. ```Shell brew install rclone ``` ```Shell brew upgrade rclone ``` -------------------------------- ### Install Rclone on Ubuntu using official script Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/rclone This snippet demonstrates how to install the latest version of Rclone on Ubuntu using its official installation script. It leverages `curl` and `sudo` to download and execute the script. ```Shell sudo -v ; curl https://rclone.org/install.sh | sudo bash ``` -------------------------------- ### Install or Upgrade Go on macOS using Homebrew Source: https://docs.akave.xyz/akave-sdk-cli/streaming Installs or upgrades the Go programming language to the required version (1.23.5+) on macOS using the Homebrew package manager. After installation or upgrade, it verifies the installed Go version to ensure it meets the SDK's dependencies. ```bash brew install go brew upgrade go go version ``` -------------------------------- ### List Files in Akave Link Bucket Source: https://docs.akave.xyz/js-docker-example-code Demonstrates how to retrieve a list of files within a specified bucket by sending a GET request to the /buckets/:bucketName/files endpoint. Examples are provided for both the JavaScript API wrapper and a direct curl command. ```javascript apiRequest('GET', '/buckets/myBucket/files'); ``` ```curl curl -X GET http://localhost:8000/buckets/myBucket/files ``` -------------------------------- ### Get Akave Link File Metadata Source: https://docs.akave.xyz/js-docker-example-code Shows how to fetch metadata about a specific file within a bucket by sending a GET request to the /buckets/:bucketName/files/:fileName endpoint. Examples are provided for both the JavaScript API wrapper and a direct curl command. ```javascript apiRequest('GET', '/buckets/myBucket/files/myFile.txt'); ``` ```curl curl -X GET http://localhost:8000/buckets/myBucket/files/myFile.txt ``` -------------------------------- ### CORS Configuration for Public Read Access Source: https://docs.akave.xyz/akave-o3/cors/cors-examples Defines a CORS rule allowing GET requests from any origin ('*') for public read access. It sets `AllowedHeaders` to `*` and `MaxAgeSeconds` to 3000, enabling preflight caching for these requests. ```JSON { "CORSRules": [ { "AllowedHeaders": ["*"], "AllowedMethods": ["GET"], "AllowedOrigins": ["*"], "MaxAgeSeconds": 3000 } ] } ``` -------------------------------- ### Create Akave Link Storage Bucket Source: https://docs.akave.xyz/js-docker-example-code Demonstrates how to create a new storage bucket by sending a POST request to the /buckets endpoint. Examples are provided for both the JavaScript API wrapper and a direct curl command. ```javascript apiRequest('POST', '/buckets', { bucketName: 'myBucket' }); ``` ```curl curl -X POST http://localhost:8000/buckets -H "Content-Type: application/json" -d '{"bucketName": "myBucket"}' ``` -------------------------------- ### Check AWS CLI Version Source: https://docs.akave.xyz/akave-o3/troubleshooting/common-issues-and-solutions Provides the command to verify the installed version of the AWS Command Line Interface, useful for identifying compatibility issues that may arise with Akave O3. ```Shell aws --version ``` -------------------------------- ### Verify Rclone Installation Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/rclone This command is used to confirm that Rclone has been successfully installed or upgraded by displaying its version number. It's applicable across different operating systems. ```Shell rclone version ``` -------------------------------- ### Upload File to Akave Link Bucket Source: https://docs.akave.xyz/js-docker-example-code Provides an example of uploading a file to a specified bucket using a JavaScript function with FormData and Axios, along with the equivalent curl command. Notes on minimum and maximum file sizes for testing are included. ```javascript const FormData = require('form-data'); const fs = require('fs'); async function uploadFile(bucketName, filePath) { const form = new FormData(); form.append('file', fs.createReadStream(filePath)); try { const response = await axios.post(`${API_BASE_URL}/buckets/${bucketName}/files`, form, { headers: form.getHeaders(), }); console.log(response.data); } catch (error) { console.error(error.response ? error.response.data : error.message); } } uploadFile('myBucket', './path/to/file.txt'); ``` ```curl curl -X POST http://localhost:8000/buckets/myBucket/files -F file=@/path/to/file.txt ``` -------------------------------- ### List S3 Buckets with AWS CLI and Akave Endpoint Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/snowflake Tests Akave credentials by listing existing S3 buckets. The output should show an empty 'Buckets' array if no buckets are created yet, along with owner details. ```bash aws s3api list-buckets \ --endpoint-url https://o3-rc2.akave.xyz ``` -------------------------------- ### Create S3 Bucket with AWS CLI and Akave Endpoint Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/snowflake Creates a new S3 bucket named 'my-snowflake-bucket' using the AWS CLI, targeting the Akave S3-compatible endpoint. Expects 'make_bucket: my-snowflake-bucket' as output. ```bash aws s3 mb s3://my-snowflake-bucket \ --endpoint-url https://o3-rc2.akave.xyz ``` -------------------------------- ### Copy Data from Snowflake to Akave Stage Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/snowflake Copies data from the 'NATION' table in Snowflake's sample database to the 'my_akave_stage' (Akave bucket) under a 'nation_data/' prefix. The data is formatted as CSV with GZIP compression. ```sql COPY INTO @my_akave_stage/nation_data/ FROM SNOWFLAKE_SAMPLE_DATA.TPCH_SF1.NATION FILE_FORMAT = ( TYPE = CSV COMPRESSION = GZIP FIELD_OPTIONALLY_ENCLOSED_BY = '"' ); ``` -------------------------------- ### Initialize Rclone Configuration for AWS S3 Remote Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/rclone Starts the Rclone interactive configuration wizard specifically for setting up an AWS S3 remote. This is a prerequisite step for migrating data from AWS S3 to Akave O3 using Rclone, with detailed instructions available in Rclone's official documentation. ```Shell rclone config ``` -------------------------------- ### Create Snowflake Stage for Akave S3-Compatible Storage Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/snowflake Defines an external stage in Snowflake named 'my_akave_stage' that points to the Akave S3-compatible bucket. It includes the Akave endpoint URL and AWS credentials for access, enabling directory listing. ```sql CREATE STAGE my_akave_stage URL = 's3compat://my-snowflake-bucket/' ENDPOINT = 'o3-rc2.akave.xyz' CREDENTIALS = (AWS_KEY_ID = '1a2b3c...' AWS_SECRET_KEY = '4x5y6z...') DIRECTORY = ( ENABLE = true ); ``` -------------------------------- ### Apply CORS Configuration via AWS CLI Source: https://docs.akave.xyz/akave-o3/cors/cors-examples Illustrates the AWS CLI command to apply a CORS configuration, saved in `cors.json`, to an Akave O3 bucket. It uses the `put-bucket-cors` command and specifies the target bucket name along with the Akave O3 endpoint URL. ```Bash aws s3api put-bucket-cors \ --bucket my-akave-bucket \ --cors-configuration file://cors.json \ --endpoint-url https://o3-rc1.akave.xyz ``` -------------------------------- ### Rclone Interactive Configuration for Akave S3 Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/rclone Provides a step-by-step guide for interactively setting up a new Rclone remote to connect with Akave S3. This includes specifying the remote name, storage type, credential handling, region, and endpoint details. ```APIDOC rclone config - Select "n" for new remote - Name your remote: Akave - Select storage type: "Amazon S3 Compliant Storage Providers..." - Select provider: "Any other S3 compatible provider" - Get AWS credentials from runtime: false - Enter Access Key ID: - Enter Secret Access Key: - Enter Region: akave-network - Enter Endpoint: https://o3-rc1.akave.xyz - Location Constraint: (leave blank) - ACL: Default - Edit advanced config: No - Keep this remote?: Yes ``` -------------------------------- ### Query Data from Snowflake External Table (Akave) Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/snowflake Executes a simple SELECT query on the 'ext_akave_table', demonstrating direct data retrieval from Akave's decentralized storage via Snowflake's external table feature. ```sql SELECT * FROM ext_akave_table; ``` -------------------------------- ### Upload Object to S3 Bucket with AWS CLI and Akave Endpoint Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/snowflake Uploads a local file named 'myfile.txt' to the 'my-snowflake-bucket' in Akave. The command confirms the upload path upon success. ```bash aws s3 cp ./myfile.txt s3://my-snowflake-bucket/myfile.txt \ --endpoint-url https://o3-rc2.akave.xyz ``` -------------------------------- ### Synchronize Data from Akave S3 to Local Directory Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/snowflake Synchronizes data from the 'nation_data' prefix within the 'my-snowflake-bucket' in Akave to a local directory named 'local-directory'. This command uses the AWS CLI with the Akave endpoint. ```bash aws s3 sync s3://my-snowflake-bucket/nation_data ./local-directory \ --endpoint-url https://o3-rc2.akave.xyz ``` -------------------------------- ### Create Snowflake External Table for Akave Data Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/snowflake Defines an external table 'ext_akave_table' in Snowflake that directly queries data stored in the Akave S3-compatible bucket. It maps CSV columns to Snowflake data types and uses the previously defined file format. Auto-refresh is explicitly disabled for S3-compatible storage. ```sql CREATE OR REPLACE EXTERNAL TABLE ext_akave_table ( N_NATIONKEY NUMBER AS (VALUE:c1::NUMBER), N_NAME STRING AS (VALUE:c2::STRING), N_REGIONKEY NUMBER AS (VALUE:c3::NUMBER), N_COMMENT STRING AS (VALUE:c4::STRING) ) LOCATION = @my_akave_stage/nation_data/ FILE_FORMAT = my_csv_format PATTERN = '.*\.csv\.gz' AUTO_REFRESH = FALSE REFRESH_ON_CREATE = TRUE; ``` -------------------------------- ### Define Snowflake CSV File Format for Akave Data Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/snowflake Creates or replaces a named file format 'my_csv_format' in Snowflake, specifying CSV type, GZIP compression, optional field enclosure, and skipping no header rows. This format is used for reading data from Akave. ```sql CREATE OR REPLACE FILE FORMAT my_csv_format TYPE = CSV COMPRESSION = GZIP FIELD_OPTIONALLY_ENCLOSED_BY = '"' SKIP_HEADER = 0; ``` -------------------------------- ### Download Go for Linux Source: https://docs.akave.xyz/akave-sdk-cli/blockchain-integrated Downloads the Go binary package for Linux AMD64 from the official Go website using `wget`. Users should check the Go website for the latest version if needed. ```bash wget https://go.dev/dl/go1.23.5.linux-amd64.tar.gz ``` -------------------------------- ### Build Akave SDK CLI Binary Source: https://docs.akave.xyz/akave-sdk-cli/blockchain-integrated Builds the Akave SDK command-line interface (CLI) binary using the project's Makefile. The compiled binary will be outputted to the `bin/akavecli` path within the project directory. ```bash make build ``` -------------------------------- ### Build Akave SDK CLI Executable Source: https://docs.akave.xyz/akave-sdk-cli/streaming Builds the Akave SDK CLI binary from the cloned repository's source code. This command compiles the project and outputs the executable file to the `bin/akavecli` directory, making it ready for execution. ```bash make build ``` -------------------------------- ### Set Go Environment Path Source: https://docs.akave.xyz/akave-sdk-cli/blockchain-integrated Adds the Go binary directory (`/usr/local/go/bin`) to the system's PATH environment variable, allowing Go commands to be executed from any location. This line should be added to the user's `~/.bashrc` file for persistence. ```bash export PATH=$PATH:/usr/local/go/bin ``` -------------------------------- ### Make Akave CLI System-Wide Available Source: https://docs.akave.xyz/akave-sdk-cli/blockchain-integrated Moves the compiled `akavecli` binary to a common system-wide directory (`/usr/local/bin/` or `/usr/bin/`) that is typically included in the system's PATH. This allows the CLI to be executed from any location without specifying its full path. Root privileges are required. ```bash sudo mv bin/akavecli /usr/local/bin/ ``` ```bash sudo mv bin/akavecli /usr/bin/ ``` -------------------------------- ### Clone Akave SDK CLI Repository Source: https://docs.akave.xyz/akave-sdk-cli/streaming Clones the Akave SDK CLI repository from GitHub. This is the first step required to build and use the SDK locally, providing access to the source code. ```bash git clone https://github.com/akave-ai/akavesdk.git cd akavesdk ``` -------------------------------- ### Configure Akave MCP Server for Claude Desktop Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/akave-mcp This JSON configuration block defines the Akave MCP server settings for Claude Desktop, specifying the command to execute, its arguments, and environment variables for Akave access keys and endpoint URL. This allows Claude Desktop to interact with Akave storage services. ```JSON { "mcpServers": { "akave": { "command": "npx", "args": [ "-y", "akave-mcp-js" ], "env": { "AKAVE_ACCESS_KEY_ID": "your_access_key", "AKAVE_SECRET_ACCESS_KEY": "your_secret_key", "AKAVE_ENDPOINT_URL": "your_endpoint_url" } } } } ``` -------------------------------- ### Create Akave O3 Buckets using AWS CLI Source: https://docs.akave.xyz/akave-o3/bucket-management/create-list-delete-buckets Demonstrates how to create a new bucket in Akave O3 using both `aws s3api create-bucket` and `aws s3 mb` commands, specifying the Akave O3 endpoint URL. ```aws cli aws s3api create-bucket \ --bucket my-akave-bucket \ --endpoint-url https://o3-rc1.akave.xyz ``` ```aws cli aws s3 mb s3://my-akave-bucket \ --endpoint-url https://o3-rc1.akave.xyz ``` -------------------------------- ### Akave MCP Storage and Object Management Tools Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/akave-mcp This section documents the various Akave MCP tools available for managing storage buckets and objects. It covers operations such as listing, creating, deleting, reading, writing, updating, copying, and generating signed URLs for both buckets and objects, providing a comprehensive interface for Akave storage. ```APIDOC list_buckets: List all buckets in your Akave storage list_objects: List objects in a bucket with optional prefix filtering get_object: Read object contents from a bucket put_object: Write a new object to a bucket get_signed_url: Generate a signed URL for secure access to an object update_object: Update an existing object delete_object: Delete an object from a bucket copy_object: Copy an object to another location create_bucket: Create a new bucket delete_bucket: Delete a bucket get_bucket_location: Get the region/location of a bucket list_object_versions: List all versions of objects (if versioning enabled) ``` -------------------------------- ### Upload File to Akave O3 using Configured AWS CLI Profile Source: https://docs.akave.xyz/akave-o3/troubleshooting/common-issues-and-solutions Demonstrates an AWS CLI `s3 cp` command that leverages a pre-configured profile to upload a file to an Akave O3 bucket, ensuring proper handling of checksum headers and compatibility. ```Shell aws s3 cp ./file.txt s3://my-akave-bucket/ \ --profile o3 \ --endpoint-url https://o3-rc1.akave.xyz ``` -------------------------------- ### Configure Akave MCP Server with JSON Source: https://docs.akave.xyz/akave-o3/solutions-and-integrations/akave-mcp This JSON configuration file (`mcp.json`) sets up the Akave MCP server. It defines the command to execute (`npx akave-mcp-js`) and specifies environment variables for Akave access credentials, including `AKAVE_ACCESS_KEY_ID`, `AKAVE_SECRET_ACCESS_KEY`, and `AKAVE_ENDPOINT_URL`. ```JSON { "mcpServers": { "akave": { "command": "npx", "args": [ "-y", "akave-mcp-js" ], "env": { "AKAVE_ACCESS_KEY_ID": "your_access_key", "AKAVE_SECRET_ACCESS_KEY": "your_secret_key", "AKAVE_ENDPOINT_URL": "your_endpoint_url" } } } } ``` -------------------------------- ### Clone Akave SDK Repository Source: https://docs.akave.xyz/akave-sdk-cli/blockchain-integrated Clones the Akave SDK source code from its GitHub repository and then changes the current directory into the newly cloned `akavesdk` project folder. ```bash git clone https://github.com/akave-ai/akavesdk.git cd akavesdk ``` -------------------------------- ### List Akave O3 Buckets using AWS CLI Source: https://docs.akave.xyz/akave-o3/bucket-management/create-list-delete-buckets Illustrates how to list existing buckets in Akave O3 using both `aws s3api list-buckets` and `aws s3 ls` commands, connecting to the Akave O3 endpoint. ```aws cli aws s3api list-buckets \ --endpoint-url https://o3-rc1.akave.xyz ``` ```aws cli aws s3 ls \ --endpoint-url https://o3-rc1.akave.xyz ``` -------------------------------- ### Manage Multipart Uploads with AWS S3API Commands Source: https://docs.akave.xyz/akave-o3/multipart-uploads/initiate-upload-complete-abort Provides detailed `aws s3api` commands for granular control over multipart uploads. This includes initiating an upload to obtain an `UploadId`, uploading individual file parts, and finally completing the multipart upload by providing a list of uploaded parts and their ETags. This approach requires manual management of the `UploadId` and part details. ```APIDOC aws s3api create-multipart-upload \ --bucket \ --key \ --endpoint-url - Initiates a multipart upload, returning an UploadId. - Parameters: - --bucket: The name of the bucket. - --key: The object key for the file. - --endpoint-url: The service endpoint URL. aws s3api upload-part \ --bucket \ --key \ --part-number \ --body \ --upload-id \ --endpoint-url - Uploads a single part of a multipart upload. - Parameters: - --bucket: The name of the bucket. - --key: The object key for the file. - --part-number: The part number (integer, starting from 1). - --body: The path to the file containing the part data. - --upload-id: The UploadId returned by create-multipart-upload. - --endpoint-url: The service endpoint URL. - Returns: ETag of the uploaded part. aws s3api complete-multipart-upload \ --bucket \ --key \ --upload-id \ --multipart-upload file:// \ --endpoint-url - Completes a multipart upload after all parts have been uploaded. - Parameters: - --bucket: The name of the bucket. - --key: The object key for the file. - --upload-id: The UploadId returned by create-multipart-upload. - --multipart-upload: Path to a JSON file describing the uploaded parts (ETag and PartNumber). - --endpoint-url: The service endpoint URL. - Example parts.json structure: { "Parts": [ { "ETag": "\"etag-part1\"", "PartNumber": 1 }, { "ETag": "\"etag-part2\"", "PartNumber": 2 } ] } ``` -------------------------------- ### Source Shell Configuration File Source: https://docs.akave.xyz/akave-sdk-cli/blockchain-integrated This command reloads the specified shell configuration file (e.g., `.bashrc` or `.zshrc`) in the current shell session. Sourcing the file is necessary to apply any changes made to environment variables, aliases, or functions without requiring a new terminal session or system reboot. It ensures that the newly set `AKAVE_PRIVATE_KEY` is immediately available. ```bash source ~/.bashrc # or source ~/.zshrc ``` -------------------------------- ### Download File from Akave Link Bucket Source: https://docs.akave.xyz/js-docker-example-code Illustrates how to download a file from a specified bucket using a JavaScript function with Axios, saving it to a local directory. Includes the equivalent curl command and notes on direct browser download options. ```javascript async function downloadFile(bucketName, fileName, outputDir) { const fs = require('fs'); try { const response = await axios.get(`${API_BASE_URL}/buckets/${bucketName}/files/${fileName}/download`, { responseType: 'blob', }); console.log(`File downloaded: ${fileName}`); fs.writeFileSync(`./${outputDir}/${fileName}`, response.data); } catch (error) { console.error(error.response ? error.response.data : error.message); } } ``` ```curl curl -X GET http://localhost:8000/buckets/myBucket/files/myFile.txt/download -o myFile.txt ``` -------------------------------- ### Akave CLI IPC Bucket Management Commands Source: https://docs.akave.xyz/akave-sdk-cli/blockchain-integrated Provides a comprehensive overview of `akavecli` commands for managing buckets via the IPC API. These commands enable creating, deleting, viewing, and listing buckets on the Akave network, requiring a private key for authentication. A temporary method for using a keyfile is also provided. ```APIDOC akavecli ipc bucket create --node-address=connect.akave.ai:5500 --private-key="your-private-key" - Creates a new bucket using the IPC API. - Parameters: - : The name of the bucket to create. - --node-address: The public endpoint of the blockchain network (e.g., connect.akave.ai:5500). - --private-key: Your private key for authentication. akavecli ipc bucket delete --node-address=connect.akave.ai:5500 --private-key="your-private-key" - Soft deletes a bucket. - Parameters: - : The name of the bucket to delete. - --node-address: The public endpoint of the blockchain network. - --private-key: Your private key for authentication. akavecli ipc bucket view --node-address=connect.akave.ai:5500 --private-key="your-private-key" - Retrieves details of a specific bucket. - Parameters: - : The name of the bucket to view. - --node-address: The public endpoint of the blockchain network. - --private-key: Your private key for authentication. akavecli ipc bucket list --node-address=connect.akave.ai:5500 --private-key="your-private-key" - Lists all buckets stored in the network. - Parameters: - --node-address: The public endpoint of the blockchain network. - --private-key: Your private key for authentication. To secure your key, you can put it in a keyfile and use this: (temporary until new release) akavecli ipc bucket create --node-address=connect.akave.ai:5500 --private-key "$(cat ~/.key/user.akvf.key)" - Creates a new bucket using a private key stored in a file. - Parameters: - : The name of the bucket to create. - --node-address: The public endpoint of the blockchain network. - --private-key "$(cat ~/.key/user.akvf.key)": Reads the private key from the specified file path. ``` -------------------------------- ### Use Akave CLI with Securely Stored Private Key File Source: https://docs.akave.xyz/akave-sdk-cli/blockchain-integrated Illustrates how to reference a private key stored in a file using command substitution (`$(cat ...)`) for `akavecli` commands. This approach enhances security by keeping the private key out of direct command-line arguments and shell history. ```Shell akavecli ipc bucket create workshop --private-key "$(cat ~/.key/user.akvf.key)" --node-address connect.akave.ai:5500 ``` -------------------------------- ### Pull Akave Link Docker Image Source: https://docs.akave.xyz/js-docker-example-code Pulls the latest Akave Link Docker image from the Akave repository. This is the initial step to set up the Akave Link environment for interacting with the Akave decentralized storage network. ```docker docker pull akave/akavelink:latest ``` -------------------------------- ### Download File using a Presigned URL with cURL Source: https://docs.akave.xyz/akave-o3/presigned-urls/generate-and-use-presigned-urls This command demonstrates how to use a previously generated presigned URL to download a file. Anyone with the URL can access the resource using cURL or by opening it directly in a web browser, enabling secure and temporary file distribution. ```shell curl "https://o3-rc1.akave.xyz/my-akave-bucket/myfile.txt?...signature..." ``` -------------------------------- ### AWS S3 CLI Multipart Upload Commands and Best Practices Source: https://docs.akave.xyz/akave-o3/multipart-uploads/best-practices-for-large-files This section details the recommended AWS S3 CLI commands and associated best practices for managing large file multipart uploads, including setting part sizes, handling ETags, and cleaning up incomplete uploads to optimize performance and prevent orphaned data. ```APIDOC AWS S3 CLI Multipart Upload Commands: aws s3 cp --part-size - Description: Specifies the size of parts for multipart uploads when using the high-level 'cp' command. - Parameters: - : The desired part size, e.g., 64MB. Minimum part size is 5 MB (except the last part). - Usage Example: aws s3 cp large_file.zip s3://mybucket/large_file.zip --part-size 64MB aws s3api upload-part - Description: Uploads a single part of a multipart upload. The returned ETag value must always be recorded as it's required for completion. - Returns: ETag value for the uploaded part. - Usage Context: Used as part of a multi-step multipart upload process, often in scripts or multi-threaded tools. aws s3api complete-multipart-upload - Description: Completes a multipart upload after all parts have been successfully uploaded and their ETags collected. - Parameters: Requires the bucket name, object key, upload ID, and a list of part numbers with their corresponding ETags. - Usage Context: Follows 'upload-part' operations to finalize the file assembly. aws s3api abort-multipart-upload - Description: Aborts an ongoing or failed multipart upload, cleaning up any uploaded parts to prevent orphaned storage and associated costs. - Parameters: Requires the bucket name, object key, and upload ID of the multipart upload to abort. - Usage Context: Recommended for cleanup if a process fails or is interrupted. aws s3api list-multipart-uploads - Description: Lists all in-progress multipart uploads for a given bucket, useful for identifying and cleaning up stale or orphaned uploads. - Parameters: Requires the bucket name. - Returns: A list of multipart uploads, including upload IDs, initiator, and creation date. - Usage Context: Periodically run for maintenance and to ensure efficient resource usage. ``` -------------------------------- ### Securely Create and Configure Akave CLI Private Key File Source: https://docs.akave.xyz/akave-sdk-cli/blockchain-integrated Demonstrates how to create a hidden directory, save your private key content to a file, and set restrictive file permissions (read-only for owner) to protect the key from unauthorized access. This method prevents the key from appearing in shell history. ```Shell mkdir -p ~/.key echo "your-private-key-content" > ~/.key/user.akvf.key chmod 600 ~/.key/user.akvf.key ``` -------------------------------- ### Akave CLI Streaming API: File Management Commands Source: https://docs.akave.xyz/akave-sdk-cli/streaming Details the `akavecli` commands for managing files within buckets via the streaming API. This includes listing files, retrieving metadata, uploading files from a specified path, downloading files to a destination folder, and soft deleting files, leveraging efficient chunking and distribution across nodes. ```APIDOC akavecli files-streaming list [--node-address=
] - Description: Lists all files in a specific bucket. - Parameters: - : (string, required) The name of the bucket. - --node-address: (string, optional) The Akave node address (e.g., 'connect.akave.ai:5000'). akavecli files-streaming info [--node-address=
] - Description: Retrieves metadata of a specific file. - Parameters: - : (string, required) The name of the bucket. - : (string, required) The name of the file. - --node-address: (string, optional) The Akave node address. akavecli files-streaming upload [--node-address=
] - Description: Uploads a file by specifying its local path. - Parameters: - : (string, required) The name of the target bucket. - : (string, required) The local path to the file to upload. - --node-address: (string, optional) The Akave node address. akavecli files-streaming download [--node-address=
] - Description: Downloads a file to a specified destination folder. - Parameters: - : (string, required) The name of the source bucket. - : (string, required) The name of the file to download. - : (string, required) The local path where the file will be saved. - --node-address: (string, optional) The Akave node address. akavecli files-streaming delete [--node-address=
] - Description: Soft deletes a specific file from a bucket. - Parameters: - : (string, required) The name of the bucket. - : (string, required) The name of the file to delete. - --node-address: (string, optional) The Akave node address. ``` -------------------------------- ### Set User Encryption Key from File in Shell Source: https://docs.akave.xyz/akave-o3/encryption/key-management-options This snippet demonstrates how to load an encryption key from a file into an environment variable in a Unix-like shell environment. This variable can then be used by client-side encryption tools before uploading data to Akave O3, ensuring the key is not hardcoded directly in scripts. ```Shell export USER_ENCRYPTION_KEY="$(cat ~/.key/encryption.key)" ``` -------------------------------- ### Run Akave Link Docker Container Source: https://docs.akave.xyz/js-docker-example-code Command to run the Akave Link Docker container in detached mode, mapping port 8000 to 3000 and setting environment variables for the public node address and private key. This makes the API accessible locally. ```docker docker run -d \ -p 8000:3000 \ -e NODE_ADDRESS="public_node_address" \ -e PRIVATE_KEY="your_private_key" \ akave/akavelink:latest ``` -------------------------------- ### Akave O3 S3-Compatible API Endpoints Source: https://docs.akave.xyz/akave-o3/introduction/akave-environment This table details the currently supported Akave O3 regions and their corresponding S3-compatible API endpoints, outlining their purpose for different network interactions. ```APIDOC | Region | Purpose | API Type | Endpoint URL | |--------------|---------------------|--------------|------------------------------| | us-south-1 | Blockchain IPC API | S3-Compatible| https://o3-rc1.akave.xyz | | us-central-1 | Streaming API | S3-Compatible| https://o3-rc2.akave.xyz | ``` -------------------------------- ### Akave CLI Streaming API: Bucket Management Commands Source: https://docs.akave.xyz/akave-sdk-cli/streaming Documents the `akavecli` commands for managing buckets using the streaming API. These operations allow direct interaction with the Akave node for creating, viewing, listing, and soft deleting buckets, without relying on blockchain-based operations. ```APIDOC akavecli bucket create [--node-address=
] - Description: Creates a new bucket. - Parameters: - : (string, required) The name of the bucket to create. - --node-address: (string, optional) The Akave node address (e.g., 'localhost:5000' or 'connect.akave.ai:5000'). akavecli bucket view [--node-address=
] - Description: Retrieves details of a specific bucket. - Parameters: - : (string, required) The name of the bucket to view. - --node-address: (string, optional) The Akave node address. akavecli bucket list [--node-address=
] - Description: Lists all available buckets. - Parameters: - --node-address: (string, optional) The Akave node address. akavecli bucket delete [--node-address=
] - Description: Soft deletes a specific bucket. - Parameters: - : (string, required) The name of the bucket to delete. - --node-address: (string, optional) The Akave node address. ``` -------------------------------- ### Perform Automatic Multipart Upload with AWS S3 CP Source: https://docs.akave.xyz/akave-o3/multipart-uploads/initiate-upload-complete-abort Demonstrates how the high-level `aws s3 cp` command automatically handles multipart uploads for large files (typically 8 MB+), simplifying the process by abstracting away the need to manage `UploadId`, parts, or ETags. It uses a specified endpoint URL for Akave O3 compatibility. ```bash aws s3 cp ./largefile.zip s3://my-akave-bucket/largefile.zip \ --endpoint-url https://o3-rc1.akave.xyz ``` -------------------------------- ### Manage Akave CLI Private Key via Environment Variable Source: https://docs.akave.xyz/akave-sdk-cli/blockchain-integrated Provides steps to temporarily store the private key in an environment variable, use it in `akavecli` commands, and then clear it from memory. This offers an alternative secure method for session-based operations, ensuring the key is not persisted. ```Shell export AKAVE_PRIVATE_KEY="$(cat ~/.key/user.akvf.key)" akavecli ipc bucket create workshop --private-key "$AKAVE_PRIVATE_KEY" --node-address connect.akave.ai:5500 unset AKAVE_PRIVATE_KEY ``` -------------------------------- ### Set Akave Private Key Environment Variable Source: https://docs.akave.xyz/akave-sdk-cli/blockchain-integrated This command exports the content of the `~/.key/user.akvf.key` file as the `AKAVE_PRIVATE_KEY` environment variable. It uses command substitution (`$()`) to read the file's content securely, preventing the key from being exposed directly in the command history. This method is recommended for persistent and secure access to the private key across shell sessions. ```bash export AKAVE_PRIVATE_KEY="$(cat ~/.key/user.akvf.key)" ``` -------------------------------- ### Enable Versioning on an Akave O3 Bucket using AWS CLI Source: https://docs.akave.xyz/akave-o3/object-management/object-versioning-and-copying This command enables versioning on a specified Akave O3 bucket, allowing for the preservation of object history. It uses `aws s3api` as `aws s3` does not directly support versioning configuration. ```aws cli aws s3api put-bucket-versioning \ --bucket my-akave-bucket \ --versioning-configuration Status=Enabled \ --endpoint-url https://o3-rc1.akave.xyz ``` -------------------------------- ### Copy Objects in Akave O3 using AWS CLI Source: https://docs.akave.xyz/akave-o3/object-management/object-versioning-and-copying This section provides commands to copy objects within the same Akave O3 bucket or across different buckets. Both `aws s3api` and `aws s3` commands are shown for various copy scenarios, offering flexibility based on specific needs. ```aws cli aws s3api copy-object \ --bucket my-akave-bucket \ --copy-source my-akave-bucket/myfile.txt \ --key myfile-copy.txt \ --endpoint-url https://o3-rc1.akave.xyz ``` ```aws cli aws s3 cp s3://my-akave-bucket/myfile.txt s3://my-akave-bucket/myfile-copy.txt \ --endpoint-url https://o3-rc1.akave.xyz ``` ```aws cli aws s3 cp s3://source-bucket/myfile.txt s3://destination-bucket/myfile-copy.txt \ --endpoint-url https://o3-rc1.akave.xyz ``` -------------------------------- ### Validate Akave O3 Uploads with AWS CLI Source: https://docs.akave.xyz/akave-o3/multipart-uploads/best-practices-for-large-files This snippet provides AWS CLI commands to verify the existence of an uploaded object in Akave O3 (S3-compatible storage) after a multipart upload. It includes commands for checking object metadata and listing directory contents to confirm successful upload. ```Bash aws s3api head-object aws s3 ls ```