Skip to content

postfiatorg/ipfs-gcs

Repository files navigation

ipfs-gcs-example

CI Docker Deploy License: MIT

IPFS implementation with Google Cloud Storage backend using Helia, Express.js, and Docker.

Features

  • IPFS file storage using Helia (modern IPFS implementation)
  • Google Cloud Storage as persistent block storage
  • REST API for file upload/download
  • Docker Compose setup for easy deployment
  • Memory cache with GCS fallback for optimal performance
  • Kubernetes-ready for production deployment

Quick Start

Local Development

# Clone the repository
git clone https://github.com/allenday/ipfs-gcs-example.git
cd ipfs-gcs-example

# Copy environment variables
cp .env.example .env

# Add your GCS service account key
# Edit .env with your bucket name

# Run with Docker Compose
docker compose up

See DEVELOPMENT.md for detailed development setup.

Production Deployment

# Quick deploy to Kubernetes
kubectl create secret generic gcs-key --from-file=key.json=serviceAccountKey.json
kubectl apply -f k8s/

See PRODUCTION.md for detailed production deployment guide.

API Usage

Upload File

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

Download File

curl http://localhost:3000/download/ipfs/[hash]

Health Check

curl http://localhost:3000/health

Architecture

The application uses:

  • Helia: Modern IPFS implementation for content addressing
  • Custom GCS Blockstore: Stores IPFS blocks in Google Cloud Storage
  • Express.js: Lightweight REST API server
  • Docker: Containerized deployment

All uploaded files are content-addressed using IPFS and stored as blocks in your GCS bucket under the blocks/ prefix.

Development

Quick Commands

# Show all available commands
make help

# Start development environment
make dev

# Run full CI pipeline locally
make ci

# Build and test Docker image
make docker-build docker-test

# Get deployed environment URLs
make get-staging-url
make get-prod-url

# Run smoke tests against deployed environments
make smoke-test-staging
make smoke-test-prod

# Set up branch protection (one-time setup)
make setup-branch-protection

Documentation

License

MIT


Based on original work from catcatio/ipfs-gcs

About

IPFS backed by Google Cloud Storage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •