@dstanesc/ipfs-block-store
v0.0.9
Published
Simple content-addressable storage (CAS) based on IPFS
Downloads
68
Readme
IPFS Block Store
Simple content-addressable storage (CAS) based on IPFS and powered by the ipfs-client.
API
put: (block: { cid: any, bytes: Uint8Array }) => Promise<void>
get: (cid: any) => Promise<Uint8Array>
Usage
import { blockStore } from '@dstanesc/ipfs-block-store'
// ipfs api
import { create as ipfsApi } from 'ipfs-http-client'
// connect to a local ipfs service
const ipfs = ipfsApi({ url: '/ip4/192.168.1.231/tcp/5001' })
// optional cache
const cache = {}
// ipfs-block-store api
const { get, put } = blockStore({ /*cache,*/ ipfs })
Build
npm run clean
npm install
npm run build
npm run test
Licenses
Licensed under either Apache 2.0 or MIT at your option.