Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Latest commit

 

History

History
57 lines (39 loc) · 1.22 KB

README.md

File metadata and controls

57 lines (39 loc) · 1.22 KB

go-multistore

This repository provides a mechanism for constructing multiple, isolated, IPFS storage instances (blockstore, filestore, DAGService) on top of a single go-datastore instance.

Background reading

You may want to familiarize yourself with various IPFS storage layer components:

Installation

go get "github.com/myelnet/go-multistore"`

Usage

Initialize multistore:

var ds datastore.Batching
multiDs, err := multistore.NewMultiDstore(ds)

Create new store:

next := multiDs.Next()
store, err := multiDs.Get(store)

// store will have a blockstore, filestore, and DAGService

List existing store indexes:

indexes := multiDs.List()

Delete a store (will delete all data in isolated store without touching the rest of the datastore):

var index int
err := multiDs.Delete(index)

Shutdown (make sure everything is closed):

multiDs.Close()