blockstore-core

Contains various implementations of the API contract described in interface-blockstore

Usage no npm install needed!

<script type="module">
  import blockstoreCore from 'https://cdn.skypack.dev/blockstore-core';
</script>

README

js-blockstore-core

codecov GitHub Workflow Status

Contains various implementations of the API contract described in interface-blockstore

Table of Contents

Implementations

Install

$ npm install blockstore-core

Usage

BaseBlockstore

Provides a complete implementation of the Blockstore interface. You must implement .get, .put, etc.

import { BaseBlockstore } from 'blockstore-core/base'

class MyCustomBlockstore extends BaseBlockstore {
  put (key, val, options) {
    // store a block
  }

  get (key, options) {
    // retrieve a block
  }

  // ...etc
}

MemoryBlockstore

A simple Blockstore that stores blocks in memory.

import { MemoryBlockstore } from 'blockstore-core/memory'

const store = new MemoryBlockstore()

Contribute

Feel free to join in. All welcome. Open an issue!

This repository falls under the IPFS Code of Conduct.

License

Apache-2.0 OR MIT