Skip to content

Commit 0d85128

Browse files
authored
feat: add all blockstore and datastore implementations (#197)
Move all block and datastores into the monorepo for ease of release
1 parent 5230741 commit 0d85128

File tree

147 files changed

+10696
-51
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+10696
-51
lines changed

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# ipfs-interfaces <!-- omit in toc -->
1+
# stores <!-- omit in toc -->
22

33
[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
44
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
5-
[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-ipfs-interfaces.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-ipfs-interfaces)
6-
[![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)
5+
[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-stores.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-stores)
6+
[![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)
77

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

@@ -17,6 +17,16 @@
1717

1818
## Structure
1919

20+
- [`/packages/blockstore-core`](./packages/blockstore-core) Contains various implementations of the API contract described in interface-blockstore
21+
- [`/packages/blockstore-fs`](./packages/blockstore-fs) Blockstore implementation with file system backend
22+
- [`/packages/blockstore-idb`](./packages/blockstore-idb) Blockstore implementation with IndexedDB backend
23+
- [`/packages/blockstore-level`](./packages/blockstore-level) Blockstore implementation with level(up|down) backend
24+
- [`/packages/blockstore-s3`](./packages/blockstore-s3) IPFS blockstore implementation backed by s3
25+
- [`/packages/datastore-core`](./packages/datastore-core) Wrapper implementation for interface-datastore
26+
- [`/packages/datastore-fs`](./packages/datastore-fs) Datastore implementation with file system backend
27+
- [`/packages/datastore-idb`](./packages/datastore-idb) Datastore implementation with IndexedDB backend.
28+
- [`/packages/datastore-level`](./packages/datastore-level) Datastore implementation with level(up|down) backend
29+
- [`/packages/datastore-s3`](./packages/datastore-s3) IPFS datastore implementation backed by s3
2030
- [`/packages/interface-blockstore`](./packages/interface-blockstore) An interface for storing and retrieving blocks
2131
- [`/packages/interface-blockstore-tests`](./packages/interface-blockstore-tests) Compliance tests for the blockstore interface
2232
- [`/packages/interface-datastore`](./packages/interface-datastore) datastore interface
@@ -29,7 +39,7 @@ See the [./packages](./packages) directory for the various interfaces.
2939

3040
## API Docs
3141

32-
- <https://ipfs.github.io/js-ipfs-interfaces>
42+
- <https://ipfs.github.io/js-stores>
3343

3444
## License
3545

@@ -40,7 +50,7 @@ Licensed under either of
4050

4151
## Contribute
4252

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

4555
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.
4656

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"name": "ipfs-interfaces",
2+
"name": "stores",
33
"version": "1.0.0",
4-
"description": "TypeScript interfaces used by IPFS internals",
4+
"description": "Blockstores and datastores used by IP-JS internals",
55
"license": "Apache-2.0 OR MIT",
6-
"homepage": "https://github.com/ipfs/js-ipfs-interfaces#readme",
6+
"homepage": "https://github.com/ipfs/js-stores#readme",
77
"repository": {
88
"type": "git",
9-
"url": "git+https://github.com/ipfs/js-ipfs-interfaces.git"
9+
"url": "git+https://github.com/ipfs/js-stores.git"
1010
},
1111
"bugs": {
12-
"url": "https://github.com/ipfs/js-ipfs-interfaces/issues"
12+
"url": "https://github.com/ipfs/js-stores/issues"
1313
},
1414
"engines": {
1515
"node": ">=16.0.0",

packages/blockstore-core/CHANGELOG.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
## [4.0.2](https://github.com/ipfs/js-blockstore-core/compare/v4.0.1...v4.0.2) (2023-03-23)
2+
3+
4+
### Dependencies
5+
6+
* 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))
7+
8+
## [4.0.1](https://github.com/ipfs/js-blockstore-core/compare/v4.0.0...v4.0.1) (2023-03-14)
9+
10+
11+
### Bug Fixes
12+
13+
* 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))
14+
15+
## [4.0.0](https://github.com/ipfs/js-blockstore-core/compare/v3.0.0...v4.0.0) (2023-03-13)
16+
17+
18+
### ⚠ BREAKING CHANGES
19+
20+
* `interface-blockstore@5` removes query/batch methods and adds getAll
21+
22+
### Features
23+
24+
* 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))
25+
26+
## [3.0.0](https://github.com/ipfs/js-blockstore-core/compare/v2.0.2...v3.0.0) (2023-01-06)
27+
28+
29+
### ⚠ BREAKING CHANGES
30+
31+
* update blockstore deps (#59)
32+
33+
### Dependencies
34+
35+
* update blockstore deps ([#59](https://github.com/ipfs/js-blockstore-core/issues/59)) ([0299bf5](https://github.com/ipfs/js-blockstore-core/commit/0299bf558bc7f2ff3d63ce69a4dee55775f4389a))
36+
37+
## [2.0.2](https://github.com/ipfs/js-blockstore-core/compare/v2.0.1...v2.0.2) (2022-10-14)
38+
39+
40+
### Dependencies
41+
42+
* 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))
43+
44+
## [2.0.1](https://github.com/ipfs/js-blockstore-core/compare/v2.0.0...v2.0.1) (2022-08-13)
45+
46+
47+
### Dependencies
48+
49+
* 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))
50+
* 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))
51+
* **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))
52+
53+
## [2.0.0](https://github.com/ipfs/js-blockstore-core/compare/v1.0.5...v2.0.0) (2022-08-13)
54+
55+
56+
### ⚠ BREAKING CHANGES
57+
58+
* this module is now ESM-only
59+
60+
### Features
61+
62+
* publish as ESM-only ([#45](https://github.com/ipfs/js-blockstore-core/issues/45)) ([01009f6](https://github.com/ipfs/js-blockstore-core/commit/01009f683bbc8b50c202919c448dc0d4cbb86249))
63+
64+
65+
### Trivial Changes
66+
67+
* Update .github/workflows/stale.yml [skip ci] ([9e7d0d6](https://github.com/ipfs/js-blockstore-core/commit/9e7d0d6a2e2900b7739a956c371a3a0dcb623f92))
68+
69+
### [1.0.5](https://github.com/ipfs/js-blockstore-core/compare/v1.0.4...v1.0.5) (2022-01-07)
70+
71+
72+
### Bug Fixes
73+
74+
* add semantic release config ([#13](https://github.com/ipfs/js-blockstore-core/issues/13)) ([de1e758](https://github.com/ipfs/js-blockstore-core/commit/de1e758decc2af2ec5e85e99c9b05d2110ade86f))
75+
76+
## [1.0.2](https://github.com/ipfs/js-blockstore-core/compare/v1.0.1...v1.0.2) (2021-09-09)
77+
78+
79+
80+
## [1.0.1](https://github.com/ipfs/js-blockstore-core/compare/v1.0.0...v1.0.1) (2021-09-09)
81+
82+
83+
84+
# [1.0.0](https://github.com/ipfs/js-blockstore-core/compare/v0.0.2...v1.0.0) (2021-09-09)
85+
86+
87+
88+
## [0.0.2](https://github.com/ipfs/js-blockstore-core/compare/v0.0.1...v0.0.2) (2021-09-09)
89+
90+
91+
### Bug Fixes
92+
93+
* add types versions ([#1](https://github.com/ipfs/js-blockstore-core/issues/1)) ([fa8ce28](https://github.com/ipfs/js-blockstore-core/commit/fa8ce287da9e2528f7581151e6fa3ac86fcd4196))
94+
95+
96+
97+
## 0.0.1 (2021-09-09)

packages/blockstore-core/LICENSE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
This project is dual licensed under MIT and Apache-2.0.
2+
3+
MIT: https://www.opensource.org/licenses/mit
4+
Apache-2.0: https://www.apache.org/licenses/license-2.0
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
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
2+
3+
http://www.apache.org/licenses/LICENSE-2.0
4+
5+
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.

packages/blockstore-core/LICENSE-MIT

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
The MIT License (MIT)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

packages/blockstore-core/README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# blockstore-core <!-- omit in toc -->
2+
3+
[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
4+
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
5+
[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-stores.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-stores)
6+
[![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)
7+
8+
> Contains various implementations of the API contract described in interface-blockstore
9+
10+
## Table of contents <!-- omit in toc -->
11+
12+
- [Install](#install)
13+
- [Browser `<script>` tag](#browser-script-tag)
14+
- [Implementations](#implementations)
15+
- [Usage](#usage)
16+
- [BaseBlockstore](#baseblockstore)
17+
- [MemoryBlockstore](#memoryblockstore)
18+
- [API Docs](#api-docs)
19+
- [License](#license)
20+
- [Contribute](#contribute)
21+
22+
## Install
23+
24+
```console
25+
$ npm i blockstore-core
26+
```
27+
28+
### Browser `<script>` tag
29+
30+
Loading this module through a script tag will make it's exports available as `BlockstoreCore` in the global namespace.
31+
32+
```html
33+
<script src="https://unpkg.com/blockstore-core/dist/index.min.js"></script>
34+
```
35+
36+
## Implementations
37+
38+
- Base: [`src/base`](src/base.js)
39+
- Memory: [`src/memory`](src/memory.js)
40+
41+
## Usage
42+
43+
### BaseBlockstore
44+
45+
Provides a complete implementation of the Blockstore interface. You must implement `.get`, `.put`, etc.
46+
47+
```js
48+
import { BaseBlockstore } from 'blockstore-core/base'
49+
50+
class MyCustomBlockstore extends BaseBlockstore {
51+
put (key, val, options) {
52+
// store a block
53+
}
54+
55+
get (key, options) {
56+
// retrieve a block
57+
}
58+
59+
// ...etc
60+
}
61+
```
62+
63+
### MemoryBlockstore
64+
65+
A simple Blockstore that stores blocks in memory.
66+
67+
```js
68+
import { MemoryBlockstore } from 'blockstore-core/memory'
69+
70+
const store = new MemoryBlockstore()
71+
```
72+
73+
## API Docs
74+
75+
- <https://ipfs.github.io/js-stores/modules/blockstore_core.html>
76+
77+
## License
78+
79+
Licensed under either of
80+
81+
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
82+
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
83+
84+
## Contribute
85+
86+
Contributions welcome! Please check out [the issues](https://github.com/ipfs/js-stores/issues).
87+
88+
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.
89+
90+
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).
91+
92+
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.
93+
94+
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)

0 commit comments

Comments
 (0)