diff --git a/core/node/rpc/archiver_test.go b/core/node/rpc/archiver_test.go index 246e861a7..dd43623ff 100644 --- a/core/node/rpc/archiver_test.go +++ b/core/node/rpc/archiver_test.go @@ -2,7 +2,9 @@ package rpc_test import ( "context" + "io" "net" + "net/http" "sync" "testing" "time" @@ -22,6 +24,7 @@ import ( "github.com/river-build/river/core/node/storage" "github.com/river-build/river/core/node/testutils/dbtestutils" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func fillUserSettingsStreamWithData( @@ -378,6 +381,15 @@ func TestArchive100StreamsWithData(t *testing.T) { require.Zero(stats.FailedOpsCount) } +func httpGet(t *testing.T, url string) string { + resp, err := http.Get(url) + require.NoError(t, err) + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + require.NoError(t, err) + return string(body) +} + func TestArchiveContinuous(t *testing.T) { tester := newServiceTesterAndStart(t, 1) ctx := tester.ctx @@ -404,6 +416,9 @@ func TestArchiveContinuous(t *testing.T) { arch.Archiver.WaitForStart() require.Len(arch.ExitSignal(), 0) + status := httpGet(t, "http://"+listener.Addr().String()+"/status") + require.Contains(status, "OK") + require.EventuallyWithT( func(c *assert.CollectT) { num, err := arch.Storage().GetMaxArchivedMiniblockNumber(ctx, streamId) diff --git a/core/node/rpc/status.go b/core/node/rpc/status.go index a0dab3bd6..eec664fb8 100644 --- a/core/node/rpc/status.go +++ b/core/node/rpc/status.go @@ -13,10 +13,14 @@ import ( ) func (s *Service) getStatusReponse() *statusinfo.StatusResponse { + var addr string + if s.wallet != nil { + addr = s.wallet.Address.Hex() + } return &statusinfo.StatusResponse{ Status: s.GetStatus(), InstanceId: s.instanceId, - Address: s.wallet.Address.Hex(), + Address: addr, Version: version.GetFullVersion(), StartTime: s.startTime.UTC().Format(time.RFC3339), Uptime: time.Since(s.startTime).String(),