coretypes

package
v0.35.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: Apache-2.0 Imports: 8 Imported by: 39

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrZeroOrNegativePerPage  = errors.New("zero or negative per_page")
	ErrPageOutOfRange         = errors.New("page should be within range")
	ErrZeroOrNegativeHeight   = errors.New("height must be greater than zero")
	ErrHeightExceedsChainHead = errors.New("height must be less than or equal to the head of the node's blockchain")
	ErrHeightNotAvailable     = errors.New("height is not available")
	// ErrInvalidRequest is used as a wrapper to cover more specific cases where the user has
	// made an invalid request
	ErrInvalidRequest = errors.New("invalid request")
)

List of standardized errors used across RPC

Functions

This section is empty.

Types

type Peer

type Peer struct {
	ID  types.NodeID `json:"node_id"`
	URL string       `json:"url"`
}

A peer

type PeerStateInfo

type PeerStateInfo struct {
	NodeAddress string          `json:"node_address"`
	PeerState   json.RawMessage `json:"peer_state"`
}

UNSTABLE

type ResultABCIInfo

type ResultABCIInfo struct {
	Response abci.ResponseInfo `json:"response"`
}

Info abci msg

type ResultABCIQuery

type ResultABCIQuery struct {
	Response abci.ResponseQuery `json:"response"`
}

Query abci msg

type ResultBlock

type ResultBlock struct {
	BlockID types.BlockID `json:"block_id"`
	Block   *types.Block  `json:"block"`
}

Single block (with meta)

type ResultBlockResults

type ResultBlockResults struct {
	Height                int64                     `json:"height"`
	TxsResults            []*abci.ResponseDeliverTx `json:"txs_results"`
	TotalGasUsed          int64                     `json:"total_gas_used"`
	BeginBlockEvents      []abci.Event              `json:"begin_block_events"`
	EndBlockEvents        []abci.Event              `json:"end_block_events"`
	ValidatorUpdates      []abci.ValidatorUpdate    `json:"validator_updates"`
	ConsensusParamUpdates *tmproto.ConsensusParams  `json:"consensus_param_updates"`
}

ABCI results from a block

type ResultBlockSearch

type ResultBlockSearch struct {
	Blocks     []*ResultBlock `json:"blocks"`
	TotalCount int            `json:"total_count"`
}

ResultBlockSearch defines the RPC response type for a block search by events.

type ResultBlockchainInfo

type ResultBlockchainInfo struct {
	LastHeight int64              `json:"last_height"`
	BlockMetas []*types.BlockMeta `json:"block_metas"`
}

List of blocks

type ResultBroadcastEvidence

type ResultBroadcastEvidence struct {
	Hash []byte `json:"hash"`
}

Result of broadcasting evidence

type ResultBroadcastTx

type ResultBroadcastTx struct {
	Code         uint32         `json:"code"`
	Data         bytes.HexBytes `json:"data"`
	Log          string         `json:"log"`
	Codespace    string         `json:"codespace"`
	MempoolError string         `json:"mempool_error"`

	Hash bytes.HexBytes `json:"hash"`
}

CheckTx result

type ResultBroadcastTxCommit

type ResultBroadcastTxCommit struct {
	CheckTx   abci.ResponseCheckTx   `json:"check_tx"`
	DeliverTx abci.ResponseDeliverTx `json:"deliver_tx"`
	Hash      bytes.HexBytes         `json:"hash"`
	Height    int64                  `json:"height"`
}

CheckTx and DeliverTx results

type ResultCheckTx

type ResultCheckTx struct {
	abci.ResponseCheckTx
}

ResultCheckTx wraps abci.ResponseCheckTx.

type ResultCommit

type ResultCommit struct {
	types.SignedHeader `json:"signed_header"`
	CanonicalCommit    bool `json:"canonical"`
}

Commit and Header

func NewResultCommit

func NewResultCommit(header *types.Header, commit *types.Commit,
	canonical bool) *ResultCommit

NewResultCommit is a helper to initialize the ResultCommit with the embedded struct

type ResultConsensusParams

type ResultConsensusParams struct {
	BlockHeight     int64                 `json:"block_height"`
	ConsensusParams types.ConsensusParams `json:"consensus_params"`
}

ConsensusParams for given height

type ResultConsensusState

type ResultConsensusState struct {
	RoundState json.RawMessage `json:"round_state"`
}

UNSTABLE

type ResultDialPeers

type ResultDialPeers struct {
	Log string `json:"log"`
}

Log from dialing peers

type ResultDialSeeds

type ResultDialSeeds struct {
	Log string `json:"log"`
}

Log from dialing seeds

type ResultDumpConsensusState

type ResultDumpConsensusState struct {
	RoundState json.RawMessage `json:"round_state"`
	Peers      []PeerStateInfo `json:"peers"`
}

Info about the consensus state. UNSTABLE

