|
|
@ -14,20 +14,24 @@ import ( |
|
|
|
"github.com/tendermint/tendermint/types" |
|
|
|
) |
|
|
|
|
|
|
|
// List of blocks
|
|
|
|
type ResultBlockchainInfo struct { |
|
|
|
LastHeight int64 `json:"last_height"` |
|
|
|
BlockMetas []*types.BlockMeta `json:"block_metas"` |
|
|
|
} |
|
|
|
|
|
|
|
// Genesis file
|
|
|
|
type ResultGenesis struct { |
|
|
|
Genesis *types.GenesisDoc `json:"genesis"` |
|
|
|
} |
|
|
|
|
|
|
|
// Single block (with meta)
|
|
|
|
type ResultBlock struct { |
|
|
|
BlockMeta *types.BlockMeta `json:"block_meta"` |
|
|
|
Block *types.Block `json:"block"` |
|
|
|
} |
|
|
|
|
|
|
|
// Commit and Header
|
|
|
|
type ResultCommit struct { |
|
|
|
// SignedHeader is header and commit, embedded so we only have
|
|
|
|
// one level in the json output
|
|
|
@ -35,6 +39,7 @@ type ResultCommit struct { |
|
|
|
CanonicalCommit bool `json:"canonical"` |
|
|
|
} |
|
|
|
|
|
|
|
// ABCI results from a block
|
|
|
|
type ResultBlockResults struct { |
|
|
|
Height int64 `json:"height"` |
|
|
|
Results *state.ABCIResponses `json:"results"` |
|
|
@ -54,6 +59,7 @@ func NewResultCommit(header *types.Header, commit *types.Commit, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Info about the node's syncing state
|
|
|
|
type SyncInfo struct { |
|
|
|
LatestBlockHash cmn.HexBytes `json:"latest_block_hash"` |
|
|
|
LatestAppHash cmn.HexBytes `json:"latest_app_hash"` |
|
|
@ -62,18 +68,21 @@ type SyncInfo struct { |
|
|
|
Syncing bool `json:"syncing"` |
|
|
|
} |
|
|
|
|
|
|
|
// Info about the node's validator
|
|
|
|
type ValidatorInfo struct { |
|
|
|
Address cmn.HexBytes `json:"address"` |
|
|
|
PubKey crypto.PubKey `json:"pub_key"` |
|
|
|
VotingPower int64 `json:"voting_power"` |
|
|
|
} |
|
|
|
|
|
|
|
// Node Status
|
|
|
|
type ResultStatus struct { |
|
|
|
NodeInfo p2p.NodeInfo `json:"node_info"` |
|
|
|
SyncInfo SyncInfo `json:"sync_info"` |
|
|
|
ValidatorInfo ValidatorInfo `json:"validator_info"` |
|
|
|
} |
|
|
|
|
|
|
|
// Is TxIndexing enabled
|
|
|
|
func (s *ResultStatus) TxIndexEnabled() bool { |
|
|
|
if s == nil { |
|
|
|
return false |
|
|
@ -87,41 +96,51 @@ func (s *ResultStatus) TxIndexEnabled() bool { |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
// Info about peer connections
|
|
|
|
type ResultNetInfo struct { |
|
|
|
Listening bool `json:"listening"` |
|
|
|
Listeners []string `json:"listeners"` |
|
|
|
Peers []Peer `json:"peers"` |
|
|
|
} |
|
|
|
|
|
|
|
// Log from dialing seeds
|
|
|
|
type ResultDialSeeds struct { |
|
|
|
Log string `json:"log"` |
|
|
|
} |
|
|
|
|
|
|
|
// Log from dialing peers
|
|
|
|
type ResultDialPeers struct { |
|
|
|
Log string `json:"log"` |
|
|
|
} |
|
|
|
|
|
|
|
// A peer
|
|
|
|
type Peer struct { |
|
|
|
p2p.NodeInfo `json:"node_info"` |
|
|
|
IsOutbound bool `json:"is_outbound"` |
|
|
|
ConnectionStatus p2p.ConnectionStatus `json:"connection_status"` |
|
|
|
} |
|
|
|
|
|
|
|
// Validators for a height
|
|
|
|
type ResultValidators struct { |
|
|
|
BlockHeight int64 `json:"block_height"` |
|
|
|
Validators []*types.Validator `json:"validators"` |
|
|
|
} |
|
|
|
|
|
|
|
// Info about the consensus state.
|
|
|
|
// Unstable
|
|
|
|
type ResultDumpConsensusState struct { |
|
|
|
RoundState json.RawMessage `json:"round_state"` |
|
|
|
PeerRoundStates []PeerRoundState `json:"peer_round_states"` |
|
|
|
} |
|
|
|
|
|
|
|
// Raw JSON for the PeerRoundState
|
|
|
|
// Unstable
|
|
|
|
type PeerRoundState struct { |
|
|
|
NodeAddress string `json:"node_address"` |
|
|
|
PeerRoundState json.RawMessage `json:"peer_round_state"` |
|
|
|
} |
|
|
|
|
|
|
|
// CheckTx result
|
|
|
|
type ResultBroadcastTx struct { |
|
|
|
Code uint32 `json:"code"` |
|
|
|
Data cmn.HexBytes `json:"data"` |
|
|
@ -130,6 +149,7 @@ type ResultBroadcastTx struct { |
|
|
|
Hash cmn.HexBytes `json:"hash"` |
|
|
|
} |
|
|
|
|
|
|
|
// CheckTx and DeliverTx results
|
|
|
|
type ResultBroadcastTxCommit struct { |
|
|
|
CheckTx abci.ResponseCheckTx `json:"check_tx"` |
|
|
|
DeliverTx abci.ResponseDeliverTx `json:"deliver_tx"` |
|
|
@ -137,6 +157,7 @@ type ResultBroadcastTxCommit struct { |
|
|
|
Height int64 `json:"height"` |
|
|
|
} |
|
|
|
|
|
|
|
// Result of querying for a tx
|
|
|
|
type ResultTx struct { |
|
|
|
Hash cmn.HexBytes `json:"hash"` |
|
|
|
Height int64 `json:"height"` |
|
|
@ -146,30 +167,33 @@ type ResultTx struct { |
|
|
|
Proof types.TxProof `json:"proof,omitempty"` |
|
|
|
} |
|
|
|
|
|
|
|
// List of mempool txs
|
|
|
|
type ResultUnconfirmedTxs struct { |
|
|
|
N int `json:"n_txs"` |
|
|
|
Txs []types.Tx `json:"txs"` |
|
|
|
} |
|
|
|
|
|
|
|
// Info abci msg
|
|
|
|
type ResultABCIInfo struct { |
|
|
|
Response abci.ResponseInfo `json:"response"` |
|
|
|
} |
|
|
|
|
|
|
|
// Query abci msg
|
|
|
|
type ResultABCIQuery struct { |
|
|
|
Response abci.ResponseQuery `json:"response"` |
|
|
|
} |
|
|
|
|
|
|
|
type ResultUnsafeFlushMempool struct{} |
|
|
|
|
|
|
|
type ResultUnsafeProfile struct{} |
|
|
|
|
|
|
|
type ResultSubscribe struct{} |
|
|
|
|
|
|
|
type ResultUnsubscribe struct{} |
|
|
|
// empty results
|
|
|
|
type ( |
|
|
|
ResultUnsafeFlushMempool struct{} |
|
|
|
ResultUnsafeProfile struct{} |
|
|
|
ResultSubscribe struct{} |
|
|
|
ResultUnsubscribe struct{} |
|
|
|
ResultHealth struct{} |
|
|
|
) |
|
|
|
|
|
|
|
// Event data from a subscription
|
|
|
|
type ResultEvent struct { |
|
|
|
Query string `json:"query"` |
|
|
|
Data types.TMEventData `json:"data"` |
|
|
|
} |
|
|
|
|
|
|
|
type ResultHealth struct{} |