From 90369b40fe6599a8a2aa3f706aa2a0a4e1ac670b Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Fri, 5 Apr 2024 17:02:05 +0200 Subject: [PATCH] refactor: make seeds singular --- main.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/main.go b/main.go index 6d23591..0df7d75 100644 --- a/main.go +++ b/main.go @@ -90,16 +90,16 @@ Generate an identity seed and launch a gateway: Usage: "Index to derivate the peerID (needs --seed)", }, &cli.BoolFlag{ - Name: "seeds-peering", + Name: "seed-peering", Value: false, - EnvVars: []string{"RAINBOW_SEEDS_PEERING"}, - Usage: "TODO (needs --seed and --seed-index). Automatically enables --dht-shared-host, incompatible with --routing", + EnvVars: []string{"RAINBOW_SEED_PEERING"}, + Usage: "Automatic peering with peers with the same seed (requires --seed and --seed-index). Automatically enables --dht-routing and --dht-shared-host", }, &cli.UintFlag{ - Name: "seeds-peering-max-index", + Name: "seed-peering-max-index", Value: 100, - EnvVars: []string{"RAINBOW_SEEDS_PEERING_MAX_INDEX"}, - Usage: "TODO", + EnvVars: []string{"RAINBOW_SEED_PEERING_MAX_INDEX"}, + Usage: "Largest index to derive automatic peering peer IDs for", }, &cli.StringSliceFlag{ Name: "gateway-domains", @@ -312,9 +312,9 @@ share the same seed as long as the indexes are different. peeringAddrs = append(peeringAddrs, *ai) } - if cctx.Bool("seeds-peering") { + if cctx.Bool("seed-peering") { if !cctx.IsSet("seed") || !cctx.IsSet("seed-index") { - return errors.New("--seed and --seed-index must be explicitly defined when --seeds-peering is enabled") + return errors.New("--seed and --seed-index must be explicitly defined when --seed-peering is enabled") } if cctx.String("dht-routing") == "off" { @@ -330,7 +330,7 @@ share the same seed as long as the indexes are different. return err } - maxIndex := cctx.Uint("seeds-peering-max-index") + maxIndex := cctx.Uint("seed-peering-max-index") peeringIDs, err := derivePeerIDs(seed, index, int(maxIndex)) if err != nil { return err