holepunchto / corestore

A simple corestore that wraps a random-access-storage module
https://docs.holepunch.to
MIT License
74 stars 28 forks source link

Add ability to create a namespace from a bootstrap core #47

Closed andrewosh closed 1 year ago

andrewosh commented 1 year ago

Creating a bootstrap core from a random namespace is a pretty common Corestore pattern. Later, when reloading cores from the bootstrap key, one has to read the namespace userdata from the bootstrap core in order to re-create the same namespace.

This PR adds the ability to pass a bootstrap core to store.namespace. This will open a namespace that's identical to the one that was used to initially create the bootstrap core.