type ResultEvent

type ResultEvent struct {
	SubscriptionID string            `json:"subscription_id"`
	Query          string            `json:"query"`
	Data           types.TMEventData `json:"data"`
	Events         []abci.Event      `json:"events"`
}

Event data from a subscription

type ResultGenesis

type ResultGenesis struct {
	Genesis *types.GenesisDoc `json:"genesis"`
}

Genesis file

type ResultGenesisChunk

type ResultGenesisChunk struct {
	ChunkNumber int    `json:"chunk"`
	TotalChunks int    `json:"total"`
	Data        string `json:"data"`
}

ResultGenesisChunk is the output format for the chunked/paginated interface. These chunks are produced by converting the genesis document to JSON and then splitting the resulting payload into 16 megabyte blocks and then base64 encoding each block.

type ResultHealth

type ResultHealth struct{}

empty results

type ResultNetInfo

type ResultNetInfo struct {
	Listening bool     `json:"listening"`
	Listeners []string `json:"listeners"`
	NPeers    int      `json:"n_peers"`
	Peers     []Peer   `json:"peers"`
}

Info about peer connections

type ResultStatus

type ResultStatus struct {
	NodeInfo      types.NodeInfo `json:"node_info"`
	SyncInfo      SyncInfo       `json:"sync_info"`
	ValidatorInfo ValidatorInfo  `json:"validator_info"`
}

Node Status

func (*ResultStatus) TxIndexEnabled

func (s *ResultStatus) TxIndexEnabled() bool

Is TxIndexing enabled

type ResultSubscribe

type ResultSubscribe struct{}

empty results

type ResultTx

type ResultTx struct {
	Hash     bytes.HexBytes         `json:"hash"`
	Height   int64                  `json:"height"`
	Index    uint32                 `json:"index"`
	TxResult abci.ResponseDeliverTx `json:"tx_result"`
	Tx       types.Tx               `json:"tx"`
	Proof    types.TxProof          `json:"proof,omitempty"`
}

Result of querying for a tx

type ResultTxSearch

type ResultTxSearch struct {
	Txs        []*ResultTx `json:"txs"`
	TotalCount int         `json:"total_count"`
}

Result of searching for txs

type ResultUnconfirmedTxs

type ResultUnconfirmedTxs struct {
	Count      int        `json:"n_txs"`
	Total      int        `json:"total"`
	TotalBytes int64      `json:"total_bytes"`
	Txs        []types.Tx `json:"txs"`
}

List of mempool txs

type ResultUnsafeFlushMempool

type ResultUnsafeFlushMempool struct{}

empty results

type ResultUnsafeProfile

type ResultUnsafeProfile struct{}

empty results

type ResultUnsubscribe

type ResultUnsubscribe struct{}

empty results

type ResultValidators

type ResultValidators struct {
	BlockHeight int64              `json:"block_height"`
	Validators  []*types.Validator `json:"validators"`
	// Count of actual validators in this result
	Count int `json:"count"`
	// Total number of validators
	Total int `json:"total"`
}

Validators for a height.

type SyncInfo

type SyncInfo struct {
	LatestBlockHash   bytes.HexBytes `json:"latest_block_hash"`
	LatestAppHash     bytes.HexBytes `json:"latest_app_hash"`
	LatestBlockHeight int64          `json:"latest_block_height"`
	LatestBlockTime   time.Time      `json:"latest_block_time"`

	EarliestBlockHash   bytes.HexBytes `json:"earliest_block_hash"`
	EarliestAppHash     bytes.HexBytes `json:"earliest_app_hash"`
	EarliestBlockHeight int64          `json:"earliest_block_height"`
	EarliestBlockTime   time.Time      `json:"earliest_block_time"`

	MaxPeerBlockHeight int64 `json:"max_peer_block_height"`

	CatchingUp bool `json:"catching_up"`

	TotalSyncedTime time.Duration `json:"total_synced_time"`
	RemainingTime   time.Duration `json:"remaining_time"`

	TotalSnapshots      int64         `json:"total_snapshots"`
	ChunkProcessAvgTime time.Duration `json:"chunk_process_avg_time"`
	SnapshotHeight      int64         `json:"snapshot_height"`
	SnapshotChunksCount int64         `json:"snapshot_chunks_count"`
	SnapshotChunksTotal int64         `json:"snapshot_chunks_total"`
	BackFilledBlocks    int64         `json:"backfilled_blocks"`
	BackFillBlocksTotal int64         `json:"backfill_blocks_total"`
}

Info about the node's syncing state

type ValidatorInfo

type ValidatorInfo struct {
	Address     bytes.HexBytes `json:"address"`
	PubKey      crypto.PubKey  `json:"pub_key"`
	VotingPower int64          `json:"voting_power"`
}

Info about the node's validator

Jump to

Keyboard shortcuts

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