Skip to content

Commit

Permalink
feat: add all blockstore and datastore implementations (#197)
Browse files Browse the repository at this point in the history
Move all block and datastores into the monorepo for ease of release
  • Loading branch information
achingbrain authored Mar 23, 2023
1 parent 5230741 commit 0d85128
Show file tree
Hide file tree
Showing 147 changed files with 10,696 additions and 51 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# ipfs-interfaces <!-- omit in toc -->
# stores <!-- omit in toc -->

[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-ipfs-interfaces.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-ipfs-interfaces)
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/js-ipfs-interfaces/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/ipfs/js-ipfs-interfaces/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)
[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-stores.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-stores)
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/js-stores/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/ipfs/js-stores/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)

> TypeScript interfaces used by IPFS internals
> Blockstores and datastores used by IP-JS internals
## Table of contents <!-- omit in toc -->

Expand All @@ -17,6 +17,16 @@

## Structure

- [`/packages/blockstore-core`](./packages/blockstore-core) Contains various implementations of the API contract described in interface-blockstore
- [`/packages/blockstore-fs`](./packages/blockstore-fs) Blockstore implementation with file system backend
- [`/packages/blockstore-idb`](./packages/blockstore-idb) Blockstore implementation with IndexedDB backend
- [`/packages/blockstore-level`](./packages/blockstore-level) Blockstore implementation with level(up|down) backend
- [`/packages/blockstore-s3`](./packages/blockstore-s3) IPFS blockstore implementation backed by s3
- [`/packages/datastore-core`](./packages/datastore-core) Wrapper implementation for interface-datastore
- [`/packages/datastore-fs`](./packages/datastore-fs) Datastore implementation with file system backend
- [`/packages/datastore-idb`](./packages/datastore-idb) Datastore implementation with IndexedDB backend.
- [`/packages/datastore-level`](./packages/datastore-level) Datastore implementation with level(up|down) backend
- [`/packages/datastore-s3`](./packages/datastore-s3) IPFS datastore implementation backed by s3
- [`/packages/interface-blockstore`](./packages/interface-blockstore) An interface for storing and retrieving blocks
- [`/packages/interface-blockstore-tests`](./packages/interface-blockstore-tests) Compliance tests for the blockstore interface
- [`/packages/interface-datastore`](./packages/interface-datastore) datastore interface
Expand All @@ -29,7 +39,7 @@ See the [./packages](./packages) directory for the various interfaces.

## API Docs

- <https://ipfs.github.io/js-ipfs-interfaces>
- <https://ipfs.github.io/js-stores>

## License

Expand All @@ -40,7 +50,7 @@ Licensed under either of

## Contribute

