This project provides an S3-compatible Node.js file storage server that interacts with the Jackal filesystem. The server supports operations like creating buckets, uploading files, downloading files, listing files, and deleting files, all secured with simple authentication.
- S3-compatible API endpoints
- Authentication using
ACCESS_KEY_ID
andSECRET_ACCESS_KEY
- File operations are performed directly on the Jackal filesystem
- Node.js and npm
- A Jackal mnemonic and network information
-
Clone the repository:
git clone https://github.com/yourusername/jackal-s3-server.git cd jackal-s3-server
-
Install the required packages:
npm install
-
Create a .env file in the root directory with the following content:
SIGNER_CHAIN=lupulella-2 MNEMONIC=your_jackal_mnemonic QUERY_ADDR=https://testnet-grpc.jackalprotocol.com TX_ADDR=https://testnet-rpc.jackalprotocol.com ACCESS_KEY_ID=your_access_key_id SECRET_ACCESS_KEY=your_secret_access_key
Start the server with:
node server.js
GET /
curl -H "x-access-key-id: your_access_key_id" -H "x-secret-access-key: your_secret_access_key" http://localhost:3000/
PUT /:bucket
curl -X PUT -H "x-access-key-id: your_access_key_id" -H "x-secret-access-key: your_secret_access_key" http://localhost:3000/your-bucket-name
GET /:bucket
curl -H "x-access-key-id: your_access_key_id" -H "x-secret-access-key: your_secret_access_key" http://localhost:3000/your-bucket-name
PUT /:bucket/:key
curl -X PUT -H "x-access-key-id: your_access_key_id" -H "x-secret-access-key: your_secret_access_key" -F "file=@/path/to/your/file" http://localhost:3000/your-bucket-name/your-file-name
GET /:bucket/:key
curl -H "x-access-key-id: your_access_key_id" -H "x-secret-access-key: your_secret_access_key" -o /path/to/save/file http://localhost:3000/your-bucket-name/your-file-name
DELETE /:bucket/:key
curl -X DELETE -H "x-access-key-id: your_access_key_id" -H "x-secret-access-key: your_secret_access_key" http://localhost:3000/your-bucket-name/your-file-name