rpc

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCouldntReachSpecifiedHeight = errors.New("couldn't reach specified height")
	ErrNotFound                    = errors.New("not found")
)
View Source
var BlocksIn20DaysPeriod = 20 * 24 * 60 * 60 / appconsts.TimeoutCommit.Seconds()

BlocksIn20DaysPeriod represents the number of blocks in 20-days period. It uses the timeout commit constant, defined in app, for the computation

Functions

This section is empty.

Types

type AppQuerier

type AppQuerier struct {
	Logger tmlog.Logger
	EncCfg encoding.Config
	// contains filtered or unexported fields
}

AppQuerier queries the application for attestations and unbonding periods.

func NewAppQuerier

func NewAppQuerier(logger tmlog.Logger, blobStreamRPC string, encCft encoding.Config) *AppQuerier

func (*AppQuerier) QueryAttestationByNonce

func (aq *AppQuerier) QueryAttestationByNonce(ctx context.Context, nonce uint64) (celestiatypes.AttestationRequestI, error)

QueryAttestationByNonce query an attestation by nonce from the state machine.

func (*AppQuerier) QueryDataCommitmentByNonce

func (aq *AppQuerier) QueryDataCommitmentByNonce(ctx context.Context, nonce uint64) (*celestiatypes.DataCommitment, error)

QueryDataCommitmentByNonce query a data commitment by its nonce.

func (*AppQuerier) QueryDataCommitmentForHeight

func (aq *AppQuerier) QueryDataCommitmentForHeight(ctx context.Context, height uint64) (*celestiatypes.DataCommitment, error)

QueryDataCommitmentForHeight query a data commitment by one of the heights that it commits to.

func (*AppQuerier) QueryEVMAddress added in v1.1.0

func (aq *AppQuerier) QueryEVMAddress(ctx context.Context, valopAddress string) (string, error)

QueryEVMAddress returns the EVM address corresponding to a validator valop address.

func (*AppQuerier) QueryEarliestAttestationNonce

func (aq *AppQuerier) QueryEarliestAttestationNonce(ctx context.Context) (int64, error)

QueryEarliestAttestationNonce query the earliest attestation nonce from state machine.

func (*AppQuerier) QueryHistoricalAttestationByNonce

func (aq *AppQuerier) QueryHistoricalAttestationByNonce(ctx context.Context, nonce uint64, height uint64) (celestiatypes.AttestationRequestI, error)

QueryHistoricalAttestationByNonce query an attestation by nonce from the state machine at a certain height.

func (*AppQuerier) QueryHistoricalLastValsetBeforeNonce

func (aq *AppQuerier) QueryHistoricalLastValsetBeforeNonce(ctx context.Context, nonce uint64, height uint64) (*celestiatypes.Valset, error)

QueryHistoricalLastValsetBeforeNonce returns the last historical valset before nonce for a certain height.

func (*AppQuerier) QueryHistoricalLatestAttestationNonce

func (aq *AppQuerier) QueryHistoricalLatestAttestationNonce(ctx context.Context, height uint64) (uint64, error)

QueryHistoricalLatestAttestationNonce query the historical latest attestation nonce from the state machine at a certain nonce.

func (*AppQuerier) QueryHistoricalValsetByNonce

func (aq *AppQuerier) QueryHistoricalValsetByNonce(ctx context.Context, nonce uint64, height uint64) (*celestiatypes.Valset, error)

QueryHistoricalValsetByNonce query a historical valset by nonce.

func (*AppQuerier) QueryLastUnbondingHeight

func (aq *AppQuerier) QueryLastUnbondingHeight(ctx context.Context) (int64, error)

QueryLastUnbondingHeight query the last unbonding height from state machine.

func (*AppQuerier) QueryLastValsetBeforeNonce

func (aq *AppQuerier) QueryLastValsetBeforeNonce(ctx context.Context, nonce uint64) (*celestiatypes.Valset, error)

QueryLastValsetBeforeNonce returns the last valset before nonce. This will be needed when signing to know the validator set at that particular nonce. the provided `nonce` can be a valset, but this will return the valset before it. If nonce is 1, it will return an error. Because, there is no valset before nonce 1.