Contributions welcome! Please check out [the issues](https://github.com/ipfs/js-ipfs-interfaces/issues).
Contributions welcome! Please check out [the issues](https://github.com/ipfs/js-stores/issues).

Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "ipfs-interfaces",
"name": "stores",
"version": "1.0.0",
"description": "TypeScript interfaces used by IPFS internals",
"description": "Blockstores and datastores used by IP-JS internals",
"license": "Apache-2.0 OR MIT",
"homepage": "https://github.com/ipfs/js-ipfs-interfaces#readme",
"homepage": "https://github.com/ipfs/js-stores#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/ipfs/js-ipfs-interfaces.git"
"url": "git+https://github.com/ipfs/js-stores.git"
},
"bugs": {
"url": "https://github.com/ipfs/js-ipfs-interfaces/issues"
"url": "https://github.com/ipfs/js-stores/issues"
},
"engines": {
"node": ">=16.0.0",
Expand Down
97 changes: 97 additions & 0 deletions packages/blockstore-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
## [4.0.2](https://github.com/ipfs/js-blockstore-core/compare/v4.0.1...v4.0.2) (2023-03-23)


### Dependencies

* update interface-store to 5.x.x ([#74](https://github.com/ipfs/js-blockstore-core/issues/74)) ([32e0e52](https://github.com/ipfs/js-blockstore-core/commit/32e0e52e87c1ec9c245edeec20b3df369d479034))

## [4.0.1](https://github.com/ipfs/js-blockstore-core/compare/v4.0.0...v4.0.1) (2023-03-14)


### Bug Fixes

* add errors for get and has failed ([#71](https://github.com/ipfs/js-blockstore-core/issues/71)) ([cd990dd](https://github.com/ipfs/js-blockstore-core/commit/cd990dd6ebd4cb0d399b225e501365a3b8653f67))

## [4.0.0](https://github.com/ipfs/js-blockstore-core/compare/v3.0.0...v4.0.0) (2023-03-13)


### ⚠ BREAKING CHANGES

* `interface-blockstore@5` removes query/batch methods and adds getAll

### Features

* update to latest blockstore interface ([#70](https://github.com/ipfs/js-blockstore-core/issues/70)) ([273397d](https://github.com/ipfs/js-blockstore-core/commit/273397d7fca96db8cf95afc07ed0ea1a7d4239f3))

## [3.0.0](https://github.com/ipfs/js-blockstore-core/compare/v2.0.2...v3.0.0) (2023-01-06)


### ⚠ BREAKING CHANGES

* update blockstore deps (#59)

### Dependencies

* update blockstore deps ([#59](https://github.com/ipfs/js-blockstore-core/issues/59)) ([0299bf5](https://github.com/ipfs/js-blockstore-core/commit/0299bf558bc7f2ff3d63ce69a4dee55775f4389a))

## [2.0.2](https://github.com/ipfs/js-blockstore-core/compare/v2.0.1...v2.0.2) (2022-10-14)


### Dependencies

* bump multiformats from 9.9.0 to 10.0.0 ([#49](https://github.com/ipfs/js-blockstore-core/issues/49)) ([65b9c3f](https://github.com/ipfs/js-blockstore-core/commit/65b9c3ffeb0d1db1e13ee31104cf693aece9fc28))

## [2.0.1](https://github.com/ipfs/js-blockstore-core/compare/v2.0.0...v2.0.1) (2022-08-13)


### Dependencies

* bump interface-blockstore from 2.0.3 to 3.0.0 ([#41](https://github.com/ipfs/js-blockstore-core/issues/41)) ([be1323a](https://github.com/ipfs/js-blockstore-core/commit/be1323a7c4f6deb9d19163c3f6d3ecd57296a25c))
* bump interface-store from 2.0.2 to 3.0.0 ([#42](https://github.com/ipfs/js-blockstore-core/issues/42)) ([54caf74](https://github.com/ipfs/js-blockstore-core/commit/54caf748cf4277abb7f82a1eefb91bd48141c307))
* **dev:** bump interface-blockstore-tests from 2.0.4 to 3.0.0 ([#44](https://github.com/ipfs/js-blockstore-core/issues/44)) ([232033d](https://github.com/ipfs/js-blockstore-core/commit/232033db6a8204e2852d4ad29e6d4ff8d1c9a685))

## [2.0.0](https://github.com/ipfs/js-blockstore-core/compare/v1.0.5...v2.0.0) (2022-08-13)


### ⚠ BREAKING CHANGES

* this module is now ESM-only

### Features

* publish as ESM-only ([#45](https://github.com/ipfs/js-blockstore-core/issues/45)) ([01009f6](https://github.com/ipfs/js-blockstore-core/commit/01009f683bbc8b50c202919c448dc0d4cbb86249))


### Trivial Changes

* Update .github/workflows/stale.yml [skip ci] ([9e7d0d6](https://github.com/ipfs/js-blockstore-core/commit/9e7d0d6a2e2900b7739a956c371a3a0dcb623f92))

### [1.0.5](https://github.com/ipfs/js-blockstore-core/compare/v1.0.4...v1.0.5) (2022-01-07)


### Bug Fixes

* add semantic release config ([#13](https://github.com/ipfs/js-blockstore-core/issues/13)) ([de1e758](https://github.com/ipfs/js-blockstore-core/commit/de1e758decc2af2ec5e85e99c9b05d2110ade86f))

## [1.0.2](https://github.com/ipfs/js-blockstore-core/compare/v1.0.1...v1.0.2) (2021-09-09)



## [1.0.1](https://github.com/ipfs/js-blockstore-core/compare/v1.0.0...v1.0.1) (2021-09-09)



# [1.0.0](https://github.com/ipfs/js-blockstore-core/compare/v0.0.2...v1.0.0) (2021-09-09)



## [0.0.2](https://github.com/ipfs/js-blockstore-core/compare/v0.0.1...v0.0.2) (2021-09-09)


### Bug Fixes

* add types versions ([#1](https://github.com/ipfs/js-blockstore-core/issues/1)) ([fa8ce28](https://github.com/ipfs/js-blockstore-core/commit/fa8ce287da9e2528f7581151e6fa3ac86fcd4196))



## 0.0.1 (2021-09-09)
4 changes: 4 additions & 0 deletions packages/blockstore-core/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This project is dual licensed under MIT and Apache-2.0.

MIT: https://www.opensource.org/licenses/mit
Apache-2.0: https://www.apache.org/licenses/license-2.0
5 changes: 5 additions & 0 deletions packages/blockstore-core/LICENSE-APACHE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
19 changes: 19 additions & 0 deletions packages/blockstore-core/LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
94 changes: 94 additions & 0 deletions packages/blockstore-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# blockstore-core <!-- omit in toc -->

[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-stores.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-stores)
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/js-stores/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/ipfs/js-stores/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)

> Contains various implementations of the API contract described in interface-blockstore
## Table of contents <!-- omit in toc -->

- [Install](#install)
- [Browser `<script>` tag](#browser-script-tag)
- [Implementations](#implementations)
- [Usage](#usage)
- [BaseBlockstore](#baseblockstore)
- [MemoryBlockstore](#memoryblockstore)
- [API Docs](#api-docs)
- [License](#license)
- [Contribute](#contribute)

## Install

```console
$ npm i blockstore-core
```

### Browser `<script>` tag

Loading this module through a script tag will make it's exports available as `BlockstoreCore` in the global namespace.

```html
<script src="https://unpkg.com/blockstore-core/dist/index.min.js"></script>
```

## Implementations

- Base: [`src/base`](src/base.js)
- Memory: [`src/memory`](src/memory.js)

## Usage

### BaseBlockstore

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

```js
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.

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

const store = new MemoryBlockstore()
```

## API Docs

- <https://ipfs.github.io/js-stores/modules/blockstore_core.html>

## License

Licensed under either of

- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)

## Contribute

Contributions welcome! Please check out [the issues](https://github.com/ipfs/js-stores/issues).

Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.

Please be aware that all interactions related to this repo are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
Loading

0 comments on commit 0d85128

Please sign in to comment.