-
Notifications
You must be signed in to change notification settings - Fork 106
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
Disabling libp2p doesn't work #344
Comments
I will provide a minimal config here that shows how to do this. This is done in helia-http-gateway currently, but its got a lot of other code around it. |
The dials libp2p is doing by default can be disabled by using:
but it still "does stuff". You can see the console for libp2p debug logs that I enabled with You can see that libp2p is starting, even though we set start to false. I think this is currently a bug with Helia/libp2p at the line helia/packages/helia/src/helia.ts Line 69 in 299bb09
libp2p: {start:false} we should prevent starting libp2p in Helia start, and require the user to manage it.
You can also do something like this:
to silence libp2p further. I think any further work for this should be handled by #289 |
We may be able to provide some |
Following the discussion in #372, what do you think we should do here @achingbrain? As it stands, libp2p is a hard depenednecy, but exposing the helia/packages/helia/src/helia.ts Line 69 in 299bb09
|
The problem here is that we have two places const node = await createHelia({
start: false,
libp2p: {
start: false
}
}) The first is from Helia's config, the second from libp2p's. I guess we should probably use Omit to exclude the I don't think we should support Helia being started but libp2p being stopped as valid configuration, I feel that way lies chaos. I'm guessing this has come about from the desire to have a version of Helia that only does HTTP things - that will be enabled by #372 and libp2p will be excluded entirely from |
Exactly. I think we can close this, once #372 is merged. |
Yeah, that seems sensible!
💯 . The only use-case would be |
I think it's still worth |
Omits the `start` key from the accepted libp2p init params, instead use only the `start` key in the main Helia init object. Fixes #344
Adds code from https://github.com/meandavejustice/helia-http to the monorepo. Fixes: #289 and #344 BREAKING CHANGE: the `libp2p` property has been removed from the `Helia` interface in `@helia/interface` - it is still present on the return type of `createHelia` from the `helia` module --------- Co-authored-by: David Justice <work@justice.engineering> Co-authored-by: Daniel Norman <1992255+2color@users.noreply.github.com> Co-authored-by: Daniel N <2color@users.noreply.github.com>
Omits the `start` key from the accepted libp2p init params, instead use only the `start` key in the main Helia init object. Fixes #344
Omits the `start` key from the accepted libp2p init params, instead use only the `start` key in the main Helia init object. Fixes #344
Background
in #289, there's an example showing how to start helia with Libp2p disabled:
The type for libp2p is defined here: https://github.com/libp2p/js-libp2p/blob/d994311cc9b59cdcbd5968bb7799b7fbe14a8961/packages/libp2p/src/index.ts#L125
However, when starting Helia like that, Helia still attempts to open quite a lot of libp2p connections to the bootstrappers and other nodes.
What should be the recommended configuration for this?
Reproduction
See the example here: https://stackblitz.com/edit/github-cadjaa?file=src%2Fprovider%2FHeliaProvider.jsx
The text was updated successfully, but these errors were encountered: