Repository navigation
Conversation
Signed-off-by: Jeff Thompson <jeff@thefirst.org>
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Signed-off-by: Jeff Thompson <jeff@thefirst.org>
Signed-off-by: Jeff Thompson <jeff@thefirst.org>
gfanton
left a comment
There was a problem hiding this comment.
Height and chain_id come out right now, but version still isn't the release the node runs: it reads the BFT protocol version, so against mainnet status.json shows v1.0.0-rc.0 where the node is on v1.7.0. That one needs a change, and the comment has a one-click suggestion.
The other two are optional:
- Taking the height from the same
Statuscall drops the second RPC on every status.json hit and 22 lines. - Nothing tests status.json yet. This subtest, next to
/readyin the healthy part ofTestHealthEndpoints, fails on master (height 0, no chain_id,dev) and here on the version, and passes with the fix. It needs theencoding/jsonandtm2/pkg/versionimports:
t.Run("status.json should report the node", func(t *testing.T) {
request := httptest.NewRequest(http.MethodGet, "/status.json", nil)
response := httptest.NewRecorder()
router.ServeHTTP(response, request)
var status struct {
Gnoland struct {
Height int64 `json:"height"`
Version string `json:"version"`
ChainID string `json:"chain_id"`
} `json:"gnoland"`
}
require.NoError(t, json.Unmarshal(response.Body.Bytes(), &status))
assert.Greater(t, status.Gnoland.Height, int64(0))
assert.Equal(t, "tendermint_test", status.Gnoland.ChainID)
assert.Equal(t, version.Version, status.Gnoland.Version)
})Co-authored-by: Guilhem Fanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: Jeff Thompson <jeff@thefirst.org>
|
The gnoweb path
status.jsonincludes the height and version. For example, we run gnoweb with mainnetgnoweb -remote https://rpc.gno.land. The height is always 0 and the version is a hard-coded value as "dev":It needs to get the height by calling
ABCIInfo. And it can get the version from the RPC status. This PR updateshandlerStatusJSONto do this. The RPC status also has the remote's chain_id, so we also show this. With these fixes it shows correct height and version, and includes the correct chain_id:NOTE: gnoweb can be started with the default
chain-id"dev" or any other value. (This is shown in the gnokey commands on the Actions page.) Usually this matches the chain_id of the remote, but status.json always shows the value from the remote.