Documentation ¶
Overview ¶
Package provider implements the cchain.Provider interface.
Index ¶
- Variables
- func IsErrHistoryPruned(err error) bool
- type Provider
- func Dial(network netconf.ID) (Provider, error)
- func NewABCI(cmtCl rpcclient.Client, network netconf.ID, opts ...func(*Provider)) Provider
- func NewGRPC(target string, network netconf.ID, opts ...func(*Provider)) (Provider, error)
- func NewProviderForT(_ *testing.T, fetch fetchFunc, latest latestFunc, window windowFunc, ...) Provider
- func (p Provider) AllAttestationsFrom(ctx context.Context, chainVer xchain.ChainVersion, attestOffset uint64) ([]xchain.Attestation, error)
- func (p Provider) AppliedPlan(ctx context.Context, name string) (upgradetypes.Plan, bool, error)
- func (p Provider) AttestationsFrom(ctx context.Context, chainVer xchain.ChainVersion, attestOffset uint64) ([]xchain.Attestation, error)
- func (p Provider) CurrentPlannedPlan(ctx context.Context) (upgradetypes.Plan, bool, error)
- func (p Provider) GenesisFiles(ctx context.Context) (execution []byte, consensus []byte, err error)
- func (p Provider) LatestAttestation(ctx context.Context, chainVer xchain.ChainVersion) (xchain.Attestation, bool, error)
- func (p Provider) PortalValidatorSet(ctx context.Context, valSetID uint64) ([]cchain.PortalValidator, bool, error)
- func (p Provider) Portals(ctx context.Context) ([]rtypes.Portal, bool, error)
- func (p Provider) SDKRewards(ctx context.Context, operator common.Address) (float64, bool, error)
- func (p Provider) SDKSigningInfos(ctx context.Context) ([]cchain.SDKSigningInfo, error)
- func (p Provider) SDKValidator(ctx context.Context, operator common.Address) (cchain.SDKValidator, bool, error)
- func (p Provider) SDKValidators(ctx context.Context) ([]cchain.SDKValidator, error)
- func (p Provider) StreamAsync(ctx context.Context, chainVer xchain.ChainVersion, attestOffset uint64, ...)
- func (p Provider) StreamAttestations(ctx context.Context, chainVer xchain.ChainVersion, attestOffset uint64, ...) error
- func (p Provider) WindowCompare(ctx context.Context, chainVer xchain.ChainVersion, attestOffset uint64) (int, error)
- func (p Provider) XBlock(ctx context.Context, height uint64, latest bool) (xchain.Block, bool, error)
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ¶
Dial returns a ABCI provider to the provided network connecting to well-known public RPCs.
func NewABCI ¶ added in v0.10.0
NewABCI returns a new provider using the provided cometBFT ABCI client.
func NewGRPC ¶ added in v0.10.0
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 (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 (Provider) GenesisFiles ¶
func (Provider) LatestAttestation ¶
func (p Provider) LatestAttestation(ctx context.Context, chainVer xchain.ChainVersion, ) (xchain.Attestation, bool, error)
func (Provider) PortalValidatorSet ¶
func (Provider) SDKRewards ¶
func (Provider) SDKSigningInfos ¶
func (Provider) SDKValidator ¶
func (Provider) SDKValidators ¶
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