Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: make seeds singular
Browse files Browse the repository at this point in the history
hacdias committed Apr 9, 2024
1 parent f0ecd12 commit 90369b4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 90369b4

Please sign in to comment.