Skip to content

Commit

Permalink
feat: explicit announce-on/off profiles
Browse files Browse the repository at this point in the history
people running on raspberrypi shoot themselves in the foot by disabling
announcements.

(example:
https://discuss.ipfs.tech/t/understanding-long-access-times/18514/3)

this moves them to separate profiles
  • Loading branch information
lidel committed Sep 24, 2024
1 parent 58434ec commit 6c34785
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion config/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ fetching may be degraded.
Transform: func(c *Config) error {
c.Routing.Type = NewOptionalString("autoclient")
c.AutoNAT.ServiceMode = AutoNATServiceDisabled
c.Reprovider.Interval = NewOptionalDuration(0)

lowWater := int64(20)
highWater := int64(40)
Expand All @@ -188,6 +187,29 @@ fetching may be degraded.
return nil
},
},
"announce-off": {
Description: `Disables Reprovide system (and announcing to Amino DHT).
USE WITH CAUTION:
The main use case for this is setups with manual Peering.Peers config.
Data from this node will not be announced on the DHT. This will make
DHT-based routing an data retrieval impossible if this node is the only
one hosting it, and other peers are not already connected to it.
`,
Transform: func(c *Config) error {
c.Reprovider.Interval = NewOptionalDuration(0) // 0 disables periodic reprovide
c.Experimental.StrategicProviding = true // this is not a typo, yes, the name is counter-intuitive
return nil
},
},
"announce-on": {
Description: `Re-enables Reprovide system (reverts announce-off profile).`,
Transform: func(c *Config) error {
c.Reprovider.Interval = NewOptionalDuration(DefaultReproviderInterval) // have to apply explicit default because nil would be ignored
c.Experimental.StrategicProviding = false // this is not a typo, yes, the name is counter-intuitive
return nil
},
},
"randomports": {
Description: `Use a random port number for swarm.`,

Expand Down

0 comments on commit 6c34785

Please sign in to comment.