-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: create @helia/block-brokers package (#341) #342
Merged
achingbrain
merged 11 commits into
ipfs:main
from
meandavejustice:341-breakout-block-brokers
Jan 8, 2024
Merged
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9f2bccc
feat: create @helia/block-brokers package (#341)
meandavejustice f1271e8
fix: tests and build
SgtPooki a4df761
chore: package.json fix
SgtPooki 0929517
fix: package version and some copy changes
meandavejustice e18e820
fix: Move NetworkedStorage over to block-brokers package
meandavejustice 516e8ba
fix: add typesVersions to block-brokers package & remove
meandavejustice 74a11b2
Merge branch 'main' into 341-breakout-block-brokers
achingbrain 9b784ac
chore: update versions
achingbrain 0b8afb9
Merge remote-tracking branch 'origin/main' into 341-breakout-block-br…
achingbrain 687d111
chore: update deps
achingbrain ebebb8a
Merge branch 'main' into 341-breakout-block-brokers
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 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 +1 @@ | ||
{"packages/helia":"2.1.0","packages/interface":"2.1.0","packages/interop":"1.1.0"} | ||
{"packages/block-brokers":"0.9.0", "packages/helia":"2.1.0","packages/interface":"2.1.0","packages/interop":"1.1.0"} |
This file contains 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
Empty file.
This file contains 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
This project is dual licensed under MIT and Apache-2.0. | ||
|
||
MIT: https://www.opensource.org/licenses/mit | ||
Apache-2.0: https://www.apache.org/licenses/license-2.0 |
This file contains 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
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 | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
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. |
This file contains 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
The MIT License (MIT) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<p align="center"> | ||
<a href="https://github.com/ipfs/helia" title="Helia"> | ||
<img src="https://raw.githubusercontent.com/ipfs/helia/main/assets/helia.png" alt="Helia logo" width="300" /> | ||
</a> | ||
</p> | ||
|
||
[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech) | ||
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech) | ||
[![codecov](https://img.shields.io/codecov/c/github/ipfs/helia.svg?style=flat-square)](https://codecov.io/gh/ipfs/helia) | ||
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/helia/main.yml?branch=main\&style=flat-square)](https://github.com/ipfs/helia/actions/workflows/main.yml?query=branch%3Amain) | ||
|
||
> Block brokers for Helia | ||
|
||
## Install | ||
|
||
```console | ||
$ npm i @helia/block-brokers | ||
``` | ||
|
||
<!-- ### Browser `<script>` tag | ||
|
||
Loading this module through a script tag will make it's exports available as `bitswap` and `trustlessGateway` in the global namespace. | ||
|
||
```html | ||
<script src="https://unpkg.com/@helia/block-brokers/dist/index.min.js"></script> | ||
``` --> | ||
|
||
## License | ||
|
||
Licensed under either of | ||
|
||
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>) | ||
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>) | ||
|
||
## Contribute | ||
|
||
Contributions welcome! Please check out [the issues](https://github.com/ipfs/helia/issues). | ||
|
||
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. | ||
|
||
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). | ||
|
||
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. | ||
|
||
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md) |
This file contains 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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"name": "@helia/block-brokers", | ||
"version": "0.9.0", | ||
"description": "Block brokers for Helia", | ||
"license": "Apache-2.0 OR MIT", | ||
"homepage": "https://github.com/ipfs/helia/tree/master/packages/block-brokers#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ipfs/helia.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/ipfs/helia/issues" | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"provenance": true | ||
}, | ||
"keywords": [ | ||
"IPFS" | ||
], | ||
"type": "module", | ||
"types": "./dist/src/index.d.ts", | ||
"files": [ | ||
"src", | ||
"dist", | ||
"!dist/test", | ||
"!**/*.tsbuildinfo" | ||
], | ||
"exports": { | ||
".": { | ||
"types": "./dist/src/index.d.ts", | ||
"import": "./dist/src/index.js" | ||
} | ||
}, | ||
"eslintConfig": { | ||
"extends": "ipfs", | ||
"parserOptions": { | ||
"project": true, | ||
"sourceType": "module" | ||
} | ||
}, | ||
"scripts": { | ||
"clean": "aegir clean", | ||
"lint": "aegir lint", | ||
"dep-check": "aegir dep-check", | ||
"build": "aegir build", | ||
"test": "aegir test", | ||
"test:chrome": "aegir test -t browser --cov", | ||
"test:chrome-webworker": "aegir test -t webworker", | ||
"test:firefox": "aegir test -t browser -- --browser firefox", | ||
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox", | ||
"test:node": "aegir test -t node --cov", | ||
"test:electron-main": "aegir test -t electron-main" | ||
}, | ||
"dependencies": { | ||
"@helia/interface": "^2.1.0", | ||
"@libp2p/interface": "^1.0.1", | ||
"any-signal": "^4.1.1", | ||
"interface-blockstore": "^5.2.7", | ||
"interface-store": "^5.1.5", | ||
"ipfs-bitswap": "^20.0.0", | ||
"it-filter": "^3.0.4", | ||
"it-foreach": "^2.0.6", | ||
"multiformats": "^12.1.3", | ||
"progress-events": "^1.0.0", | ||
"uint8arrays": "^5.0.0" | ||
}, | ||
"devDependencies": { | ||
"@libp2p/logger": "^4.0.1", | ||
"@types/sinon": "^17.0.2", | ||
"aegir": "^41.1.14", | ||
"blockstore-core": "^4.3.8", | ||
"delay": "^6.0.0", | ||
"it-all": "^3.0.4", | ||
"it-drain": "^3.0.5", | ||
"sinon": "^17.0.1", | ||
"sinon-ts": "^2.0.0" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { identity } from 'multiformats/hashes/identity' | ||
import { sha256, sha512 } from 'multiformats/hashes/sha2' | ||
import type { MultihashHasher } from 'multiformats/hashes/interface' | ||
|
||
export function defaultHashers (hashers: MultihashHasher[] = []): MultihashHasher[] { | ||
return [ | ||
sha256, | ||
sha512, | ||
identity, | ||
...hashers | ||
] | ||
} |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is another file that I had duplicated @SgtPooki, it's also used in
helia.ts
Could move over and just export from
block-brokers
likeNetworkedStorage