Home Guides Protocol Install Awesome Hacks
Guides Modules Corestore

Corestore

API Docs https://github.com/hypercore-protocol/corestore
Depends On hypercore
Used By hyperspace, hyperdrive

A Hypercore factory and a set of associated functions for managing generated Hypercores.

const Corestore = require('corestore')
const ram = require('random-access-memory')
const store = new Corestore(ram)
await store.ready()

// create a hypercore
const core1 = store.get()

// load an existing hypercore
const core2 = store.get({ key: Buffer(...) })

A corestore is designed to efficiently store and replicate multiple sets of interlinked Hypercores, such as those used by Hyperdrive and mountable-hypertrie, removing the responsibility of managing custom storage/replication code from these higher-level modules.