You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: use streaming API for blockstore access (#232)
Uses the streaming APIs from interface-datastore to work with data being sent/fetched from the blockstore.
The previous behaviour was to use batches for putting streams of blocks - this was bad because we'd end up buffering the whole stream before adding blocks to the blockstore. Instead now we stream the blocks as we get them.
* Adds `repo.blockstore.getMany()` function
* Passes `options` to underlying datastores to allow passing AbortSignals
BREAKING CHANGES:
* `repo.blockstore.putMany()` used to return a promise that resolved when all the deletes were done, now it returns an AsyncIterator that yields `{key, value}` objects as the put progresses
* `repo.blockstore.deleteMany()` used to return a promise that resolved when all the deletes were done, now it returns an AsyncIterator that yields CID objects as the delete progresses
*`cids` should be an Iterable or AsyncIterable that yields entries of the [type CID](https://github.com/ipld/js-cid#readme).
258
+
*`source` should be an Iterable or AsyncIterable that yields entries of the type [CID][]
250
259
251
260
Delete many blocks
252
261
253
-
Datastore:
262
+
### Datastore
254
263
255
264
#### `repo.datastore`
256
265
257
266
This contains a full implementation of [the `interface-datastore` API](https://github.com/ipfs/interface-datastore#api).
258
267
259
-
260
268
### Config
261
269
262
270
Instead of using `repo.set('config')` this exposes an API that allows you to set and get a decoded config object, as well as, in a safe manner, change any of the config values individually.
@@ -298,7 +306,7 @@ Whether the config sub-repo exists.
298
306
299
307
### Version
300
308
301
-
#### `Promise<Number> repo.version.get()`
309
+
#### `Promise<Number> repo.version.get()`
302
310
303
311
Gets the repo version (an integer).
304
312
@@ -308,19 +316,19 @@ Sets the repo version
308
316
309
317
### API Addr
310
318
311
-
#### `Promise<String> repo.apiAddr.get()`
319
+
#### `Promise<String> repo.apiAddr.get()`
312
320
313
321
Gets the API address.
314
322
315
-
#### `Promise repo.apiAddr.set(value)`
323
+
#### `Promise repo.apiAddr.set(value)`
316
324
317
325
Sets the API address.
318
326
319
-
*`value` should be a [Multiaddr](https://github.com/multiformats/js-multiaddr) or a String representing a valid one.
327
+
*`value` should be a [Multiaddr][] or a String representing a valid one.
0 commit comments