Skip to content

This repo builds a Docker image that runs a js-ceramic compatible version of go-ipfs.

Notifications You must be signed in to change notification settings

ceramicnetwork/go-ipfs-daemon

Repository files navigation

go-ipfs-daemon

WIP

This repo builds a Docker image that runs a js-ceramic compatible version of go-ipfs.

The go-ipfs daemon that this image runs supports resolving dag-jose objects, using S3 for a sharded datastore, and serving a healthcheck endpoint.

Usage

Simply pull the ceramicnetwork/go-ipfs-daemon image from Dockerhub

docker pull ceramicnetwork/go-ipfs-daemon

Or you can download the source code and build the image on your machine

git clone <this_repo_url>

cd go-ipfs-daemon

docker build . -t go-ipfs-daemon

Run a container

docker run \
  -p 5001:5001 \ # API port
  -p 8011:8011 # Healthcheck port
  go-ipfs-daemon

You may want to use S3 for the IPFS Blockstore. See the go-ds-s3 plugin for more configuration details.

# Fill in your credentials below
docker run \
  -p 5001:5001 \ # API port
  -p 8011:8011 \ # Healthcheck port
  -e IPFS_ENABLE_S3=true \
  -e IPFS_S3_REGION= \
  -e IPFS_S3_BUCKET_NAME= \
  -e IPFS_S3_ROOT_DIRECTORY= \
  -e IPFS_S3_ACCESS_KEY_ID= \
  -e IPFS_S3_SECRET_ACCESS_KEY= \
  -e IPFS_S3_KEY_TRANSFORM=next-to-last/2 \
  go-ipfs-daemon

# Get the container id
docker ps

# Run ipfs commands
docker exec -i <container_id> sh -c "ipfs version"

AWS IAM permissions

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "s3:GetObject",
                "s3:ListBucket",
                "s3:PutObject",
                "s3:DeleteObject"
            ],
            "Effect": "Allow",
            "Resource": [
                "arn:aws:s3:::bucket_name",
                "arn:aws:s3:::bucket_name/*"
            ]
        }
    ]
}

Maintainer

@v-stickykeys

Contributing

We are happy to accept small and large contributions.

  1. Clone this repository
  2. cd go-ipfs-daemon
  3. Install pre-commit. E.g. brew install pre-commit
  4. Run pre-commit install

Testing

./test/bats/bin/bats test

License

Dual-licensed under Apache 2.0 and MIT terms: