-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/dir-index-html
- Loading branch information
Showing
33 changed files
with
868 additions
and
214 deletions.
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,11 +1,26 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: "/" | ||
directories: | ||
- "/**/*" | ||
schedule: | ||
interval: daily | ||
time: "10:00" | ||
open-pull-requests-limit: 20 | ||
commit-message: | ||
prefix: "deps" | ||
prefix-development: "deps(dev)" | ||
groups: | ||
helia-deps: # group all deps that should be updated when Helia deps need updated | ||
patterns: | ||
- "*helia*" | ||
- "*libp2p*" | ||
- "*multiformats*" | ||
store-deps: # group all blockstore and datastore updates (interface & impl) | ||
patterns: | ||
- "*blockstore*" | ||
- "*datastore*" | ||
kubo-deps: # group kubo, kubo-rpc-client, and ipfsd-ctl updates | ||
patterns: | ||
- "*kubo*" | ||
- "ipfsd-ctl" |
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
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
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
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
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
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
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
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
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,43 @@ | ||
import { createVerifiedFetch, type CreateVerifiedFetchInit } from '@helia/verified-fetch' | ||
import { expect } from 'aegir/chai' | ||
import { isNode, isBrowser } from 'wherearewe' | ||
|
||
/** | ||
* Currently only testing browser and node | ||
*/ | ||
const describe = isNode || isBrowser ? global.describe : global.describe.skip | ||
|
||
describe('@helia/verified-fetch - direct retrieval', () => { | ||
let directRetrievalRouterUrl: string | ||
let createVerifiedFetchInit: CreateVerifiedFetchInit | ||
|
||
beforeEach(async () => { | ||
if (process.env.KUBO_DIRECT_RETRIEVAL_ROUTER == null || process.env.KUBO_DIRECT_RETRIEVAL_ROUTER === '') { | ||
throw new Error('KUBO_DIRECT_RETRIEVAL_ROUTER environment variable is required') | ||
} | ||
directRetrievalRouterUrl = process.env.KUBO_DIRECT_RETRIEVAL_ROUTER | ||
createVerifiedFetchInit = { | ||
gateways: [], | ||
routers: [directRetrievalRouterUrl] | ||
} | ||
if (!isNode) { | ||
createVerifiedFetchInit.libp2pConfig = { | ||
connectionGater: { | ||
denyDialMultiaddr: () => false | ||
} | ||
} | ||
} | ||
}) | ||
|
||
it('can fetch content directly from another node', async () => { | ||
const fetch = await createVerifiedFetch(createVerifiedFetchInit) | ||
|
||
const res = await fetch('ipfs://QmbQDovX7wRe9ek7u6QXe9zgCXkTzoUSsTFJEkrYV1HrVR/1 - Barrel - Part 1 - alt.txt') | ||
|
||
expect(res.status).to.equal(200) | ||
const body = await res.text() | ||
expect(body).to.equal('Don\'t we all.') | ||
|
||
await fetch.stop() | ||
}) | ||
}) |
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
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
Oops, something went wrong.