Skip to content

Commit 2cf8fdb

Browse files
authored
refactor: fallback name of node to address instead of Unknown (#29)
Small PR to replace fallback node name to the node address. This will allow easier debug on unnamed nodes such as manually added nodes.
1 parent 7df8c00 commit 2cf8fdb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

internal/seed/seed.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import (
1111
"time"
1212
)
1313

14-
const FallbackNodeProvider = "Unknown"
15-
1614
type Seed struct {
1715
Status string `json:"status"`
1816
ChainID string `json:"chain_id"`
@@ -141,21 +139,21 @@ func (s *Seeder) fetch(ctx context.Context, log *slog.Logger, url string) (Seed,
141139
for _, addr := range s.cfg.AdditionalNodes.RPC {
142140
seed.APIs.RPC = append(seed.APIs.RPC, Node{
143141
Address: addr,
144-
Provider: FallbackNodeProvider,
142+
Provider: addr,
145143
})
146144
}
147145

148146
for _, addr := range s.cfg.AdditionalNodes.REST {
149147
seed.APIs.Rest = append(seed.APIs.Rest, Node{
150148
Address: addr,
151-
Provider: FallbackNodeProvider,
149+
Provider: addr,
152150
})
153151
}
154152

155153
for _, addr := range s.cfg.AdditionalNodes.GRPC {
156154
seed.APIs.GRPC = append(seed.APIs.GRPC, Node{
157155
Address: addr,
158-
Provider: FallbackNodeProvider,
156+
Provider: addr,
159157
})
160158
}
161159

0 commit comments

Comments
 (0)