Skip to content

catcatio/ipfs-gcs-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ipfs-gcs-example

An example of IPFS backed by Google Cloud Storage

express.js, ipfs, gcs, openpgp

Run

Create a .env file, see .env.sample

NODE_ENV=development

GOOGLE_APPLICATION_CREDENTIALS=serviceAccountKey.json

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 Google Cloud Storage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published