Skip to content

Commit

Permalink
fix: wrap blockstore in identity blockstore (#493)
Browse files Browse the repository at this point in the history
Wraps blockstore to prevent writing identity blocks
  • Loading branch information
achingbrain authored Apr 9, 2024
1 parent b1c761d commit b67ac5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@libp2p/utils": "^5.2.6",
"@multiformats/dns": "^1.0.1",
"any-signal": "^4.1.1",
"blockstore-core": "^4.4.0",
"blockstore-core": "^4.4.1",
"cborg": "^4.0.9",
"interface-blockstore": "^5.2.10",
"interface-datastore": "^8.2.11",
Expand Down
6 changes: 1 addition & 5 deletions packages/utils/src/utils/networked-storage.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { CodeError, setMaxListeners, start, stop } from '@libp2p/interface'
import { anySignal } from 'any-signal'
import { IdentityBlockstore } from 'blockstore-core/identity'
import { TieredBlockstore } from 'blockstore-core/tiered'
import filter from 'it-filter'
import forEach from 'it-foreach'
import { CustomProgressEvent, type ProgressOptions } from 'progress-events'
Expand Down Expand Up @@ -47,10 +46,7 @@ export class NetworkedStorage implements Blocks, Startable {
this.log = components.logger.forComponent(`helia:networked-storage${init.root == null ? '' : `:${init.root}`}`)
this.logger = components.logger
this.components = components
this.child = new TieredBlockstore([
new IdentityBlockstore(),
components.blockstore
])
this.child = new IdentityBlockstore(components.blockstore)
this.hashers = components.hashers ?? {}
this.started = false
}
Expand Down

0 comments on commit b67ac5f

Please sign in to comment.