6 abci "github.com/tendermint/abci/types"
7 "github.com/tendermint/go-crypto"
8 "github.com/tendermint/go-wire/data"
9 "github.com/blockchain/protocol/bc"
10 "github.com/blockchain/p2p"
11 "github.com/blockchain/types"
14 type BlockNonce [8]byte
16 type ResultBlockchainInfo struct {
17 LastHeight int `json:"last_height"`
18 BlockMetas []*types.BlockMeta `json:"block_metas"`
21 type ResultGenesis struct {
22 Genesis *types.GenesisDoc `json:"genesis"`
25 type ResultBlock struct {
26 BlockMeta *types.BlockMeta `json:"block_meta"`
27 Block *types.Block `json:"block"`
30 type ResultCommit struct {
31 Header *types.Header `json:"header"`
32 Commit *types.Commit `json:"commit"`
33 CanonicalCommit bool `json:"canonical"`
36 type ResultStatus struct {
37 NodeInfo *p2p.NodeInfo `json:"node_info"`
38 PubKey crypto.PubKey `json:"pub_key"`
39 LatestBlockHash data.Bytes `json:"latest_block_hash"`
40 LatestAppHash data.Bytes `json:"latest_app_hash"`
41 LatestBlockHeight int `json:"latest_block_height"`
42 LatestBlockTime int64 `json:"latest_block_time"` // nano
45 func (s *ResultStatus) TxIndexEnabled() bool {
46 if s == nil || s.NodeInfo == nil {
49 for _, s := range s.NodeInfo.Other {
50 info := strings.Split(s, "=")
51 if len(info) == 2 && info[0] == "tx_index" {
52 return info[1] == "on"
58 type ResultNetInfo struct {
59 Listening bool `json:"listening"`
60 Listeners []string `json:"listeners"`
61 Peers []Peer `json:"peers"`
64 type ResultBlockHeaderInfo struct {
65 Version uint64 `json:"version"`
66 Height uint64 `json:"height"`
67 MerkleRoot bc.Hash `json:"merkleroot"`
68 PreviousBlockHash bc.Hash `json:"prevblockhash"`
69 TimestampMS uint64 `json:"timestamp"`
70 Bits uint64 `json:"bits"`
71 Nonce uint64 `json:"nonce"`
74 type ResultDialSeeds struct {
75 Log string `json:"log"`
79 p2p.NodeInfo `json:"node_info"`
80 IsOutbound bool `json:"is_outbound"`
81 ConnectionStatus p2p.ConnectionStatus `json:"connection_status"`
84 type ResultValidators struct {
85 BlockHeight int `json:"block_height"`
86 Validators []*types.Validator `json:"validators"`
89 type ResultDumpConsensusState struct {
90 RoundState string `json:"round_state"`
91 PeerRoundStates []string `json:"peer_round_states"`
94 type ResultBroadcastTx struct {
95 Code abci.CodeType `json:"code"`
96 Data data.Bytes `json:"data"`
97 Log string `json:"log"`
99 Hash data.Bytes `json:"hash"`
102 type ResultBroadcastTxCommit struct {
103 CheckTx abci.Result `json:"check_tx"`
104 DeliverTx abci.Result `json:"deliver_tx"`
105 Hash data.Bytes `json:"hash"`
106 Height int `json:"height"`
109 type ResultTx struct {
110 Height int `json:"height"`
111 Index int `json:"index"`
112 TxResult abci.Result `json:"tx_result"`
113 Tx types.Tx `json:"tx"`
114 Proof types.TxProof `json:"proof,omitempty"`
117 type ResultUnconfirmedTxs struct {
119 Txs []types.Tx `json:"txs"`
122 type ResultABCIInfo struct {
123 Response abci.ResponseInfo `json:"response"`
126 type ResultABCIQuery struct {
127 *abci.ResultQuery `json:"response"`
130 type ResultUnsafeFlushMempool struct{}
132 type ResultUnsafeProfile struct{}
134 type ResultSubscribe struct{}
136 type ResultUnsubscribe struct{}
138 type ResultEvent struct {
139 Name string `json:"name"`
140 Data types.TMEventData `json:"data"`