block

package
v0.0.0-...-48972bb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHTTPResp

func GetHTTPResp(url string) (bytez []byte, err error)

Types

type Block

type Block struct {
	*Header `json:"header"`
	*Data   `json:"data"`
}

type BlockData

type BlockData struct {
	Hash           string
	ChainID        string
	Height         string
	Time           time.Time
	NumTxs         string
	LastCommitHash string
	DataHash       string
	ValidatorsHash string
	AppHash        string
	Txs            []*types.Transaction
}

func GetBlockChainList

func GetBlockChainList(min, max uint64) (blocks []*BlockData, err error)

func GetLastNumChain

func GetLastNumChain(num uint64) (blocks []*BlockData, err error)

type BlockID

type BlockID struct {
	Hash string `json:"hash"`
}

type BlockMeta

type BlockMeta struct {
	BlockID BlockID `json:"block_id"` // The block hash
	Header  *Header `json:"header"`   // The block's Header
}

type Data

type Data struct {
	Txs []string `json:"txs"`
}

type HTTPResponse

type HTTPResponse struct {
	JSONRPC string           `json:"jsonrpc"`
	ID      string           `json:"id"`
	Result  *json.RawMessage `json:"result"`
	Error   string           `json:"error"`
}
type Header struct {
	ChainID        string    `json:"chain_id"`
	Height         string    `json:"height"`
	Time           time.Time `json:"time"`
	NumTxs         string    `json:"num_txs"`          // XXX: Can we get rid of this?
	LastCommitHash string    `json:"last_commit_hash"` // commit from validators from the last block
	DataHash       string    `json:"data_hash"`        // transactions
	ValidatorsHash string    `json:"validators_hash"`  // validators for the current block
	AppHash        string    `json:"app_hash"`         // state after txs from the previous block
	//ReceiptsHash   string    `json:"recepits_hash"`    // recepits_hash from previous block
	LastBlockID BlockID `json:"last_block_id"`
}

type Metas

type Metas struct {
	BlockMetas []BlockMeta `json:"block_metas"`
}

type NodeInfo

type NodeInfo struct {
	NetWork string `json:"network"`
}

type ResultBlock

type ResultBlock struct {
	BlockMeta *BlockMeta `json:"block_meta"`
	Block     *Block     `json:"block"`
}

func GetBlock

func GetBlock(height string) (result ResultBlock, err error)

type Status

type Status struct {
	NodeInfo *NodeInfo `json:"node_info"`
	SyncInfo *SyncInfo `json:"sync_info"`
}

func GetStatus

func GetStatus() (status Status, err error)

type SyncInfo

type SyncInfo struct {
	LatestBlockHeight string `json:"latest_block_height"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL