From 245c01b286f4886dfabeeb3d2707570a8a617fd3 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Wed, 6 Oct 2021 11:42:57 -0400 Subject: [PATCH] fix: check err on wakunode start --- go.mod | 2 -- go.sum | 4 ---- tests/connection_test.go | 3 +++ waku/node.go | 4 +++- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index d0c2c349..121026e1 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,6 @@ go 1.15 replace github.com/ethereum/go-ethereum v1.10.4 => github.com/status-im/go-ethereum v1.10.4-status.2 -replace github.com/status-im/go-waku-rendezvous v0.0.0-20211005020656-b53661c58574 => ../go-libp2p-rendezvous - require ( contrib.go.opencensus.io/exporter/prometheus v0.3.0 github.com/cruxic/go-hmac-drbg v0.0.0-20170206035330-84c46983886d diff --git a/go.sum b/go.sum index e38fb6ab..91d9d109 100644 --- a/go.sum +++ b/go.sum @@ -902,12 +902,8 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= github.com/status-im/go-ethereum v1.10.4-status.2 h1:uvcD2U7skYqPQviARFb4w3wZyFSYLs/pfVrJaRSDcCA= github.com/status-im/go-ethereum v1.10.4-status.2/go.mod h1:GvIhpdCOgMHI6i5xVPEZOrv/qSMeOFHbZh77AoyZUoE= -github.com/status-im/go-waku-rendezvous v0.0.0-20211005013646-7253bc78d206 h1:cniKcMR0tkSqqwvfDUAzhfZ/iFE6PvEpwDsLIqSexq0= -github.com/status-im/go-waku-rendezvous v0.0.0-20211005013646-7253bc78d206/go.mod h1:Fa1uJjMz9MpfZc2tC5xdN9q90xg1VphSnevxWiBbFO0= github.com/status-im/go-waku-rendezvous v0.0.0-20211005020656-b53661c58574 h1:v2gpjWKyI+vZZugjjhPDqIhg6uNrGLusHh3ilvbv8/Y= github.com/status-im/go-waku-rendezvous v0.0.0-20211005020656-b53661c58574/go.mod h1:Fa1uJjMz9MpfZc2tC5xdN9q90xg1VphSnevxWiBbFO0= -github.com/status-im/go-wakurelay-pubsub v0.4.3-0.20210729162817-adc68830282a h1:eCna/q/PuZVqtmOMBqytw9yzZwMNKpao4au0OJDvesI= -github.com/status-im/go-wakurelay-pubsub v0.4.3-0.20210729162817-adc68830282a/go.mod h1:LSCVYR7mnBBsxVJghrGpQ3yJAAATEe6XeQQqGCZhwrE= github.com/status-im/go-wakurelay-pubsub v0.4.3-0.20211006151908-91851dda6375 h1:4lYWWH3SPnVrCmDmqUpQlXy65uFUZZCjH6gS9899iJc= github.com/status-im/go-wakurelay-pubsub v0.4.3-0.20211006151908-91851dda6375/go.mod h1:LSCVYR7mnBBsxVJghrGpQ3yJAAATEe6XeQQqGCZhwrE= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= diff --git a/tests/connection_test.go b/tests/connection_test.go index d6d3a3d7..9c1036a4 100644 --- a/tests/connection_test.go +++ b/tests/connection_test.go @@ -35,6 +35,9 @@ func TestBasicSendingReceiving(t *testing.T) { require.NoError(t, err) require.NotNil(t, wakuNode) + err = wakuNode.Start() + require.NoError(t, err) + require.NoError(t, write(ctx, wakuNode, "test")) sub, err := wakuNode.Subscribe(nil) diff --git a/waku/node.go b/waku/node.go index 6b252a71..ed8139b5 100644 --- a/waku/node.go +++ b/waku/node.go @@ -159,7 +159,9 @@ func Execute(options Options) { addPeers(wakuNode, options.LightPush.Nodes, lightpush.LightPushID_v20beta1) addPeers(wakuNode, options.Filter.Nodes, filter.FilterID_v20beta1) - wakuNode.Start() + if err = wakuNode.Start(); err != nil { + log.Fatal(fmt.Errorf("could not start waku node, %w", err)) + } if len(options.Relay.Topics) == 0 { options.Relay.Topics = []string{string(relay.DefaultWakuTopic)}