api

package
v0.2400.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package api provides a light CometBFT consensus backend API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLightBlock added in v0.2300.6

func NewLightBlock(clb *cmttypes.LightBlock) (*consensus.LightBlock, error)

NewLightBlock creates a new consensus.LightBlock from a CometBFT light block.

Types

type Client

type Client interface {
	consensus.LightClient

	// GetVerifiedLightBlock returns a verified light block.
	GetVerifiedLightBlock(ctx context.Context, height int64) (*cmttypes.LightBlock, error)

	// GetVerifiedParameters returns verified consensus parameters.
	GetVerifiedParameters(ctx context.Context, height int64) (*cmtproto.ConsensusParams, error)
}

Client is a CometBFT consensus light client that talks with remote oasis-nodes that are using the CometBFT consensus backend and verifies responses.

type ClientConfig

type ClientConfig struct {
	// GenesisDocument is the CometBFT genesis document.
	GenesisDocument *cmttypes.GenesisDoc

	// TrustOptions are CometBFT light client trust options.
	TrustOptions cmtlight.TrustOptions
}

ClientConfig is the configuration for the light client.

type ClientService

type ClientService interface {
	consensus.LightService

	Client
}

ClientService is a CometBFT consensus light client service.

type Provider

type Provider interface {
	cmtlightprovider.Provider
	consensus.LightClient

	// Initialized returns a channel that is closed when the provider is initialized.
	Initialized() <-chan struct{}

	// PeerID returns the identifier of the peer backing the provider.
	PeerID() string

	// RefreshPeer notifies the provider to attempt to replace a peer with a fresh one.
	RefreshPeer()
}

Provider is a CometBFT light client provider.

Jump to

Keyboard shortcuts

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