func (env *Environment) GetConsensusState(ctx *rpctypes.Context) (*coretypes.ResultConsensusState, error) {
	bz, err := env.ConsensusState.GetRoundStateSimpleJSON()
	return &coretypes.ResultConsensusState{RoundState: bz}, err
}
ConsensusState returns a concise summary of the consensus state.
UNSTABLE
More: https://docs.tendermint.com/master/rpc/#/Info/consensus_state
package core
import (
	tmmath "github.com/tendermint/tendermint/libs/math"
	"github.com/tendermint/tendermint/rpc/coretypes"
	rpctypes "github.com/tendermint/tendermint/rpc/jsonrpc/types"
)
func (env *Environment) Validators(
	ctx *rpctypes.Context,
	heightPtr *int64,
	pagePtr, perPagePtr *int) (*coretypes.ResultValidators, error) {
	height, err := env.getHeight(env.latestUncommittedHeight(), heightPtr)
	if err != nil {
		return nil, err
	}
	validators, err := env.StateStore.LoadValidators(height)
	if err != nil {
		return nil, err
	}
	totalCount := len(validators.Validators)
	perPage := env.validatePerPage(perPagePtr)
	page, err := validatePage(pagePtr, perPage, totalCount)
	if err != nil {
		return nil, err
	}
	skipCount := validateSkipCount(page, perPage)
	v := validators.Validators[skipCount : skipCount+tmmath.MinInt(perPage, totalCount-skipCount)]
	return &coretypes.ResultValidators{
		BlockHeight: height,
		Validators:  v,
		Count:       len(v),
		Total:       totalCount}, nil
}
func (env *Environment) DumpConsensusState(ctx *rpctypes.Context) (*coretypes.ResultDumpConsensusState, error) {
	var peerStates []coretypes.PeerStateInfo
	peers := env.PeerManager.Peers()
	peerStates = make([]coretypes.PeerStateInfo, 0, len(peers))
	for _, pid := range peers {
		peerState, ok := env.ConsensusReactor.GetPeerState(pid)
		if !ok {
			continue
		}
		peerStateJSON, err := peerState.ToJSON()
		if err != nil {
			return nil, err
		}
		addr := env.PeerManager.Addresses(pid)
		if len(addr) != 0 {
			peerStates = append(peerStates, coretypes.PeerStateInfo{
				NodeAddress: addr[0].String(),
				PeerState: peerStateJSON,
			})
		}
	}
	roundState, err := env.ConsensusState.GetRoundStateJSON()
	if err != nil {
		return nil, err
	}
	return &coretypes.ResultDumpConsensusState{
		RoundState: roundState,
		Peers:      peerStates}, nil
}