tendermint

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseBlockResp

func ParseBlockResp(rawRespReader io.Reader) (*model.Block, *model.RawBlock, error)

func ParseBlockResultsResp

func ParseBlockResultsResp(rawRespReader io.Reader) (*model.BlockResults, error)

RawBlockResults related parsing functions

func ParseGenesisResp

func ParseGenesisResp(rawRespReader io.Reader, strictParsing bool) (*genesis.Genesis, error)

Block related parsing functions

Types

type GenesisResp

type GenesisResp struct {
	Jsonrpc string            `json:"jsonrpc"`
	ID      int64             `json:"id"`
	Result  GenesisRespResult `json:"result"`
}

type GenesisRespResult

type GenesisRespResult struct {
	Genesis genesis.Genesis `json:"genesis"`
}

type HTTPClient

type HTTPClient struct {
	// contains filtered or unexported fields
}

func NewHTTPClient

func NewHTTPClient(tendermintRPCUrl string, strictGenesisParsing bool) *HTTPClient

NewHTTPClient returns a new HTTPClient for tendermint request

func NewInsecureHTTPClient

func NewInsecureHTTPClient(tendermintRPCUrl string, strictGenesisParsing bool) *HTTPClient

NewHTTPClient returns a new HTTPClient for tendermint request

func (*HTTPClient) Block

func (client *HTTPClient) Block(height int64) (*usecase_model.Block, *usecase_model.RawBlock, error)

Block gets the block response with target height

func (*HTTPClient) BlockResults

func (client *HTTPClient) BlockResults(height int64) (*usecase_model.BlockResults, error)

func (*HTTPClient) Genesis

func (client *HTTPClient) Genesis() (*genesis.Genesis, error)

func (*HTTPClient) LatestBlockHeight

func (client *HTTPClient) LatestBlockHeight() (int64, error)

LatestBlockHeight gets the chain's latest block and return the height

func (*HTTPClient) Status

func (client *HTTPClient) Status() (*map[string]interface{}, error)

type RawBlockResp

type RawBlockResp struct {
	Jsonrpc string                 `json:"jsonrpc"`
	ID      int                    `json:"id"`
	Result  usecase_model.RawBlock `json:"result"`
}

type RawBlockResults

type RawBlockResults struct {
	Height                string                               `json:"height"`
	TxsResults            []RawBlockResultsTxsResult           `json:"txs_results"`
	BeginBlockEvents      []RawBlockResultsEvent               `json:"begin_block_events"`
	EndBlockEvents        []RawBlockResultsEvent               `json:"end_block_events"`
	ValidatorUpdates      []RawBlockResultsValidatorUpdate     `json:"validator_updates"`
	ConsensusParamUpdates RawBlockResultsConsensusParamUpdates `json:"consensus_param_updates"`
}

type RawBlockResultsConsensusParamUpdates

type RawBlockResultsConsensusParamUpdates struct {
	Block struct {
		MaxBytes string `json:"max_bytes"`
		MaxGas   string `json:"max_gas"`
	} `json:"block"`
	Evidence struct {
		MaxAgeNumBlocks string `json:"max_age_num_blocks"`
		MaxAgeDuration  string `json:"max_age_duration"`
		MaxBytes        string `json:"max_bytes"`
	} `json:"evidence"`
	Validator struct {
		PubKeyTypes []string `json:"pub_key_types"`
	} `json:"validator"`
}

type RawBlockResultsEvent

type RawBlockResultsEvent struct {
	Type       string                          `json:"type"`
	Attributes []RawBlockResultsEventAttribute `json:"attributes"`
}

type RawBlockResultsEventAttribute

type RawBlockResultsEventAttribute struct {
	Key   string `json:"key"`
	Value string `json:"value"`
	Index bool   `json:"index"`
}

type RawBlockResultsResp

type RawBlockResultsResp struct {
	Jsonrpc string          `json:"jsonrpc"`
	ID      int             `json:"id"`
	Result  RawBlockResults `json:"result"`
}

type RawBlockResultsTxsResult

type RawBlockResultsTxsResult struct {
	Code      int                    `json:"code"`
	Data      string                 `json:"data"`
	Log       string                 `json:"log"`
	Info      string                 `json:"info"`
	GasWanted string                 `json:"gas_wanted"`
	GasUsed   string                 `json:"gas_used"`
	Events    []RawBlockResultsEvent `json:"events"`
	Codespace string                 `json:"codespace"`
}

type RawBlockResultsTxsResultLog

type RawBlockResultsTxsResultLog struct {
	MaybeMsgIndex *int                   `json:"msg_index"`
	Events        []RawBlockResultsEvent `json:"events"`
}

type RawBlockResultsValidatorUpdate

type RawBlockResultsValidatorUpdate struct {
	PubKey struct {
		Sum struct {
			Type  string `json:"type"`
			Value struct {
				Ed25519 string `json:"ed25519"`
			} `json:"value"`
		} `json:"Sum"`
	} `json:"pub_key"`
	MaybePower string `json:"power,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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