Simple content-addressable storage (CAS) based on AWS S3.
put: (block: { cid: any, bytes: Uint8Array }) => Promise<void>
get: (cid: any) => Promise<Uint8Array>
import AWS from 'aws-sdk'
import { blockStore } from '@dstanesc/s3-block-store'
AWS.config.update({region: 'us-east-1'})
const s3 = new AWS.S3()
const cache = {}
// bucket configured in https://s3.console.aws.amazon.com/s3/buckets
const bucket = ...
// s3-block-store api
const { get, put } = blockStore({ /*cache,*/ s3, bucket });
npm run clean
npm install
npm run build
AWS storage configuration and security credentials
export AWS_BUCKET_NAME=...
export AWS_REGION=...
export AWS_SECRET_ACCESS_KEY=...
export AWS_ACCESS_KEY_ID=...
npm run test
Licensed under either Apache 2.0 or MIT at your option.