This repository was archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: store blocks by multihash instead of CID #3124
Merged
Merged
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
fbec4dc
feat: store blocks by multihash instead of CID
achingbrain 5bfedda
fix: linting
achingbrain dc8de12
fix: test for multihash equality
achingbrain 8f8b7d2
fix: gc tests
achingbrain dabb5c8
chore: update docs
achingbrain 34c34a2
chore: add test for multihash flag
achingbrain b9793ee
chore: apply suggestions from code review
achingbrain f5f45c9
chore: fix typo
achingbrain fe22a0e
chore: update deps
achingbrain 9f9aa8e
chore: upgraded multibase
achingbrain 91c703b
chore: time requires unit
achingbrain ae75d90
chore: use default export for browser compatibility
achingbrain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,11 @@ | ||
| 'use strict' | ||
|
|
||
| const Repo = require('ipfs-repo') | ||
| const { withTimeoutOption } = require('../../utils') | ||
|
|
||
| module.exports = function ({ repo }) { | ||
| return withTimeoutOption(async function * refsLocal (options = {}) { | ||
| for await (const result of repo.blocks.query({ keysOnly: true, signal: options.signal })) { | ||
| yield dsKeyToRef(result.key) | ||
| for await (const cid of repo.blocks.query({ keysOnly: true, signal: options.signal })) { | ||
| yield { ref: cid.toString() } | ||
| } | ||
| }) | ||
| } | ||
|
|
||
| function dsKeyToRef (key) { | ||
| try { | ||
| return { ref: Repo.utils.blockstore.keyToCid(key).toString() } | ||
| } catch (err) { | ||
| return { err: `Could not convert block with key '${key}' to CID: ${err.message}` } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.