An example of IPFS backed by AWS S3
express.js, ipfs, s3, openpgp
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>
docker-compose up
npm i
npm run dev
curl -F "upload=/path/to/file" -X "POST" -i http://localhost:3000/upload
curl http://localhost:3000/download/ipfs/QmdSEXaUoCAtvFLDZ1DNAjmHJjvXmnHeYFK7R5CWuEu8ZB
# 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
# 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