-
Notifications
You must be signed in to change notification settings - Fork 30
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: small bundle + enable webrtc-star in no-failure mode #121
Conversation
This does not work as expected yet, we don't want to fail if all signaling servers are down because one can still leverage preloads. While at it, switched from ipfs to ipfs-core and that decreased the size of ./build/ from 34M to 22M (!)
Still unable to get FaultTolerance.NO_FATAL to work, but may be easier to debug.
src/lib/libp2p.js
Outdated
return new Libp2p({ | ||
peerId, | ||
addresses: { | ||
listen: [ | ||
/* | ||
'/dns4/wrtc-star1.par.dwebops.pub/tcp/443/wss/p2p-webrtc-star', | ||
'/dns4/wrtc-star2.sjc.dwebops.pub/tcp/443/wss/p2p-webrtc-star', | ||
'/dns4/wrtc-star.discovery.libp2p.io/tcp/443/wss/p2p-webrtc-star', | ||
*/ | ||
'/dns4/invalid-wrtc-star.discovery.libp2p.io/tcp/443/wss/p2p-webrtc-star' | ||
] | ||
}, | ||
dialer: { | ||
maxParallelDials: 150, // 150 total parallel multiaddr dials | ||
maxDialsPerPeer: 4, // Allow 4 multiaddrs to be dialed per peer in parallel | ||
dialTimeout: 10e3 // 10 second dial timeout per peer dial | ||
}, | ||
modules: { | ||
transport: [WS, WebRTCStar], | ||
streamMuxer: [MPLEX], | ||
connEncryption: [NOISE], | ||
peerDiscovery: [Bootstrap], | ||
pubsub: GossipSub | ||
}, | ||
transportManager: { | ||
// https://github.com/libp2p/js-libp2p/blob/0a6bc0d1013dfd80ab600e8f74c1544b433ece29/doc/CONFIGURATION.md#configuring-transport-manager | ||
// We don't want js-ipfs boot to fail when all webrtc signaling servers are down | ||
faultTolerance: FaultTolerance.NO_FATAL |
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.
@vasco-santos @achingbrain I've refactored things so a custom libp2p bundle is used, and I am still unable to get FaultTolerance.NO_FATAL
to work when no webrtc server is available.
Mind eyeballing if I missed something obvious?
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 a bug, just created a PR. Thanks @lidel
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.
Tested libp2p/js-libp2p#893 and works as expected.
Were there any breaking changes since last release?
Do we need to wait for this to bubble up to js-ipfs, or can we bump js-libp2p as an explicit dependency here (when fix is released)?
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.
just released it as a patch in libp2p. You should just need to reinstall the dependencies
This switches to latest js-libp2p with a fix for FaultTolerance.NO_FATAL
Confirmed |
This PR:
ipfs
toipfs-core
and that decreased the size of./build/
from 34M to 22M (!)TODO
faultTolerance: FaultTolerance.NO_FATAL
settings does not seem to be applied by libp2p, so when no webrtc-star is available, js-ipfs fails to start