7 "github.com/tendermint/go-crypto"
8 "github.com/tendermint/go-wire/data"
10 "github.com/bytom/p2p"
11 "github.com/bytom/protocol/bc"
14 type BlockNonce [8]byte
16 type ResultBlockchainInfo struct {
17 LastHeight uint64 `json:"last_height"`
20 type ResultBlock struct {
23 type ResultStatus struct {
24 NodeInfo *p2p.NodeInfo `json:"node_info"`
25 PubKey crypto.PubKey `json:"pub_key"`
26 LatestBlockHash data.Bytes `json:"latest_block_hash"`
27 LatestAppHash data.Bytes `json:"latest_app_hash"`
28 LatestBlockHeight int `json:"latest_block_height"`
29 LatestBlockTime int64 `json:"latest_block_time"` // nano
32 func (s *ResultStatus) TxIndexEnabled() bool {
33 if s == nil || s.NodeInfo == nil {
36 for _, s := range s.NodeInfo.Other {
37 info := strings.Split(s, "=")
38 if len(info) == 2 && info[0] == "tx_index" {
39 return info[1] == "on"
45 type ResultNetInfo struct {
46 Listening bool `json:"listening"`
47 Listeners []string `json:"listeners"`
48 Peers []Peer `json:"peers"`
51 type ResultBlockHeaderInfo struct {
52 Version int32 `json:"version"`
53 //Height uint64 `json:"height"`
54 MerkleRoot bc.Hash `json:"merkleroot"`
55 PreviousBlockHash bc.Hash `json:"prevblockhash"`
56 TimestampMS time.Time `json:"timestamp"`
57 Bits uint64 `json:"bits"`
58 Nonce uint64 `json:"nonce"`
61 type ResultDialSeeds struct {
62 Log string `json:"log"`
66 p2p.NodeInfo `json:"node_info"`
67 IsOutbound bool `json:"is_outbound"`
68 ConnectionStatus p2p.ConnectionStatus `json:"connection_status"`