From f6bd4ce572449ad84ac31696766e43bf549e547c Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Sat, 20 Apr 2024 02:10:14 +0200 Subject: [PATCH] fix: meaningful error on lack of seed --- docs/environment-variables.md | 1 + main.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docs/environment-variables.md b/docs/environment-variables.md index de993fe..7fcc007 100644 --- a/docs/environment-variables.md +++ b/docs/environment-variables.md @@ -10,6 +10,7 @@ - [`RAINBOW_GC_THRESHOLD`](#rainbow_gc_threshold) - [`RAINBOW_IPNS_MAX_CACHE_TTL`](#rainbow_ipns_max_cache_ttl) - [`RAINBOW_PEERING`](#rainbow_peering) + - [`RAINBOW_PEERING_SHARED_CACHE`](#rainbow_peering_shared_cache) - [Logging](#logging) - [`GOLOG_LOG_LEVEL`](#golog_log_level) - [`GOLOG_LOG_FMT`](#golog_log_fmt) diff --git a/main.go b/main.go index 2865511..43318d6 100644 --- a/main.go +++ b/main.go @@ -308,6 +308,8 @@ share the same seed as long as the indexes are different. if err != nil { return err } + } else if rainbowSeedRegex.MatchString(maStr) { + return fmt.Errorf("unable to peer with %q without defining --seed-index of this instance first", maStr) } ai, err := peer.AddrInfoFromString(maStr)