oasis

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package oasis implements the source storage interface backed by oasis-node.

Index

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, fastSync bool) (*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) GetEpoch

func (cc *ConsensusClient) GetEpoch(ctx context.Context, height int64) (beaconAPI.EpochTime, error)

GetEpoch returns the epoch number at the specified block height.

func (*ConsensusClient) GetNodes added in v0.1.16

func (cc *ConsensusClient) GetNodes(ctx context.Context, height int64) ([]nodeapi.Node, error)

GetNodes returns the list of nodes registered at the given height.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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