libp2p / devgrants

want to hack on libp2p? this repo tracks libp2p endeavors eligible for incentivization.

Home Page:https://libp2p.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for Addrs {listen, announce, noAnnounce} on js-libp2p

vasco-santos opened this issue · comments

Motivation and context

With the advances on js-libp2p config, we can allow users to configure which of their own addresses they want to use for listening, as well as as the addresses that they are willing to announce to other peers in the network.

Reference:

Value

Having more control over how addresses are announced to the network greatly improves the potential availability of nodes on the network, and greatly simplifies node deployment. For example, when running a node on an EC2 instance of inside of a container, it's necessary to be able to announce the public address of the node rather than the listening addresses.

Benefits (if addressed)

  • Support for announcing only public addresses. This makes leveraging things like Elastic IPs very easy to do out of the box. Currently this must be done programatically.
  • Support for filtering out local addresses via noAnnounce.

go-libp2p already supports this, and we would be able to get js-libp2p feature parity closer with this. Moreover, js-libp2p has been prone to some issues regarding dialing, which would be mitigated by adding this feature. Some examples:

Risks (if not addressed)

Nodes that are not announcing reliable, public addresses risk not being dialable and create a burden for other nodes when doing so.

Expected output and constraints

An updated to js-libp2p to include the logic described at libp2p/js-libp2p#202 (comment). This should allow for specifying a new set of options when creating a Libp2p instance, to control what addresses are announced to the network.

Design/implementation notes

@jacobheun proposal on libp2p/js-libp2p#202#issuecomment-461070174

commented

@vasco-santos I'm not sure this is substantial enough to be a scoped project worth rewarding via a devgrant. How long do you estimate this would take you or @jacobheun to implement?

This has been added in js-libp2p 0.28.