-
Notifications
You must be signed in to change notification settings - Fork 464
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
Add support for Addrs {listen, announce, noAnnounce} #202
Comments
Hello! 👋 Just found this through - ipfs/js-ipfs#1865 - and thought maybe I could help out here? What's the plan for these addresses vs the ones coming for the |
The go-ipfs docs are a helpful reference here, https://github.com/ipfs/go-ipfs/blob/v0.4.18/docs/config.md#addresses, I think js-ipfs will eventually need to be updated to support Here are my thoughts for each piece (with untested pseudo code): listenThese addresses will be passed to the transports for listening on startup. Any existing // Pre startup:
const listenAddrs = [...options.addresses.listen, ...peerInfo.multiaddrs.toArray()] announceThese addresses would be added to Note: On listening, a transport may replace multiaddrs in peerInfo with improved addresses. For example tcp may replace // Post listening
options.addresses.announce.forEach(addr => peerInfo.multiaddrs.add(addr)) noAnnounceThis is a list of addresses that should be removed from Note: noAnnounce should take into account encapsulated addresses. For example, if I add // Pre announce filtering
peerInfo.multiaddrs.forEach(addr => {
if (options.addresses.noAnnounce.find(addr)) {
peerInfo.multiaddrs.delete(addr)
}
}) What do you think? cc @alanshaw @vasco-santos Edit Observed AddressesWhen we run identify with another peer they may respond with a list of observed addresses they have for us. We should do some validation of those addresses prior to adding them to our address list. reference: libp2p/js-libp2p-switch#330 (comment) |
I like the approach suggested by @jacobheun |
This is done |
seems err-code is installed but not used.
## [5.0.3](libp2p/js-libp2p-websockets@v5.0.2...v5.0.3) (2023-01-13) ### Dependencies * remove err-code ([libp2p#202](libp2p/js-libp2p-websockets#202)) ([40ce006](libp2p/js-libp2p-websockets@40ce006))
With https://github.com/libp2p/js-libp2p/pull/166/files, the libp2p constructor will be fully refactored and with it comes the libp2p config.
We want to give the user the ability to(with example):
Proposed in: #166 (comment)
The text was updated successfully, but these errors were encountered: