-
Notifications
You must be signed in to change notification settings - Fork 42
Support for block_results
RPC method from Client
#251
Comments
I took a look at this. The JSON returned from the RPC endpoint differs significantly from what is documented. From https://tendermint.com/rpc/#blockresults {
"height": "10",
"results": [
{
"code": "0",
"data": "CAFE00F00D"
},
{
"code": "102",
"data": ""
}
]
} This curiously seems to be missing the standard JSONRPC fields like Here is the response I get from gaiad: {
"jsonrpc": "2.0",
"id": "",
"result": {
"height": "20",
"results": {
"DeliverTx": [
{
"log": "[{\"msg_index\":\"0\",\"success\":true,\"log\":\"\"}]",
"gasWanted": "200000",
"gasUsed": "35433",
"tags": [
{
"key": "YWN0aW9u",
"value": "ZWRpdF92YWxpZGF0b3I="
},
{
"key": "ZGVzdGluYXRpb24tdmFsaWRhdG9y",
"value": "Y29zbW9zdmFsb3BlcjFyd2gwY3hhNzJkM3lsZTNyNGw4Z2Q3dnlwaHJtankya3BlNHg3Mg=="
},
{
"key": "bW9uaWtlcg==",
"value": "U3BhcmtQb29s"
},
{
"key": "aWRlbnRpdHk=",
"value": "REU4RTM3MjQwMDYxQjA0RQ=="
}
]
},
{
"log": "[{\"msg_index\":\"0\",\"success\":true,\"log\":\"\"}]",
"gasWanted": "200000",
"gasUsed": "81404",
"tags": [
{
"key": "YWN0aW9u",
"value": "ZGVsZWdhdGU="
},
{
"key": "ZGVsZWdhdG9y",
"value": "Y29zbW9zMThtY3E0bnA0MG5zYXE4eHozMHR0eWR3a240dXA2Z3JkdHh3eGNq"
},
{
"key": "ZGVzdGluYXRpb24tdmFsaWRhdG9y",
"value": "Y29zbW9zdmFsb3BlcjE0a24wa2szM3N6cHd1czluaDhuODdmamVsOGRqeDB5MDcweW1tag=="
}
]
}
],
"EndBlock": {
"validator_updates": [
{
"pub_key": {
"type": "ed25519",
"data": "2k346W3w8NFAQh21j1hBp+Mvur+ZhHFuEQk8DEOlN+c="
},
"power": "5010"
}
]
},
"BeginBlock": {}
}
}
} Looking at this: // ABCI results from a block
type ResultBlockResults struct {
Height int64 `json:"height"`
Results *state.ABCIResponses `json:"results"`
} and this: // ABCIResponses retains the responses
// of the various ABCI calls during block processing.
// It is persisted to disk for each height before calling Commit.
type ABCIResponses struct {
DeliverTx []*abci.ResponseDeliverTx
EndBlock *abci.ResponseEndBlock
BeginBlock *abci.ResponseBeginBlock
} I can go ahead and implement it based on that. However what is presently documented appears to be wrong. |
FWIW, I see there's already an open issue about the documentation: and a PR to fix it: ...however it seems that PR also renamed the fields to be "snake case" (e.g. I think I can go ahead and impl it with the old names, and update it to the new ones later. cc @melekes |
Added in #267. Will be released shortly as |
Tendermint RPC
Client
does not have support for callingblock_results
RPC method.Here's a list of all the supported methods.
The text was updated successfully, but these errors were encountered: