tendermint/rpc/core/consensus.go

107 lines
3.9 KiB
Go
Raw Normal View History

package core
import (
[rpc] DumpConsensusState: output state as json rather than string Before: ``` { "jsonrpc": "2.0", "id": "", "result": { "round_state": "RoundState{\n H:10 R:0 S:RoundStepNewHeight\n StartTime: 2017-10-09 13:07:24.841134374 +0400 +04\n CommitTime: 2017-10-09 13:07:23.841134374 +0400 +04\n Validators: ValidatorSet{\n Proposer: Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n Validators:\n Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n }\n Proposal: \u003cnil\u003e\n ProposalBlock: nil-PartSet nil-Block\n LockedRound: 0\n LockedBlock: nil-PartSet nil-Block\n Votes: HeightVoteSet{H:10 R:0~0\n VoteSet{H:10 R:0 T:1 +2/3:\u003cnil\u003e BA{1:_} map[]}\n VoteSet{H:10 R:0 T:2 +2/3:\u003cnil\u003e BA{1:_} map[]}\n }\n LastCommit: VoteSet{H:9 R:0 T:2 +2/3:947F67A7B85439AF2CD5DFED376C51AC7BD67AEE:1:365E9983E466 BA{1:X} map[]}\n LastValidators: ValidatorSet{\n Proposer: Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n Validators:\n Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n }\n}", "peer_round_states": [] } } ``` After: ``` { "jsonrpc": "2.0", "id": "", "result": { "round_state": { "Height": 1691, "Round": 0, "Step": 1, "StartTime": "2017-10-09T14:08:09.129491764+04:00", "CommitTime": "2017-10-09T14:08:08.129491764+04:00", "Validators": { "validators": [ { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } ], "proposer": { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } }, "Proposal": null, "ProposalBlock": null, "ProposalBlockParts": null, "LockedRound": 0, "LockedBlock": null, "LockedBlockParts": null, "Votes": {}, "CommitRound": -1, "LastCommit": {}, "LastValidators": { "validators": [ { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } ], "proposer": { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } } }, "peer_round_states": { "75EC8F15D244A421202F9725CD4DE509EE50303670310CF7530EF25E2B7C524B": { "Height": 1691, "Round": 0, "Step": 1, "StartTime": "2017-10-09T14:08:08.563251997+04:00", "Proposal": false, "ProposalBlockPartsHeader": { "total": 0, "hash": "" }, "ProposalBlockParts": null, "ProposalPOLRound": -1, "ProposalPOL": null, "Prevotes": null, "Precommits": null, "LastCommitRound": 0, "LastCommit": null, "CatchupCommitRound": -1, "CatchupCommit": null } } } } ```
2017-10-09 03:09:26 -07:00
"encoding/json"
cm "github.com/tendermint/tendermint/consensus"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
"github.com/tendermint/tendermint/types"
[rpc] DumpConsensusState: output state as json rather than string Before: ``` { "jsonrpc": "2.0", "id": "", "result": { "round_state": "RoundState{\n H:10 R:0 S:RoundStepNewHeight\n StartTime: 2017-10-09 13:07:24.841134374 +0400 +04\n CommitTime: 2017-10-09 13:07:23.841134374 +0400 +04\n Validators: ValidatorSet{\n Proposer: Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n Validators:\n Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n }\n Proposal: \u003cnil\u003e\n ProposalBlock: nil-PartSet nil-Block\n LockedRound: 0\n LockedBlock: nil-PartSet nil-Block\n Votes: HeightVoteSet{H:10 R:0~0\n VoteSet{H:10 R:0 T:1 +2/3:\u003cnil\u003e BA{1:_} map[]}\n VoteSet{H:10 R:0 T:2 +2/3:\u003cnil\u003e BA{1:_} map[]}\n }\n LastCommit: VoteSet{H:9 R:0 T:2 +2/3:947F67A7B85439AF2CD5DFED376C51AC7BD67AEE:1:365E9983E466 BA{1:X} map[]}\n LastValidators: ValidatorSet{\n Proposer: Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n Validators:\n Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n }\n}", "peer_round_states": [] } } ``` After: ``` { "jsonrpc": "2.0", "id": "", "result": { "round_state": { "Height": 1691, "Round": 0, "Step": 1, "StartTime": "2017-10-09T14:08:09.129491764+04:00", "CommitTime": "2017-10-09T14:08:08.129491764+04:00", "Validators": { "validators": [ { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } ], "proposer": { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } }, "Proposal": null, "ProposalBlock": null, "ProposalBlockParts": null, "LockedRound": 0, "LockedBlock": null, "LockedBlockParts": null, "Votes": {}, "CommitRound": -1, "LastCommit": {}, "LastValidators": { "validators": [ { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } ], "proposer": { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } } }, "peer_round_states": { "75EC8F15D244A421202F9725CD4DE509EE50303670310CF7530EF25E2B7C524B": { "Height": 1691, "Round": 0, "Step": 1, "StartTime": "2017-10-09T14:08:08.563251997+04:00", "Proposal": false, "ProposalBlockPartsHeader": { "total": 0, "hash": "" }, "ProposalBlockParts": null, "ProposalPOLRound": -1, "ProposalPOL": null, "Prevotes": null, "Precommits": null, "LastCommitRound": 0, "LastCommit": null, "CatchupCommitRound": -1, "CatchupCommit": null } } } } ```
2017-10-09 03:09:26 -07:00
"github.com/pkg/errors"
)
2017-09-04 15:27:04 -07:00
// Get the validator set at the given block height.
2017-08-21 15:11:16 -07:00
// If no height is provided, it will fetch the current validator set.
//
// ```shell
// curl 'localhost:46657/validators'
// ```
//
// ```go
// client := client.NewHTTP("tcp://0.0.0.0:46657", "/websocket")
// state, err := client.Validators()
// ```
//
// > The above command returns JSON structured like this:
//
// ```json
// {
// "error": "",
// "result": {
// "validators": [
// {
// "accum": 0,
// "voting_power": 10,
// "pub_key": {
// "data": "68DFDA7E50F82946E7E8546BED37944A422CD1B831E70DF66BA3B8430593944D",
// "type": "ed25519"
// },
// "address": "E89A51D60F68385E09E716D353373B11F8FACD62"
// }
// ],
// "block_height": 5241
// },
// "id": "",
// "jsonrpc": "2.0"
// }
// ```
func Validators(heightPtr *int) (*ctypes.ResultValidators, error) {
if heightPtr == nil {
2017-08-21 15:11:16 -07:00
blockHeight, validators := consensusState.GetValidators()
return &ctypes.ResultValidators{blockHeight, validators}, nil
}
height := *heightPtr
2017-08-21 15:11:16 -07:00
state := consensusState.GetState()
validators, err := state.LoadValidators(height)
2017-08-21 15:11:16 -07:00
if err != nil {
return nil, err
}
return &ctypes.ResultValidators{height, validators.Validators}, nil
}
// Dump consensus state.
//
// ```shell
// curl 'localhost:46657/dump_consensus_state'
// ```
//
// ```go
// client := client.NewHTTP("tcp://0.0.0.0:46657", "/websocket")
// state, err := client.DumpConsensusState()
// ```
//
// > The above command returns JSON structured like this:
//
// ```json
// {
// "error": "",
// "result": {
// "peer_round_states": [],
// "round_state": "RoundState{\n H:3537 R:0 S:RoundStepNewHeight\n StartTime: 2017-05-31 12:32:31.178653883 +0000 UTC\n CommitTime: 2017-05-31 12:32:30.178653883 +0000 UTC\n Validators: ValidatorSet{\n Proposer: Validator{E89A51D60F68385E09E716D353373B11F8FACD62 {PubKeyEd25519{68DFDA7E50F82946E7E8546BED37944A422CD1B831E70DF66BA3B8430593944D}} VP:10 A:0}\n Validators:\n Validator{E89A51D60F68385E09E716D353373B11F8FACD62 {PubKeyEd25519{68DFDA7E50F82946E7E8546BED37944A422CD1B831E70DF66BA3B8430593944D}} VP:10 A:0}\n }\n Proposal: <nil>\n ProposalBlock: nil-PartSet nil-Block\n LockedRound: 0\n LockedBlock: nil-PartSet nil-Block\n Votes: HeightVoteSet{H:3537 R:0~0\n VoteSet{H:3537 R:0 T:1 +2/3:<nil> BA{1:_} map[]}\n VoteSet{H:3537 R:0 T:2 +2/3:<nil> BA{1:_} map[]}\n }\n LastCommit: VoteSet{H:3536 R:0 T:2 +2/3:B7F988FBCDC68F9320E346EECAA76E32F6054654:1:673BE7C01F74 BA{1:X} map[]}\n LastValidators: ValidatorSet{\n Proposer: Validator{E89A51D60F68385E09E716D353373B11F8FACD62 {PubKeyEd25519{68DFDA7E50F82946E7E8546BED37944A422CD1B831E70DF66BA3B8430593944D}} VP:10 A:0}\n Validators:\n Validator{E89A51D60F68385E09E716D353373B11F8FACD62 {PubKeyEd25519{68DFDA7E50F82946E7E8546BED37944A422CD1B831E70DF66BA3B8430593944D}} VP:10 A:0}\n }\n}"
// },
// "id": "",
// "jsonrpc": "2.0"
// }
// ```
func DumpConsensusState() (*ctypes.ResultDumpConsensusState, error) {
[rpc] DumpConsensusState: output state as json rather than string Before: ``` { "jsonrpc": "2.0", "id": "", "result": { "round_state": "RoundState{\n H:10 R:0 S:RoundStepNewHeight\n StartTime: 2017-10-09 13:07:24.841134374 +0400 +04\n CommitTime: 2017-10-09 13:07:23.841134374 +0400 +04\n Validators: ValidatorSet{\n Proposer: Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n Validators:\n Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n }\n Proposal: \u003cnil\u003e\n ProposalBlock: nil-PartSet nil-Block\n LockedRound: 0\n LockedBlock: nil-PartSet nil-Block\n Votes: HeightVoteSet{H:10 R:0~0\n VoteSet{H:10 R:0 T:1 +2/3:\u003cnil\u003e BA{1:_} map[]}\n VoteSet{H:10 R:0 T:2 +2/3:\u003cnil\u003e BA{1:_} map[]}\n }\n LastCommit: VoteSet{H:9 R:0 T:2 +2/3:947F67A7B85439AF2CD5DFED376C51AC7BD67AEE:1:365E9983E466 BA{1:X} map[]}\n LastValidators: ValidatorSet{\n Proposer: Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n Validators:\n Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n }\n}", "peer_round_states": [] } } ``` After: ``` { "jsonrpc": "2.0", "id": "", "result": { "round_state": { "Height": 1691, "Round": 0, "Step": 1, "StartTime": "2017-10-09T14:08:09.129491764+04:00", "CommitTime": "2017-10-09T14:08:08.129491764+04:00", "Validators": { "validators": [ { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } ], "proposer": { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } }, "Proposal": null, "ProposalBlock": null, "ProposalBlockParts": null, "LockedRound": 0, "LockedBlock": null, "LockedBlockParts": null, "Votes": {}, "CommitRound": -1, "LastCommit": {}, "LastValidators": { "validators": [ { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } ], "proposer": { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } } }, "peer_round_states": { "75EC8F15D244A421202F9725CD4DE509EE50303670310CF7530EF25E2B7C524B": { "Height": 1691, "Round": 0, "Step": 1, "StartTime": "2017-10-09T14:08:08.563251997+04:00", "Proposal": false, "ProposalBlockPartsHeader": { "total": 0, "hash": "" }, "ProposalBlockParts": null, "ProposalPOLRound": -1, "ProposalPOL": null, "Prevotes": null, "Precommits": null, "LastCommitRound": 0, "LastCommit": null, "CatchupCommitRound": -1, "CatchupCommit": null } } } } ```
2017-10-09 03:09:26 -07:00
roundStateBytes, err := json.Marshal(consensusState.GetRoundState())
if err != nil {
return nil, errors.Wrap(err, "failed to marshal round state")
}
peerRoundStates := make(map[string]json.RawMessage)
for i, peer := range p2pSwitch.Peers().List() {
// TODO: clean this up?
2017-09-12 17:49:22 -07:00
peerState := peer.Get(types.PeerStateKey).(*cm.PeerState)
peerRoundState := peerState.GetRoundState()
[rpc] DumpConsensusState: output state as json rather than string Before: ``` { "jsonrpc": "2.0", "id": "", "result": { "round_state": "RoundState{\n H:10 R:0 S:RoundStepNewHeight\n StartTime: 2017-10-09 13:07:24.841134374 +0400 +04\n CommitTime: 2017-10-09 13:07:23.841134374 +0400 +04\n Validators: ValidatorSet{\n Proposer: Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n Validators:\n Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n }\n Proposal: \u003cnil\u003e\n ProposalBlock: nil-PartSet nil-Block\n LockedRound: 0\n LockedBlock: nil-PartSet nil-Block\n Votes: HeightVoteSet{H:10 R:0~0\n VoteSet{H:10 R:0 T:1 +2/3:\u003cnil\u003e BA{1:_} map[]}\n VoteSet{H:10 R:0 T:2 +2/3:\u003cnil\u003e BA{1:_} map[]}\n }\n LastCommit: VoteSet{H:9 R:0 T:2 +2/3:947F67A7B85439AF2CD5DFED376C51AC7BD67AEE:1:365E9983E466 BA{1:X} map[]}\n LastValidators: ValidatorSet{\n Proposer: Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n Validators:\n Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n }\n}", "peer_round_states": [] } } ``` After: ``` { "jsonrpc": "2.0", "id": "", "result": { "round_state": { "Height": 1691, "Round": 0, "Step": 1, "StartTime": "2017-10-09T14:08:09.129491764+04:00", "CommitTime": "2017-10-09T14:08:08.129491764+04:00", "Validators": { "validators": [ { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } ], "proposer": { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } }, "Proposal": null, "ProposalBlock": null, "ProposalBlockParts": null, "LockedRound": 0, "LockedBlock": null, "LockedBlockParts": null, "Votes": {}, "CommitRound": -1, "LastCommit": {}, "LastValidators": { "validators": [ { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } ], "proposer": { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } } }, "peer_round_states": { "75EC8F15D244A421202F9725CD4DE509EE50303670310CF7530EF25E2B7C524B": { "Height": 1691, "Round": 0, "Step": 1, "StartTime": "2017-10-09T14:08:08.563251997+04:00", "Proposal": false, "ProposalBlockPartsHeader": { "total": 0, "hash": "" }, "ProposalBlockParts": null, "ProposalPOLRound": -1, "ProposalPOL": null, "Prevotes": null, "Precommits": null, "LastCommitRound": 0, "LastCommit": null, "CatchupCommitRound": -1, "CatchupCommit": null } } } } ```
2017-10-09 03:09:26 -07:00
peerRoundStateBytes, err := json.Marshal(peerRoundState)
if err != nil {
return nil, errors.Wrapf(err, "failed to marshal peer#%d round state", i)
}
peerRoundStates[peer.Key()] = json.RawMessage(peerRoundStateBytes)
}
[rpc] DumpConsensusState: output state as json rather than string Before: ``` { "jsonrpc": "2.0", "id": "", "result": { "round_state": "RoundState{\n H:10 R:0 S:RoundStepNewHeight\n StartTime: 2017-10-09 13:07:24.841134374 +0400 +04\n CommitTime: 2017-10-09 13:07:23.841134374 +0400 +04\n Validators: ValidatorSet{\n Proposer: Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n Validators:\n Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n }\n Proposal: \u003cnil\u003e\n ProposalBlock: nil-PartSet nil-Block\n LockedRound: 0\n LockedBlock: nil-PartSet nil-Block\n Votes: HeightVoteSet{H:10 R:0~0\n VoteSet{H:10 R:0 T:1 +2/3:\u003cnil\u003e BA{1:_} map[]}\n VoteSet{H:10 R:0 T:2 +2/3:\u003cnil\u003e BA{1:_} map[]}\n }\n LastCommit: VoteSet{H:9 R:0 T:2 +2/3:947F67A7B85439AF2CD5DFED376C51AC7BD67AEE:1:365E9983E466 BA{1:X} map[]}\n LastValidators: ValidatorSet{\n Proposer: Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n Validators:\n Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n }\n}", "peer_round_states": [] } } ``` After: ``` { "jsonrpc": "2.0", "id": "", "result": { "round_state": { "Height": 1691, "Round": 0, "Step": 1, "StartTime": "2017-10-09T14:08:09.129491764+04:00", "CommitTime": "2017-10-09T14:08:08.129491764+04:00", "Validators": { "validators": [ { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } ], "proposer": { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } }, "Proposal": null, "ProposalBlock": null, "ProposalBlockParts": null, "LockedRound": 0, "LockedBlock": null, "LockedBlockParts": null, "Votes": {}, "CommitRound": -1, "LastCommit": {}, "LastValidators": { "validators": [ { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } ], "proposer": { "address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27", "pub_key": { "type": "ed25519", "data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202" }, "voting_power": 10, "accum": 0 } } }, "peer_round_states": { "75EC8F15D244A421202F9725CD4DE509EE50303670310CF7530EF25E2B7C524B": { "Height": 1691, "Round": 0, "Step": 1, "StartTime": "2017-10-09T14:08:08.563251997+04:00", "Proposal": false, "ProposalBlockPartsHeader": { "total": 0, "hash": "" }, "ProposalBlockParts": null, "ProposalPOLRound": -1, "ProposalPOL": null, "Prevotes": null, "Precommits": null, "LastCommitRound": 0, "LastCommit": null, "CatchupCommitRound": -1, "CatchupCommit": null } } } } ```
2017-10-09 03:09:26 -07:00
return &ctypes.ResultDumpConsensusState{json.RawMessage(roundStateBytes), peerRoundStates}, nil
}