func (*AppQuerier) QueryLatestAttestationNonce

func (aq *AppQuerier) QueryLatestAttestationNonce(ctx context.Context) (uint64, error)

QueryLatestAttestationNonce query the latest attestation nonce from the state machine.

func (*AppQuerier) QueryLatestDataCommitment

func (aq *AppQuerier) QueryLatestDataCommitment(ctx context.Context) (*celestiatypes.DataCommitment, error)

QueryLatestDataCommitment query the latest data commitment in Blobstream state machine.

func (*AppQuerier) QueryLatestValset

func (aq *AppQuerier) QueryLatestValset(ctx context.Context) (*celestiatypes.Valset, error)

QueryLatestValset query the latest recorded valset in the state machine.

func (*AppQuerier) QueryRecursiveHistoricalAttestationByNonce

func (aq *AppQuerier) QueryRecursiveHistoricalAttestationByNonce(ctx context.Context, nonce uint64, height uint64) (celestiatypes.AttestationRequestI, error)

QueryRecursiveHistoricalAttestationByNonce query an attestation by nonce from the state machine via going over the history step by step starting from height.

func (*AppQuerier) QueryRecursiveHistoricalLastValsetBeforeNonce

func (aq *AppQuerier) QueryRecursiveHistoricalLastValsetBeforeNonce(ctx context.Context, nonce uint64, height uint64) (*celestiatypes.Valset, error)

QueryRecursiveHistoricalLastValsetBeforeNonce recursively looks for the last historical valset before nonce for a certain height until genesis.

func (*AppQuerier) QueryRecursiveLatestValset

func (aq *AppQuerier) QueryRecursiveLatestValset(ctx context.Context, height uint64) (*celestiatypes.Valset, error)

QueryRecursiveLatestValset query the latest recorded valset in the state machine in history.

func (*AppQuerier) QueryStakingValidatorSet added in v1.1.0

func (aq *AppQuerier) QueryStakingValidatorSet(ctx context.Context) ([]stakingtypes.Validator, error)

QueryStakingValidatorSet returns the list of all validators in the network.

func (*AppQuerier) QueryValsetByNonce

func (aq *AppQuerier) QueryValsetByNonce(ctx context.Context, nonce uint64) (*celestiatypes.Valset, error)

QueryValsetByNonce query a valset by nonce.

func (*AppQuerier) Start

func (aq *AppQuerier) Start(grpcInsecure bool) error

func (*AppQuerier) Stop

func (aq *AppQuerier) Stop() error

type TmQuerier

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

TmQuerier queries tendermint for commitments and events.

func NewTmQuerier

func NewTmQuerier(
	tendermintRPC string,
	logger tmlog.Logger,
) *TmQuerier

func (*TmQuerier) IsRunning

func (tq *TmQuerier) IsRunning(ctx context.Context) bool

func (*TmQuerier) QueryCommitment

func (tq *TmQuerier) QueryCommitment(ctx context.Context, beginBlock uint64, endBlock uint64) (bytes.HexBytes, error)

func (*TmQuerier) QueryHeight

func (tq *TmQuerier) QueryHeight(ctx context.Context) (int64, error)

func (*TmQuerier) Reconnect

func (tq *TmQuerier) Reconnect() error

func (*TmQuerier) Start

func (tq *TmQuerier) Start() error

func (*TmQuerier) Stop

func (tq *TmQuerier) Stop() error

func (*TmQuerier) SubscribeEvents

func (tq *TmQuerier) SubscribeEvents(ctx context.Context, subscriptionName string, query string) (<-chan coretypes.ResultEvent, error)

func (*TmQuerier) UnsubscribeEvents

func (tq *TmQuerier) UnsubscribeEvents(ctx context.Context, subscriptionName string, query string) error

func (*TmQuerier) WaitForHeight

func (tq *TmQuerier) WaitForHeight(ctx context.Context, height int64) error

func (*TmQuerier) WithClientConn

func (tq *TmQuerier) WithClientConn(trpc client.Client)

Jump to

Keyboard shortcuts

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