Skip to content

catcatio/ipfs-s3-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ipfs-s3-example

An example of IPFS backed by AWS S3

express.js, ipfs, s3, openpgp

Run

Create a .env file, see .env.sample

NODE_ENV=development

AWS_ACCESSKEY=<AWS_ACCESSKEY>
AWS_SECRET_ACCESSKEY=<AWS_SECRET_ACCESSKEY>

S3_BUCKET_NAME=ipfs-example
IPFS_REPO_LOCK_NAME=ipfs-example-20181112
IPFS_REPO_PATH=/

PORT=3000
FILE_KEY=<system wide filekey>

Run with container

docker-compose up

Run locally

npm i
npm run dev

API

upload

curl -F "upload=/path/to/file" -X "POST" -i http://localhost:3000/upload

download

curl http://localhost:3000/download/ipfs/QmdSEXaUoCAtvFLDZ1DNAjmHJjvXmnHeYFK7R5CWuEu8ZB

upload with encryption

# with default file key
curl -F "upload=/path/to/file" -X "POST" -i http://localhost:3000/s-upload

# with custom file key
curl -F "upload=/path/to/file" -X "POST" -i http://localhost:3000/s-upload?fileKey=2609a2251e2a1a934a99539ba54d6e55

download with encryption

# with default file key
curl http://localhost:3000/s-download/ipfs/QmX44ww41WYnzApw6rGvgGXwZdM1xnh4wPv7AHtQYqWdK1

# with custom file key
curl http://localhost:3000/s-download/ipfs/QmX44ww41WYnzApw6rGvgGXwZdM1xnh4wPv7AHtQYqWdK1?fileKey=2609a2251e2a1a934a99539ba54d6e55

About

An example of IPFS backed by AWS S3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published