provider

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: GPL-3.0 Imports: 45 Imported by: 0

Documentation

Overview

Package provider implements the cchain.Provider interface.

Index

Constants

This section is empty.

Variables

View Source
var ErrHistoryPruned = errors.New("no commit info found (history pruned)")

ErrHistoryPruned indicates that the necessary state for the requested height isn't found in the store.

Functions

func IsErrHistoryPruned

func IsErrHistoryPruned(err error) bool

IsErrHistoryPruned reports whether the input error matches the CosmosSDK errors returned when the state for the requested height isn't found in the store.

Types

type Provider

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

Provider implements cchain.Provider.

func Dial

func Dial(network netconf.ID) (Provider, error)

Dial returns a ABCI provider to the provided network connecting to well-known public RPCs.

func NewABCI added in v0.10.0

func NewABCI(cmtCl rpcclient.Client, network netconf.ID, opts ...func(*Provider)) Provider

NewABCI returns a new provider using the provided cometBFT ABCI client.

func NewGRPC added in v0.10.0

func NewGRPC(target string, network netconf.ID, opts ...func(*Provider)) (Provider, error)

NewGRPC returns a new provider using the provided gRPC server address. This is preferred to NewABCI as it bypasses CometBFT so is much faster and doesn't affect chain performance.

func NewProviderForT

func NewProviderForT(_ *testing.T, fetch fetchFunc, latest latestFunc, window windowFunc,
	backoffFunc func(context.Context) func(),
) Provider

NewProviderForT creates a new provider for testing.

func (Provider) AllAttestationsFrom

func (p Provider) AllAttestationsFrom(ctx context.Context, chainVer xchain.ChainVersion, attestOffset uint64,
) ([]xchain.Attestation, error)

func (Provider) AppliedPlan added in v0.9.0

func (p Provider) AppliedPlan(ctx context.Context, name string) (upgradetypes.Plan, bool, error)

func (Provider) AttestationsFrom

func (p Provider) AttestationsFrom(
	ctx context.Context,
	chainVer xchain.ChainVersion,
	attestOffset uint64,
) ([]xchain.Attestation, error)

func (Provider) CurrentPlannedPlan added in v0.9.0

func (p Provider) CurrentPlannedPlan(ctx context.Context) (upgradetypes.Plan, bool, error)

func (Provider) GenesisFiles

func (p Provider) GenesisFiles(ctx context.Context) (execution []byte, consensus []byte, err error)

func (Provider) LatestAttestation

func (p Provider) LatestAttestation(ctx context.Context, chainVer xchain.ChainVersion,
) (xchain.Attestation, bool, error)

func (Provider) PortalValidatorSet

func (p Provider) PortalValidatorSet(ctx context.Context, valSetID uint64) ([]cchain.PortalValidator, bool, error)

func (Provider) Portals

func (p Provider) Portals(ctx context.Context) ([]rtypes.Portal, bool, error)

func (Provider) SDKRewards

func (p Provider) SDKRewards(ctx context.Context, operator common.Address) (float64, bool, error)

func (Provider) SDKSigningInfos

func (p Provider) SDKSigningInfos(ctx context.Context) ([]cchain.SDKSigningInfo, error)

func (Provider) SDKValidator

func (p Provider) SDKValidator(ctx context.Context, operator common.Address) (cchain.SDKValidator, bool, error)

func (Provider) SDKValidators

func (p Provider) SDKValidators(ctx context.Context) ([]cchain.SDKValidator, error)

func (Provider) StreamAsync

func (p Provider) StreamAsync(
	ctx context.Context,
	chainVer xchain.ChainVersion,
	attestOffset uint64,
	workerName string,
	callback cchain.ProviderCallback,
)

func (Provider) StreamAttestations

func (p Provider) StreamAttestations(
	ctx context.Context,
	chainVer xchain.ChainVersion,
	attestOffset uint64,
	workerName string,
	callback cchain.ProviderCallback,
) error

func (Provider) WindowCompare

func (p Provider) WindowCompare(ctx context.Context, chainVer xchain.ChainVersion, attestOffset uint64) (int, error)

func (Provider) XBlock

func (p Provider) XBlock(ctx context.Context, height uint64, latest bool) (xchain.Block, bool, error)

XBlock returns the consensus XBlock at the given height/offset or latest, or false if not available, or an error.

Jump to

Keyboard shortcuts

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