Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

RFC: js-ipfs profiles #2148

Closed
dirkmc opened this issue May 31, 2019 · 1 comment · Fixed by #2165
Closed

RFC: js-ipfs profiles #2148

dirkmc opened this issue May 31, 2019 · 1 comment · Fixed by #2165
Labels
exp/expert Having worked on the specific codebase is important exploration kind/support A question or request for support P1 High: Likely tackled by core team if no one steps up status/in-progress In progress

Comments

@dirkmc
Copy link
Contributor

dirkmc commented May 31, 2019

A profile is a shorthand name for a set of configuration options. This issue is to discuss which profiles we should have in js-ipfs and how each one should affect the behaviour of js-ipfs.

go-ipfs profiles

The profiles available for go-ipfs are documented in its configuration README and implemented in profile.go. Those that apply to js-ipfs are:

  • server / local-discovery (opposite of server)

    • Adds private / local / unrouteable addresses to
      • Addresses.NoAnnounce - prevents advertising these addresses to other peers
      • Swarm.AddrFilters - prevents dialing to these addresses
    • Sets Discovery.MDNS.Enabled to false
    • Sets Swarm.DisableNatPortMap to true
  • test / default-networking (opposite of test)

    • Sets /ip4/127.0.0.1/tcp/0 for
      • Addresses.API
      • Addresses.Gateway
      • Addresses.Swarm
    • Sets Discovery.MDNS.Enabled to false
    • Sets Swarm.DisableNatPortMap to true
    • Sets Bootstrap to [] - prevents bootstrapping with live nodes
  • lowpower

    • Sets Routing.Type to dhtclient - puts DHT in "client only" mode
    • Sets Reprovider.Interval to 0 - prevents node from advertising what content it has
    • Sets Swarm.ConnMgr parameters - maintains low connection count
      • Swarm.ConnMgr.LowWater: 20
      • Swarm.ConnMgr.HighWater: 40
      • Swarm.ConnMgr.GracePeriod: one minute
  • randomports

    • Sets Addresses.Swarm to listen on localhost at a random available port

js-ipfs profiles

In js-ipfs we already auto-detect whether the instance is running in the browser or node js and set config variables accordingly, we can refactor to use the profiles mechanism.

The corresponding ConnectionManager parameters for js-libp2p are

  • Swarm.ConnMgr.LowWater: ConnectionManager.minPeers
  • Swarm.ConnMgr.HighWater: ConnectionManager.maxPeers
  • Swarm.ConnMgr.GracePeriod: ConnectionManager.pollInterval - approximately equivalent

js-ipfs / js-libp2p do not currently support these parameters:

  • Addresses.NoAnnounce
  • Swarm.AddrFilters
  • Swarm.DisableNatPortMap - there is currently no NAT manager
  • Routing.Type - there is currently no dhtclient mode
  • Reprovider.Interval - there is currently no reproviding
@dirkmc
Copy link
Contributor Author

dirkmc commented May 31, 2019

@Stebalien @magik6k please let me know if any of the go-ipfs section is incorrect.
I'd also like to hear if any of these profiles turned out not to be useful, or if there are other profiles that you think would be useful.

Given that the only parameter we currently support for the server profile is Discovery.MDNS.Enabled, it may not be worth having the profile yet.

@alanshaw alanshaw added exp/expert Having worked on the specific codebase is important exploration status/in-progress In progress P1 High: Likely tackled by core team if no one steps up kind/support A question or request for support labels Jul 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/expert Having worked on the specific codebase is important exploration kind/support A question or request for support P1 High: Likely tackled by core team if no one steps up status/in-progress In progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants