This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
RFC: js-ipfs profiles #2148
Closed
Description
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 ofserver
)- Adds private / local / unrouteable addresses to
Addresses.NoAnnounce
- prevents advertising these addresses to other peersSwarm.AddrFilters
- prevents dialing to these addresses
- Sets
Discovery.MDNS.Enabled
tofalse
- Sets
Swarm.DisableNatPortMap
totrue
- Adds private / local / unrouteable addresses to
-
test
/default-networking
(opposite oftest
)- Sets
/ip4/127.0.0.1/tcp/0
forAddresses.API
Addresses.Gateway
Addresses.Swarm
- Sets
Discovery.MDNS.Enabled
tofalse
- Sets
Swarm.DisableNatPortMap
totrue
- Sets
Bootstrap
to[]
- prevents bootstrapping with live nodes
- Sets
-
lowpower
- Sets
Routing.Type
todhtclient
- puts DHT in "client only" mode - Sets
Reprovider.Interval
to0
- prevents node from advertising what content it has - Sets
Swarm.ConnMgr
parameters - maintains low connection countSwarm.ConnMgr.LowWater
:20
Swarm.ConnMgr.HighWater
:40
Swarm.ConnMgr.GracePeriod
:one minute
- Sets
-
randomports
- Sets
Addresses.Swarm
to listen on localhost at a random available port
- Sets
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 managerRouting.Type
- there is currently nodhtclient
modeReprovider.Interval
- there is currently no reproviding