Documentation
¶
Overview ¶
Package stateless implements a stateless CometBFT consensus node.
Index ¶
- func NewProvider(address string, cert *tls.Certificate) (*consensusAPI.Client, error)
- type CompositeProvider
- func (p *CompositeProvider) EstimateGas(ctx context.Context, req *consensusAPI.EstimateGasRequest) (transaction.Gas, error)
- func (p *CompositeProvider) GetBlock(ctx context.Context, height int64) (*consensusAPI.Block, error)
- func (p *CompositeProvider) GetBlockResults(ctx context.Context, height int64) (*consensusAPI.BlockResults, error)
- func (p *CompositeProvider) GetChainContext(ctx context.Context) (string, error)
- func (p *CompositeProvider) GetGenesisDocument(ctx context.Context) (*genesis.Document, error)
- func (p *CompositeProvider) GetLastRetainedHeight(ctx context.Context) (int64, error)
- func (p *CompositeProvider) GetLatestHeight(ctx context.Context) (int64, error)
- func (p *CompositeProvider) GetLightBlock(ctx context.Context, height int64) (*consensusAPI.LightBlock, error)
- func (p *CompositeProvider) GetNextBlockState(ctx context.Context) (*consensusAPI.NextBlockState, error)
- func (p *CompositeProvider) GetParameters(ctx context.Context, height int64) (*consensusAPI.Parameters, error)
- func (p *CompositeProvider) GetSignerNonce(ctx context.Context, req *consensusAPI.GetSignerNonceRequest) (uint64, error)
- func (p *CompositeProvider) GetStatus(context.Context) (*consensusAPI.Status, error)
- func (p *CompositeProvider) GetTransactions(ctx context.Context, height int64) ([][]byte, error)
- func (p *CompositeProvider) GetTransactionsWithProofs(ctx context.Context, height int64) (*consensusAPI.TransactionsWithProofs, error)
- func (p *CompositeProvider) GetTransactionsWithResults(ctx context.Context, height int64) (*consensusAPI.TransactionsWithResults, error)
- func (p *CompositeProvider) GetUnconfirmedTransactions(ctx context.Context) ([][]byte, error)
- func (p *CompositeProvider) GetValidators(ctx context.Context, height int64) (*consensusAPI.Validators, error)
- func (p *CompositeProvider) MinGasPrice(ctx context.Context) (*quantity.Quantity, error)
- func (p *CompositeProvider) State() syncer.ReadSyncer
- func (p *CompositeProvider) StateToGenesis(ctx context.Context, height int64) (*genesis.Document, error)
- func (p *CompositeProvider) SubmitEvidence(ctx context.Context, evidence *consensusAPI.Evidence) error
- func (p *CompositeProvider) SubmitTx(ctx context.Context, tx *transaction.SignedTransaction) error
- func (p *CompositeProvider) SubmitTxNoWait(ctx context.Context, tx *transaction.SignedTransaction) error
- func (p *CompositeProvider) SubmitTxWithProof(ctx context.Context, tx *transaction.SignedTransaction) (*transaction.Proof, error)
- func (p *CompositeProvider) SyncGet(ctx context.Context, req *syncer.GetRequest) (*syncer.ProofResponse, error)
- func (p *CompositeProvider) SyncGetPrefixes(ctx context.Context, req *syncer.GetPrefixesRequest) (*syncer.ProofResponse, error)
- func (p *CompositeProvider) SyncIterate(ctx context.Context, req *syncer.IterateRequest) (*syncer.ProofResponse, error)
- func (p *CompositeProvider) WatchBlocks(ctx context.Context) (<-chan *consensusAPI.Block, pubsub.ClosableSubscription, error)
- type Config
- type Core
- func (c *Core) EstimateGas(ctx context.Context, req *consensusAPI.EstimateGasRequest) (transaction.Gas, error)
- func (c *Core) GetBlock(ctx context.Context, height int64) (*consensusAPI.Block, error)
- func (c *Core) GetBlockResults(ctx context.Context, height int64) (*consensusAPI.BlockResults, error)
- func (c *Core) GetChainContext(context.Context) (string, error)
- func (c *Core) GetGenesisDocument(context.Context) (*genesisAPI.Document, error)
- func (c *Core) GetLastRetainedHeight(ctx context.Context) (int64, error)
- func (c *Core) GetLatestHeight(ctx context.Context) (int64, error)
- func (c *Core) GetLightBlock(ctx context.Context, height int64) (*consensusAPI.LightBlock, error)
- func (c *Core) GetNextBlockState(ctx context.Context) (*consensusAPI.NextBlockState, error)
- func (c *Core) GetParameters(ctx context.Context, height int64) (*consensusAPI.Parameters, error)
- func (c *Core) GetSignerNonce(context.Context, *consensusAPI.GetSignerNonceRequest) (uint64, error)
- func (c *Core) GetStatus(ctx context.Context) (*consensusAPI.Status, error)
- func (c *Core) GetTransactions(ctx context.Context, height int64) ([][]byte, error)
- func (c *Core) GetTransactionsWithProofs(ctx context.Context, height int64) (*consensusAPI.TransactionsWithProofs, error)
- func (c *Core) GetTransactionsWithResults(ctx context.Context, height int64) (*consensusAPI.TransactionsWithResults, error)
- func (c *Core) GetUnconfirmedTransactions(ctx context.Context) ([][]byte, error)
- func (c *Core) GetValidators(ctx context.Context, height int64) (*consensusAPI.Validators, error)
- func (c *Core) MinGasPrice(ctx context.Context) (*quantity.Quantity, error)
- func (c *Core) Serve(ctx context.Context) error
- func (c *Core) SetQueriers(beaconQuerier beacon.QueryFactory, consensusQuerier consensus.QueryFactory, ...)
- func (c *Core) State() syncer.ReadSyncer
- func (c *Core) StateRoot(ctx context.Context, height int64) (mkvsNode.Root, error)
- func (c *Core) StateToGenesis(context.Context, int64) (*genesisAPI.Document, error)
- func (c *Core) SubmitEvidence(ctx context.Context, evidence *consensusAPI.Evidence) error
- func (c *Core) SubmitTx(ctx context.Context, tx *transaction.SignedTransaction) error
- func (c *Core) SubmitTxNoWait(ctx context.Context, tx *transaction.SignedTransaction) error
- func (c *Core) SubmitTxWithProof(ctx context.Context, tx *transaction.SignedTransaction) (*transaction.Proof, error)
- func (c *Core) WatchBlocks(context.Context) (<-chan *consensusAPI.Block, pubsub.ClosableSubscription, error)
- type Service
- func (s *Service) Checkpointer() checkpoint.Checkpointer
- func (s *Service) Cleanup()
- func (s *Service) GetAddresses() ([]node.ConsensusAddress, error)
- func (s *Service) Name() string
- func (s *Service) Pruner() consensusAPI.StatePruner
- func (s *Service) Quit() <-chan struct{}
- func (s *Service) Serve(ctx context.Context) error
- func (s *Service) Start() error
- func (s *Service) Stop()
- func (s *Service) SubmissionManager() consensusAPI.SubmissionManager
- func (s *Service) SupportedFeatures() consensusAPI.FeatureMask
- func (s *Service) Synced() <-chan struct{}
- type Services
- func (s *Services) Beacon() beaconAPI.Backend
- func (s *Services) Core() consensusAPI.Backend
- func (s *Services) Governance() governanceAPI.Backend
- func (s *Services) KeyManager() keymanagerAPI.Backend
- func (s *Services) Registry() registryAPI.Backend
- func (s *Services) RootHash() roothashAPI.Backend
- func (s *Services) Scheduler() schedulerAPI.Backend
- func (s *Services) Serve(ctx context.Context) error
- func (s *Services) Staking() stakingAPI.Backend
- func (s *Services) Synced() <-chan struct{}
- func (s *Services) Vault() vaultAPI.Backend
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewProvider ¶
func NewProvider(address string, cert *tls.Certificate) (*consensusAPI.Client, error)
NewProvider creates a new consensus provider for the stateless client.
Types ¶
type CompositeProvider ¶
type CompositeProvider struct {
// contains filtered or unexported fields
}
CompositeProvider routes consensus requests to the most suitable provider based on dynamic scoring.
func NewCompositeProvider ¶
func NewCompositeProvider(providers []consensusAPI.Backend) *CompositeProvider
NewCompositeProvider creates a new composite consensus provider for the stateless client.
func (*CompositeProvider) EstimateGas ¶
func (p *CompositeProvider) EstimateGas(ctx context.Context, req *consensusAPI.EstimateGasRequest) (transaction.Gas, error)
EstimateGas implements consensusAPI.Backend.
func (*CompositeProvider) GetBlock ¶
func (p *CompositeProvider) GetBlock(ctx context.Context, height int64) (*consensusAPI.Block, error)
GetBlock implements consensusAPI.Backend.
func (*CompositeProvider) GetBlockResults ¶
func (p *CompositeProvider) GetBlockResults(ctx context.Context, height int64) (*consensusAPI.BlockResults, error)
GetBlockResults implements consensusAPI.Backend.
func (*CompositeProvider) GetChainContext ¶
func (p *CompositeProvider) GetChainContext(ctx context.Context) (string, error)
GetChainContext implements consensusAPI.Backend.
func (*CompositeProvider) GetGenesisDocument ¶
GetGenesisDocument implements consensusAPI.Backend.
func (*CompositeProvider) GetLastRetainedHeight ¶
func (p *CompositeProvider) GetLastRetainedHeight(ctx context.Context) (int64, error)
GetLastRetainedHeight implements consensusAPI.Backend.
func (*CompositeProvider) GetLatestHeight ¶
func (p *CompositeProvider) GetLatestHeight(ctx context.Context) (int64, error)
GetLatestHeight implements consensusAPI.Backend.
func (*CompositeProvider) GetLightBlock ¶
func (p *CompositeProvider) GetLightBlock(ctx context.Context, height int64) (*consensusAPI.LightBlock, error)
GetLightBlock implements consensusAPI.Backend.
func (*CompositeProvider) GetNextBlockState ¶
func (p *CompositeProvider) GetNextBlockState(ctx context.Context) (*consensusAPI.NextBlockState, error)
GetNextBlockState implements consensusAPI.Backend.
func (*CompositeProvider) GetParameters ¶
func (p *CompositeProvider) GetParameters(ctx context.Context, height int64) (*consensusAPI.Parameters, error)
GetParameters implements consensusAPI.Backend.
func (*CompositeProvider) GetSignerNonce ¶
func (p *CompositeProvider) GetSignerNonce(ctx context.Context, req *consensusAPI.GetSignerNonceRequest) (uint64, error)
GetSignerNonce implements consensusAPI.Backend.
func (*CompositeProvider) GetStatus ¶
func (p *CompositeProvider) GetStatus(context.Context) (*consensusAPI.Status, error)
GetStatus implements consensusAPI.Backend.
func (*CompositeProvider) GetTransactions ¶
GetTransactions implements consensusAPI.Backend.
func (*CompositeProvider) GetTransactionsWithProofs ¶
func (p *CompositeProvider) GetTransactionsWithProofs(ctx context.Context, height int64) (*consensusAPI.TransactionsWithProofs, error)
GetTransactionsWithProofs implements consensusAPI.Backend.
func (*CompositeProvider) GetTransactionsWithResults ¶
func (p *CompositeProvider) GetTransactionsWithResults(ctx context.Context, height int64) (*consensusAPI.TransactionsWithResults, error)
GetTransactionsWithResults implements consensusAPI.Backend.
func (*CompositeProvider) GetUnconfirmedTransactions ¶
func (p *CompositeProvider) GetUnconfirmedTransactions(ctx context.Context) ([][]byte, error)
GetUnconfirmedTransactions implements consensusAPI.Backend.
func (*CompositeProvider) GetValidators ¶ added in v0.2508.0
func (p *CompositeProvider) GetValidators(ctx context.Context, height int64) (*consensusAPI.Validators, error)
GetValidators implements consensusAPI.Backend.
func (*CompositeProvider) MinGasPrice ¶
MinGasPrice implements consensusAPI.Backend.
func (*CompositeProvider) State ¶
func (p *CompositeProvider) State() syncer.ReadSyncer
State implements consensusAPI.Backend.
func (*CompositeProvider) StateToGenesis ¶
func (p *CompositeProvider) StateToGenesis(ctx context.Context, height int64) (*genesis.Document, error)
StateToGenesis implements consensusAPI.Backend.
func (*CompositeProvider) SubmitEvidence ¶
func (p *CompositeProvider) SubmitEvidence(ctx context.Context, evidence *consensusAPI.Evidence) error
SubmitEvidence implements consensusAPI.Backend.
func (*CompositeProvider) SubmitTx ¶
func (p *CompositeProvider) SubmitTx(ctx context.Context, tx *transaction.SignedTransaction) error
SubmitTx implements consensusAPI.Backend.
func (*CompositeProvider) SubmitTxNoWait ¶
func (p *CompositeProvider) SubmitTxNoWait(ctx context.Context, tx *transaction.SignedTransaction) error
SubmitTxNoWait implements consensusAPI.Backend.
func (*CompositeProvider) SubmitTxWithProof ¶
func (p *CompositeProvider) SubmitTxWithProof(ctx context.Context, tx *transaction.SignedTransaction) (*transaction.Proof, error)
SubmitTxWithProof implements consensusAPI.Backend.
func (*CompositeProvider) SyncGet ¶
func (p *CompositeProvider) SyncGet(ctx context.Context, req *syncer.GetRequest) (*syncer.ProofResponse, error)
SyncGet implements syncer.ReadSyncer.
func (*CompositeProvider) SyncGetPrefixes ¶
func (p *CompositeProvider) SyncGetPrefixes(ctx context.Context, req *syncer.GetPrefixesRequest) (*syncer.ProofResponse, error)
SyncGetPrefixes implements syncer.ReadSyncer.
func (*CompositeProvider) SyncIterate ¶
func (p *CompositeProvider) SyncIterate(ctx context.Context, req *syncer.IterateRequest) (*syncer.ProofResponse, error)
SyncIterate implements syncer.ReadSyncer.
func (*CompositeProvider) WatchBlocks ¶
func (p *CompositeProvider) WatchBlocks(ctx context.Context) (<-chan *consensusAPI.Block, pubsub.ClosableSubscription, error)
WatchBlocks implements consensusAPI.Backend.
type Config ¶
type Config struct {
// ChainID is the unique identifier of the chain.
ChainID string
// ChainContext is the chain's domain separation context.
ChainContext string
// Genesis provides access to the genesis document.
Genesis genesisAPI.Provider
// GenesisDoc is the CometBFT genesis document.
GenesisDoc *cmttypes.GenesisDoc
// GenesisHeight is the block height at which the genesis document
// was generated.
GenesisHeight int64
// BaseEpoch is the starting epoch.
BaseEpoch beaconAPI.EpochTime
// BaseHeight is the starting height.
BaseHeight int64
}
Config contains configuration parameters for the stateless services.
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core is a stateless implementation of consensus backend.
func NewCore ¶
NewCore creates a new stateless consensus backend.
After construction, queriers must be set before using the instance.
func (*Core) EstimateGas ¶
func (c *Core) EstimateGas(ctx context.Context, req *consensusAPI.EstimateGasRequest) (transaction.Gas, error)
EstimateGas implements api.Backend.
func (*Core) GetBlockResults ¶
func (c *Core) GetBlockResults(ctx context.Context, height int64) (*consensusAPI.BlockResults, error)
GetBlockResults implements api.Backend.
func (*Core) GetChainContext ¶
GetChainContext implements api.Backend.
func (*Core) GetGenesisDocument ¶
GetGenesisDocument implements api.Backend.
func (*Core) GetLastRetainedHeight ¶
GetLastRetainedHeight implements api.Backend.
func (*Core) GetLatestHeight ¶
GetLatestHeight implements api.Backend.
func (*Core) GetLightBlock ¶
func (c *Core) GetLightBlock(ctx context.Context, height int64) (*consensusAPI.LightBlock, error)
GetLightBlock implements api.Backend.
func (*Core) GetNextBlockState ¶
func (c *Core) GetNextBlockState(ctx context.Context) (*consensusAPI.NextBlockState, error)
GetNextBlockState implements api.Backend.
func (*Core) GetParameters ¶
func (c *Core) GetParameters(ctx context.Context, height int64) (*consensusAPI.Parameters, error)
GetParameters implements api.Backend.
func (*Core) GetSignerNonce ¶
func (c *Core) GetSignerNonce(context.Context, *consensusAPI.GetSignerNonceRequest) (uint64, error)
GetSignerNonce implements api.Backend.
func (*Core) GetTransactions ¶
GetTransactions implements api.Backend.
func (*Core) GetTransactionsWithProofs ¶
func (c *Core) GetTransactionsWithProofs(ctx context.Context, height int64) (*consensusAPI.TransactionsWithProofs, error)
GetTransactionsWithProofs implements api.Backend.
func (*Core) GetTransactionsWithResults ¶
func (c *Core) GetTransactionsWithResults(ctx context.Context, height int64) (*consensusAPI.TransactionsWithResults, error)
GetTransactionsWithResults implements api.Backend.
func (*Core) GetUnconfirmedTransactions ¶
GetUnconfirmedTransactions implements api.Backend.
func (*Core) GetValidators ¶ added in v0.2508.0
func (c *Core) GetValidators(ctx context.Context, height int64) (*consensusAPI.Validators, error)
GetValidators implements api.Backend.
func (*Core) MinGasPrice ¶
MinGasPrice implements api.Backend.
func (*Core) SetQueriers ¶
func (c *Core) SetQueriers(beaconQuerier beacon.QueryFactory, consensusQuerier consensus.QueryFactory, registryQuerier registry.QueryFactory)
SetQueriers sets consensus and registry queriers.
func (*Core) StateToGenesis ¶
StateToGenesis implements api.Backend.
func (*Core) SubmitEvidence ¶
SubmitEvidence implements api.Backend.
func (*Core) SubmitTx ¶
func (c *Core) SubmitTx(ctx context.Context, tx *transaction.SignedTransaction) error
SubmitTx implements api.Backend.
func (*Core) SubmitTxNoWait ¶
func (c *Core) SubmitTxNoWait(ctx context.Context, tx *transaction.SignedTransaction) error
SubmitTxNoWait implements api.Backend.
func (*Core) SubmitTxWithProof ¶
func (c *Core) SubmitTxWithProof(ctx context.Context, tx *transaction.SignedTransaction) (*transaction.Proof, error)
SubmitTxWithProof implements api.Backend.
func (*Core) WatchBlocks ¶
func (c *Core) WatchBlocks(context.Context) (<-chan *consensusAPI.Block, pubsub.ClosableSubscription, error)
WatchBlocks implements api.Backend.
type Service ¶
type Service struct {
*Services
// contains filtered or unexported fields
}
Service is a stateless CometBFT service.
func NewService ¶
func NewService(services *Services, submitter consensusAPI.SubmissionManager) (*Service, error)
NewService creates a new stateless CometBFT service.
func (*Service) Checkpointer ¶
func (s *Service) Checkpointer() checkpoint.Checkpointer
Checkpointer implements consensusAPI.Service.
func (*Service) GetAddresses ¶
func (s *Service) GetAddresses() ([]node.ConsensusAddress, error)
GetAddresses implements consensusAPI.Service.
func (*Service) Pruner ¶
func (s *Service) Pruner() consensusAPI.StatePruner
Pruner implements consensusAPI.Service.
func (*Service) Quit ¶
func (s *Service) Quit() <-chan struct{}
Quit implements consensusAPI.Service.
func (*Service) SubmissionManager ¶
func (s *Service) SubmissionManager() consensusAPI.SubmissionManager
SubmissionManager implements consensusAPI.Service.
func (*Service) SupportedFeatures ¶
func (s *Service) SupportedFeatures() consensusAPI.FeatureMask
SupportedFeatures implements consensusAPI.Service.
type Services ¶
type Services struct {
// contains filtered or unexported fields
}
Services is a stateless implementation of CometBFT services.
func NewServices ¶
func NewServices(provider consensusAPI.Backend, lightClient *light.Client, cfg Config) (*Services, error)
NewServices creates new stateless CometBFT services.
Stateless services retrieve untrusted data from the specified remote provider and verify it using the provided light client.
func (*Services) Core ¶
func (s *Services) Core() consensusAPI.Backend
Core implements consensusAPI.Services.
func (*Services) Governance ¶
func (s *Services) Governance() governanceAPI.Backend
Governance implements consensusAPI.Services.
func (*Services) KeyManager ¶
func (s *Services) KeyManager() keymanagerAPI.Backend
KeyManager implements consensusAPI.Services.
func (*Services) Registry ¶
func (s *Services) Registry() registryAPI.Backend
Registry implements consensusAPI.Services.
func (*Services) RootHash ¶
func (s *Services) RootHash() roothashAPI.Backend
RootHash implements consensusAPI.Services.
func (*Services) Scheduler ¶
func (s *Services) Scheduler() schedulerAPI.Backend
Scheduler implements consensusAPI.Services.
func (*Services) Serve ¶
Serve listens for blocks and notifies service clients about new blocks and related events.
func (*Services) Staking ¶
func (s *Services) Staking() stakingAPI.Backend
Staking implements consensusAPI.Services.