tendermint

package
v1.7.38 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

View Source
const UNICODE_NULL_VALUE = "\u0000"

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, eventAttributeDecoder tendermint_interface.BlockResultEventAttributeDecoder) (*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 Base64BlockResultEventAttributeDecoder added in v1.7.20

type Base64BlockResultEventAttributeDecoder struct {
}

func (Base64BlockResultEventAttributeDecoder) DecodeKey added in v1.7.20

func (Base64BlockResultEventAttributeDecoder) DecodeValue added in v1.7.20

func (decoder Base64BlockResultEventAttributeDecoder) DecodeValue(s string) (string, error)

type GenesisChunkedResp added in v1.5.6

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

func ParseGenesisChunkedResp added in v1.5.6

func ParseGenesisChunkedResp(rawRespReader io.Reader, strictParsing bool) (*GenesisChunkedResp, error)

type GenesisChunkedRespResult added in v1.5.6

type GenesisChunkedRespResult struct {
	Chunk string `json:"chunk"`
	Total string `json:"total"`
	Data  string `json:"data"`
}

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, eventAttributeDecoder tendermint.BlockResultEventAttributeDecoder) (*usecase_model.BlockResults, error)

func (*HTTPClient) Genesis

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

func (*HTTPClient) GenesisChunked added in v1.5.6

func (client *HTTPClient) GenesisChunked() (*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) SetAuthQueryKV added in v1.7.8

func (client *HTTPClient) SetAuthQueryKV(authKV HTTPClientAuthKV)

func (*HTTPClient) Status

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

type HTTPClientAuthKV added in v1.7.8

type HTTPClientAuthKV struct {
	Key   string
	Value string
}

type RawBlockResp

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

type RawBlockResultEventAttributeDecoder added in v1.7.20

type RawBlockResultEventAttributeDecoder struct {
}

func (RawBlockResultEventAttributeDecoder) DecodeKey added in v1.7.20

func (decoder RawBlockResultEventAttributeDecoder) DecodeKey(s string) (string, error)

func (RawBlockResultEventAttributeDecoder) DecodeValue added in v1.7.20

func (decoder RawBlockResultEventAttributeDecoder) DecodeValue(s string) (string, error)

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