Skip to content

IPFS datastore implementation with S3 backend and node-cache to handle p2p traffic "has" requests.

License

Notifications You must be signed in to change notification settings

scmilee/cached-js-datastore-s3

 
 

Repository files navigation

js-datastore-s3

standard-readme compliant Build Status codecov Coverage Status Dependency Status js-standard-style

Datastore implementation backed by s3.

Lead Maintainer

Jacob Heun

Table of Contents

Install

$ npm install datastore-s3

Usage

If the flag createIfMissing is not set or is false, then the bucket must be created prior to using datastore-s3. Please see the AWS docs for information on how to configure the S3 instance. A bucket name is required to be set at the s3 instance level, see the below example.

const S3 = require('aws-sdk').S3
const s3Instance = new S3({ params: { Bucket: 'my-ipfs-bucket' } })
const S3Store = require('datastore-s3')
const store = new S3Store('.ipfs/datastore', {
  s3: s3Instance
  createIfMissing: false
})

Create a Repo

You can quickly create an S3 backed repo using the createRepo convenience function.

const IPFS = require('ipfs')
const { createRepo } = require('datastore-s3')

const ipfs = new IPFS({
  repo: createRepo({
    path: '/my/ipfs'
  }, {
    bucket: 'MyS3Bucket'
  })
})

Examples

You can see examples of S3 backed ipfs in the examples folder

Contribute

PRs accepted.

Small note: If editing the Readme, please conform to the standard-readme specification.

License

MIT 2018 © IPFS

About

IPFS datastore implementation with S3 backend and node-cache to handle p2p traffic "has" requests.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%