Skip to content

Commit

Permalink
fix: explore page can query local kubo (#445)
Browse files Browse the repository at this point in the history
* chore: explainer comments

* fix: allowInsecure isn't needed for local gateways
  • Loading branch information
SgtPooki authored Sep 23, 2024
1 parent cad6b45 commit d06b15b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
"test:storybook:ci": "concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"storybook build --quiet && http-server storybook-static --port 6006 --silent\" \"wait-on 'tcp:127.0.0.1:6006' && test-storybook --coverage\""
},
"dependencies": {
"@helia/block-brokers": "^3.0.3",
"@helia/block-brokers": "^3.0.4",
"@helia/http": "^1.0.10",
"@helia/interface": "^4.3.1",
"@helia/routers": "^1.1.1",
Expand Down
2 changes: 1 addition & 1 deletion src/bundles/helia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const bundle = {

try {
console.info(
"🎛️ Customise your Kubo gateway opts by setting an `kuboGateway` value in localStorage. e.g. localStorage.setItem('kuboGateway', JSON.stringify({port: '1337'}))"
"🎛️ Customise your Kubo gateway opts by setting a `kuboGateway` value in localStorage. e.g. localStorage.setItem('kuboGateway', JSON.stringify({ port: '8080', trustlessBlockBrokerConfig: { init: { allowLocal: true, allowInsecure: true }}}))"
)
console.time('HELIA_INIT')
helia = await initHelia(kuboGatewayOptions)
Expand Down
3 changes: 3 additions & 0 deletions src/lib/init-helia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { addDagNodeToHelia } from '../lib/helpers.js'
import { getHashersForCodes } from './hash-importer.js'
import type { KuboGatewayOptions } from '../types.d.js'

/**
* Whether to enable remote gateways for fetching content. We default to true if the setting is not present.
*/
function areRemoteGatewaysEnabled (): boolean {
const localStorageKey = 'explore.ipld.gatewayEnabled'
console.info(
Expand Down

0 comments on commit d06b15b

Please sign in to comment.