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

Multistore uses go-datastore and namespaces to simulate having multiple storage instances

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

filecoin-project/go-multistore

Repository files navigation

go-fil-markets

CircleCI codecov GoDoc

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/filecoin-project/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()

Contributing

Issues and PRs are welcome! Please first read the background reading and CONTRIBUTING guide, and look over the current code. PRs against master require approval of at least two maintainers.

Day-to-day discussion takes place in the #fil-components channel of the Filecoin project chat. Usage or design questions are welcome.

Project-level documentation

The filecoin-project has a community repo with more detail about our resources and policies, such as the Code of Conduct.

License

This repository is dual-licensed under Apache 2.0 and MIT terms.

Copyright 2020. Protocol Labs, Inc.

About

Multistore uses go-datastore and namespaces to simulate having multiple storage instances

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages