Thanks to visit codestin.com
Credit goes to github.com

Skip to content

dylanfu/akavelink

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Akave Link API

A containerized API service for interacting with Akave's decentralized storage network.

Quick Start

1. Pull the Akavelink docker image

docker pull akave/akavelink:latest

2. Get Node Address

Contact Akave team to receive your dedicated node address.

3. Run the container to serve a personal api

docker run -d \
-p 8000:3000 \
-e NODE_ADDRESS="your_node_address" \
-e PRIVATE_KEY="your_private_key" \
akave/akavelink:latest

Environment Variables

Variable Description Required Default
NODE_ADDRESS Akave node address (contact team) Yes ""
PRIVATE_KEY Your Akave private key Yes ""
PORT API server port No 3000

API Documentation

Bucket Operations

Create Bucket

POST /buckets

Create a new bucket for file storage.

Request Body:

{
    "bucketName": "string"
}

Response:

{
    "success": true,
    "data": {
        "Name": "string",
        "Created": "timestamp"
    }
}

List Buckets

GET /buckets

Retrieve a list of all buckets.

Response:

{
    "success": true,
    "data": [
        {
            "Name": "string",
            "Created": "timestamp"
        }
    ]
}

View Bucket

GET /buckets/:bucketName

Get details of a specific bucket.

Response:

{
    "success": true,
    "data": {
        "Name": "string",
        "Created": "timestamp"
    }
}

File Operations

List Files

GET /buckets/:bucketName/files

List all files in a specific bucket.

Response:

{
    "success": true,
    "data": [
        {
            "Name": "string",
            "Size": "number",
            "Created": "timestamp"
        }
    ]
}

Get File Info

GET /buckets/:bucketName/files/:fileName

Get metadata about a specific file.

Response:

{
    "success": true,
    "data": {
        "Name": "string",
        "Size": "number",
        "Created": "timestamp"
    }
}

Upload File

POST /buckets/:bucketName/files

Upload a file to a specific bucket.

Request:

  • Content-Type: multipart/form-data
  • Body:
    • file or file1: File to upload OR
    • filePath: Path to file on server

Response:

{
    "success": true,
    "data": {
        "Name": "string",
        "Size": "number",
        "Hash": "string"
    }
}

Download File

GET /buckets/:bucketName/files/:fileName/download

Download a file from a specific bucket.

Usage: Access this URL directly in your browser to download the file. The file will be automatically downloaded with its original filename.

Response:

  • Success: File download will begin automatically
  • Error:
{
    "success": false,
    "error": "error message"
}

Error Responses

All endpoints will return the following format for errors:

{
    "success": false,
    "error": "error message"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 95.0%
  • Dockerfile 5.0%