Documentation ¶
Overview ¶
Package oasis implements the source storage interface backed by oasis-node.
Index ¶
- func NewRuntimeClient(ctx context.Context, sourceConfig *config.SourceConfig, runtime common.Runtime) (nodeapi.RuntimeApiLite, error)
- type ConsensusClient
- func (cc *ConsensusClient) AllData(ctx context.Context, height int64) (*storage.ConsensusAllData, error)
- func (cc *ConsensusClient) BeaconData(ctx context.Context, height int64) (*storage.BeaconData, error)
- func (cc *ConsensusClient) BlockData(ctx context.Context, height int64) (*storage.ConsensusBlockData, error)
- func (cc *ConsensusClient) Close() error
- func (cc *ConsensusClient) GenesisDocument(ctx context.Context, chainContext string) (*genesisAPI.Document, error)
- func (cc *ConsensusClient) GetEpoch(ctx context.Context, height int64) (beaconAPI.EpochTime, error)
- func (cc *ConsensusClient) GovernanceData(ctx context.Context, height int64) (*storage.GovernanceData, error)
- func (cc *ConsensusClient) LatestBlockHeight(ctx context.Context) (int64, error)
- func (cc *ConsensusClient) Name() string
- func (cc *ConsensusClient) RegistryData(ctx context.Context, height int64) (*storage.RegistryData, error)
- func (cc *ConsensusClient) RootHashData(ctx context.Context, height int64) (*storage.RootHashData, error)
- func (cc *ConsensusClient) SchedulerData(ctx context.Context, height int64) (*storage.SchedulerData, error)
- func (cc *ConsensusClient) StakingData(ctx context.Context, height int64) (*storage.StakingData, error)
- func (cc *ConsensusClient) StateToGenesis(ctx context.Context, height int64) (*genesisAPI.Document, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRuntimeClient ¶
func NewRuntimeClient(ctx context.Context, sourceConfig *config.SourceConfig, runtime common.Runtime) (nodeapi.RuntimeApiLite, error)
NewRuntimeClient creates a new RuntimeClient.
Types ¶
type ConsensusClient ¶
type ConsensusClient struct {
// contains filtered or unexported fields
}
ConsensusClient is a client to the consensus methods/data of oasis node. It differs from the nodeapi.ConsensusApiLite in that:
- Its methods may collect data using multiple RPCs each.
- The return types make no effort to closely resemble oasis-core types in structure. Instead, they are structured in a way that is most convenient for the analyzer.
TODO: The benefits of this abstraction are miniscule, and introduce considerable boilerplate. Consider removing ConsensusClient, and using nodeapi.ConsensusApiLite instead.
func NewConsensusClient ¶
func NewConsensusClient(ctx context.Context, sourceConfig *config.SourceConfig) (*ConsensusClient, error)
NewConsensusClient creates a new ConsensusClient.
func (*ConsensusClient) AllData ¶
func (cc *ConsensusClient) AllData(ctx context.Context, height int64) (*storage.ConsensusAllData, error)
AllData returns all relevant data related to the given height.
func (*ConsensusClient) BeaconData ¶
func (cc *ConsensusClient) BeaconData(ctx context.Context, height int64) (*storage.BeaconData, error)
BeaconData retrieves the beacon for the provided block height.
func (*ConsensusClient) BlockData ¶
func (cc *ConsensusClient) BlockData(ctx context.Context, height int64) (*storage.ConsensusBlockData, error)
BlockData retrieves data about a consensus block at the provided block height.
func (*ConsensusClient) Close ¶
func (cc *ConsensusClient) Close() error
func (*ConsensusClient) GenesisDocument ¶
func (cc *ConsensusClient) GenesisDocument(ctx context.Context, chainContext string) (*genesisAPI.Document, error)
GenesisDocument returns the original genesis document.
func (*ConsensusClient) GovernanceData ¶
func (cc *ConsensusClient) GovernanceData(ctx context.Context, height int64) (*storage.GovernanceData, error)
GovernanceData retrieves governance events at the provided block height.
func (*ConsensusClient) LatestBlockHeight ¶
func (cc *ConsensusClient) LatestBlockHeight(ctx context.Context) (int64, error)
Implements ConsensusSourceStorage interface.
func (*ConsensusClient) Name ¶
func (cc *ConsensusClient) Name() string
Name returns the name of the client, for the ConsensusSourceStorage interface.
func (*ConsensusClient) RegistryData ¶
func (cc *ConsensusClient) RegistryData(ctx context.Context, height int64) (*storage.RegistryData, error)
RegistryData retrieves registry events at the provided block height.
func (*ConsensusClient) RootHashData ¶
func (cc *ConsensusClient) RootHashData(ctx context.Context, height int64) (*storage.RootHashData, error)
RootHashData retrieves roothash events at the provided block height.
func (*ConsensusClient) SchedulerData ¶
func (cc *ConsensusClient) SchedulerData(ctx context.Context, height int64) (*storage.SchedulerData, error)
SchedulerData retrieves validators and runtime committees at the provided block height.
func (*ConsensusClient) StakingData ¶
func (cc *ConsensusClient) StakingData(ctx context.Context, height int64) (*storage.StakingData, error)
StakingData retrieves staking events at the provided block height.
func (*ConsensusClient) StateToGenesis ¶ added in v0.1.11
func (cc *ConsensusClient) StateToGenesis(ctx context.Context, height int64) (*genesisAPI.Document, error)
StateToGenesis returns a genesis-like struct encoding the state of the chain at the given height.