Class BlockstoreCarReader
Constructors
constructor
- new BlockstoreCarReader(roots: CID[], blockstore: Blockstore, version?: number): BlockstoreCarReader
-
Parameters
-
roots: CID[]
-
blockstore: Blockstore
-
version: number = 1
Properties
_blockstore
_blockstore: Blockstore
_roots
_roots: CID[]
_version
_version: number
Accessors
blockstore
- get blockstore(): Blockstore
-
Returns Blockstore
version
- get version(): number
-
Returns number
Methods
blocks
- blocks(): AsyncGenerator<Block, void, unknown>
-
Returns AsyncGenerator<Block, void, unknown>
cids
- cids(): AsyncGenerator<CID, void, unknown>
-
Returns AsyncGenerator<CID, void, unknown>
get
- get(cid: CID): Promise<{
bytes: Uint8Array;
cid: CID;
}>
-
Returns Promise<{
bytes: Uint8Array;
cid: CID;
}>
getRoots
- getRoots(): Promise<CID[]>
-
Returns Promise<CID[]>
has
- has(cid: CID): Promise<boolean>
-
Returns Promise<boolean>
An implementation of the CAR reader interface that is backed by a blockstore.
See
https://github.com/nftstorage/nft.storage/blob/0fc7e4e73867c437eac54f75f58a808dd4581c47/packages/client/src/bs-car-reader.js