Documentation ¶
Index ¶
- Variables
- type ApplicationInfo
- type EventFilter
- type EventItem
- type Evidence
- type Int64
- type Peer
- type PeerStateInfo
- type RequestABCIQuery
- type RequestBlockByHash
- type RequestBlockInfo
- type RequestBlockSearch
- type RequestBlockchainInfo
- type RequestBroadcastEvidence
- type RequestBroadcastTx
- type RequestCheckTx
- type RequestConsensusParams
- type RequestEvents
- type RequestGenesisChunked
- type RequestRemoveTx
- type RequestSubscribe
- type RequestTx
- type RequestTxSearch
- type RequestUnconfirmedTxs
- type RequestUnsubscribe
- type RequestValidators
- type ResultABCIInfo
- type ResultABCIQuery
- type ResultBlock
- type ResultBlockResults
- type ResultBlockSearch
- type ResultBlockchainInfo
- type ResultBroadcastEvidence
- type ResultBroadcastTx
- type ResultBroadcastTxCommit
- type ResultCheckTx
- type ResultCommit
- type ResultConsensusParams
- type ResultConsensusState
- type ResultDialPeers
- type ResultDialSeeds
- type ResultDumpConsensusState
- type ResultEvent
- type ResultEvents
- type ResultGenesis
- type ResultGenesisChunk
- type ResultHeader
- type ResultHealth
- type ResultNetInfo
- type ResultStatus
- type ResultSubscribe
- type ResultTx
- type ResultTxSearch
- type ResultUnconfirmedTxs
- type ResultUnsafeFlushMempool
- type ResultUnsafeProfile
- type ResultUnsubscribe
- type ResultValidators
- type SyncInfo
- type ValidatorInfo
Constants ¶
This section is empty.
Variables ¶
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 ApplicationInfo ¶
type ApplicationInfo struct {
Version string `json:"version"`
}
type EventFilter ¶
type EventFilter struct {
Query string `json:"query"`
}
An EventFilter specifies which events are selected by an /events request.
type EventItem ¶
type EventItem struct { // The cursor of this item. Cursor string `json:"cursor"` // The event label of this item (for example, "Vote"). Event string `json:"event,omitempty"` // The encoded event data for this item. The content is a JSON object with // the following structure: // // { // "type": "type-tag", // "value": <json-encoded-value> // } // // The known type tags are defined by the tendermint/types package. Data json.RawMessage `json:"data"` }
type Evidence ¶
Evidence is an argument wrapper for a types.Evidence value, that handles encoding and decoding through JSON.
func (Evidence) MarshalJSON ¶
func (*Evidence) UnmarshalJSON ¶
type Int64 ¶
type Int64 int64
Int64 is a wrapper for int64 that encodes to JSON as a string and can be decoded from either a string or a number value.
func (Int64) MarshalJSON ¶
func (*Int64) UnmarshalJSON ¶
type PeerStateInfo ¶
type PeerStateInfo struct { NodeAddress string `json:"node_address"` PeerState json.RawMessage `json:"peer_state"` }
UNSTABLE
type RequestABCIQuery ¶
type RequestBlockByHash ¶
type RequestBlockInfo ¶
type RequestBlockInfo struct {
Height *Int64 `json:"height"`
}
type RequestBlockSearch ¶
type RequestBlockchainInfo ¶
type RequestBroadcastEvidence ¶
func (RequestBroadcastEvidence) MarshalJSON ¶
func (r RequestBroadcastEvidence) MarshalJSON() ([]byte, error)
func (*RequestBroadcastEvidence) UnmarshalJSON ¶
func (r *RequestBroadcastEvidence) UnmarshalJSON(data []byte) error
type RequestBroadcastTx ¶
type RequestCheckTx ¶
type RequestConsensusParams ¶
type RequestConsensusParams struct {
Height *Int64 `json:"height"`
}
type RequestEvents ¶
type RequestEvents struct { // Optional filter spec. If nil or empty, all items are eligible. Filter *EventFilter `json:"filter"` // The maximum number of eligible items to return. // If zero or negative, the server will report a default number. MaxItems int `json:"maxItems"` // Return only items after this cursor. If empty, the limit is just // before the the beginning of the event log. After string `json:"after"` // Return only items before this cursor. If empty, the limit is just // after the head of the event log. Before string `json:"before"` // Wait for up to this long for events to be available. WaitTime time.Duration `json:"waitTime"` }
RequestEvents is the argument for the "/events" RPC endpoint.
type RequestGenesisChunked ¶
type RequestGenesisChunked struct {
Chunk Int64 `json:"chunk"`
}
type RequestRemoveTx ¶
type RequestSubscribe ¶
type RequestSubscribe struct {
Query string `json:"query"`
}
type RequestTxSearch ¶
type RequestUnconfirmedTxs ¶
type RequestUnsubscribe ¶
type RequestUnsubscribe struct {
Query string `json:"query"`
}
type RequestValidators ¶
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,string"` TxsResults []*abci.ExecTxResult `json:"txs_results"` TotalGasUsed int64 `json:"total_gas_used,string"` FinalizeBlockEvents []abci.Event `json:"finalize_block_events"` ValidatorSetUpdate *abci.ValidatorSetUpdate `json:"validator_set_updates"` ConsensusParamUpdates *types.ConsensusParams `json:"consensus_param_updates"` }
ABCI results from a block
type ResultBlockSearch ¶
type ResultBlockSearch struct { Blocks []*ResultBlock `json:"blocks"` TotalCount int `json:"total_count,string"` }
ResultBlockSearch defines the RPC response type for a block search by events.
type ResultBlockchainInfo ¶
type ResultBlockchainInfo struct { LastHeight int64 `json:"last_height,string"` 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"` Codespace string `json:"codespace"` Hash bytes.HexBytes `json:"hash"` Info string `json:"info"` }
CheckTx result
type ResultBroadcastTxCommit ¶
type ResultBroadcastTxCommit struct { CheckTx abci.ResponseCheckTx `json:"check_tx"` TxResult abci.ExecTxResult `json:"tx_result"` Hash bytes.HexBytes `json:"hash"` Height int64 `json:"height,string"` }
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 ¶
NewResultCommit is a helper to initialize the ResultCommit with the embedded struct
type ResultConsensusParams ¶
type ResultConsensusParams struct { BlockHeight int64 `json:"block_height,string"` 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 Query string Data types.EventData Events []abci.Event }
Event data from a subscription
func (ResultEvent) MarshalJSON ¶
func (r ResultEvent) MarshalJSON() ([]byte, error)
func (*ResultEvent) UnmarshalJSON ¶
func (r *ResultEvent) UnmarshalJSON(data []byte) error
type ResultEvents ¶
type ResultEvents struct { // The items matching the request parameters, from newest // to oldest, if any were available within the timeout. Items []*EventItem `json:"items"` // This is true if there is at least one older matching item // available in the log that was not returned. More bool `json:"more"` // The cursor of the oldest item in the log at the time of this reply, // or "" if the log is empty. Oldest string `json:"oldest"` // The cursor of the newest item in the log at the time of this reply, // or "" if the log is empty. Newest string `json:"newest"` }
ResultEvents is the response from the "/events" RPC endpoint.
type ResultGenesis ¶
type ResultGenesis struct {
Genesis *types.GenesisDoc `json:"genesis"`
}
Genesis file
type ResultGenesisChunk ¶
type ResultGenesisChunk struct { ChunkNumber int `json:"chunk,string"` TotalChunks int `json:"total,string"` 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 ResultHeader ¶
ResultHeader represents the response for a Header RPC Client query
type ResultNetInfo ¶
type ResultNetInfo struct { Listening bool `json:"listening"` Listeners []string `json:"listeners"` NPeers int `json:"n_peers,string"` Peers []Peer `json:"peers"` }
Info about peer connections
type ResultStatus ¶
type ResultStatus struct { NodeInfo types.NodeInfo `json:"node_info"` ApplicationInfo ApplicationInfo `json:"application_info,omitempty"` SyncInfo SyncInfo `json:"sync_info"` ValidatorInfo ValidatorInfo `json:"validator_info"` LightClientInfo types.LightClientInfo `json:"light_client_info,omitempty"` }
Node Status
func (*ResultStatus) TxIndexEnabled ¶
func (s *ResultStatus) TxIndexEnabled() bool
Is TxIndexing enabled
type ResultTx ¶
type ResultTx struct { Hash bytes.HexBytes `json:"hash"` Height int64 `json:"height,string"` Index uint32 `json:"index"` TxResult abci.ExecTxResult `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,string"` }
Result of searching for txs
type ResultUnconfirmedTxs ¶
type ResultUnconfirmedTxs struct { Count int `json:"n_txs,string"` Total int `json:"total,string"` TotalBytes int64 `json:"total_bytes,string"` Txs []types.Tx `json:"txs"` }
List of mempool txs
type ResultValidators ¶
type ResultValidators struct { BlockHeight int64 Validators []*types.Validator Count int // Count of actual validators in this result Total int // Total number of validators // dash fields ThresholdPublicKey *crypto.PubKey QuorumType btcjson.LLMQType QuorumHash *crypto.QuorumHash }
ResultValidators for a height.
func (ResultValidators) MarshalJSON ¶
func (r ResultValidators) MarshalJSON() ([]byte, error)
func (*ResultValidators) UnmarshalJSON ¶
func (r *ResultValidators) UnmarshalJSON(data []byte) error
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,string"` 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,string"` EarliestBlockTime time.Time `json:"earliest_block_time"` MaxPeerBlockHeight int64 `json:"max_peer_block_height,string"` CatchingUp bool `json:"catching_up"` TotalSyncedTime time.Duration `json:"total_synced_time,string"` RemainingTime time.Duration `json:"remaining_time,string"` TotalSnapshots int64 `json:"total_snapshots,string"` ChunkProcessAvgTime time.Duration `json:"chunk_process_avg_time,string"` SnapshotHeight int64 `json:"snapshot_height,string"` SnapshotChunksCount int64 `json:"snapshot_chunks_count,string"` BackFilledBlocks int64 `json:"backfilled_blocks,string"` BackFillBlocksTotal int64 `json:"backfill_blocks_total,string"` }
Info about the node's syncing state
type ValidatorInfo ¶
type ValidatorInfo struct { ProTxHash crypto.ProTxHash `json:"pro_tx_hash"` VotingPower int64 `json:"voting_power"` }
Info about the node's validator