oasis

package
v0.2011.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: Apache-2.0 Imports: 85 Imported by: 3

Documentation

Overview

Package oasis provides the Oasis network/node/client related test helpers.

Index

Constants

View Source
const (
	ByzantineDefaultIdentitySeed = "ekiden byzantine node worker" // slot 0
	ByzantineSlot1IdentitySeed   = "ekiden byzantine node worker, luck=1"
	ByzantineSlot2IdentitySeed   = "ekiden byzantine node worker, luck=11"
	ByzantineSlot3IdentitySeed   = "ekiden byzantine node worker, luck=6"
)

Variables

This section is empty.

Functions

func LogAssertCheckpointSync added in v0.2010.0

func LogAssertCheckpointSync() log.WatcherHandlerFactory

LogAssertCheckpointSync returns a handler which checks whether initial storage sync from a checkpoint was successful or not.

func LogAssertEvent

func LogAssertEvent(event, message string) log.WatcherHandlerFactory

LogAssertEvent returns a handler which checks whether a specific log event was emitted based on JSON log output.

func LogAssertExecutionDiscrepancyDetected

func LogAssertExecutionDiscrepancyDetected() log.WatcherHandlerFactory

LogAssertExecutionDiscrepancyDetected returns a handler which checks whether an execution discrepancy was detected based on JSON log output.

func LogAssertNoExecutionDiscrepancyDetected

func LogAssertNoExecutionDiscrepancyDetected() log.WatcherHandlerFactory

LogAssertNoExecutionDiscrepancyDetected returns a handler which checks whether an execution discrepancy was not detected based on JSON log output.

func LogAssertNoRoundFailures

func LogAssertNoRoundFailures() log.WatcherHandlerFactory

LogAssertNoRoundFailures returns a handler which checks whether a round failure was detected based on JSON log output.

func LogAssertNoTimeouts

func LogAssertNoTimeouts() log.WatcherHandlerFactory

LogAssertNoTimeouts returns a handler which checks whether a timeout was detected based on JSON log output.

func LogAssertNotEvent

func LogAssertNotEvent(event, message string) log.WatcherHandlerFactory

LogAssertNotEvent returns a handler which checks whether a specific log event was not emitted based on JSON log output.

func LogAssertPeerExchangeDisabled

func LogAssertPeerExchangeDisabled() log.WatcherHandlerFactory

LogAssertPeerExchangeDisabled returns a handler which checks whether a peer exchange disabled event was detected based on JSON log output.

func LogAssertRoothashRoothashReindexing

func LogAssertRoothashRoothashReindexing() log.WatcherHandlerFactory

LogAssertRoothashRoothashReindexing returns a handler which checks whether roothash reindexing was run based on JSON log output.

func LogAssertRoundFailures added in v0.2010.0

func LogAssertRoundFailures() log.WatcherHandlerFactory

LogAssertRoundFailures returns a handler which ensures that a round failure was detected based on JSON log output.

func LogAssertTimeouts

func LogAssertTimeouts() log.WatcherHandlerFactory

LogAssertTimeouts returns a handler which checks whether a timeout was detected based on JSON log output.

func LogAssertUpgradeConsensus

func LogAssertUpgradeConsensus() log.WatcherHandlerFactory

LogAssertUpgradeConsensus returns a handler which checks whether a consensus migration handler was run based on JSON log output.

func LogAssertUpgradeStartup

func LogAssertUpgradeStartup() log.WatcherHandlerFactory

LogAssertUpgradeStartup returns a handler which checks whether a startup migration handler was run based on JSON log output.

func LogEventABCIPruneDelete

func LogEventABCIPruneDelete() log.WatcherHandlerFactory

LogEventABCIPruneDelete returns a handler which checks whether a ABCI pruning delete was detected based on JSON log output.

Types

type Byzantine

type Byzantine struct {
	Node
	// contains filtered or unexported fields
}

Byzantine is an Oasis byzantine node.

type ByzantineCfg

type ByzantineCfg struct {
	NodeCfg

	Script       string
	IdentitySeed string
	Entity       *Entity

	ExecutorIsScheduler bool

	ActivationEpoch epochtime.EpochTime
}

ByzantineCfg is the Oasis byzantine node configuration.

type ByzantineFixture

type ByzantineFixture struct {
	Script       string `json:"script"`
	IdentitySeed string `json:"identity_seed"`
	Entity       int    `json:"entity"`

	ExecutorIsScheduler bool `json:"executor_is_scheduler"`

	ActivationEpoch epochtime.EpochTime `json:"activation_epoch"`

	// Consensus contains configuration for the consensus backend.
	Consensus ConsensusFixture `json:"consensus"`

	EnableDefaultLogWatcherHandlerFactories bool                        `json:"enable_default_log_fac"`
	LogWatcherHandlerFactories              []log.WatcherHandlerFactory `json:"-"`
}

ByzantineFixture is a byzantine node fixture.

func (*ByzantineFixture) Create

func (f *ByzantineFixture) Create(net *Network) (*Byzantine, error)

Create instantiates the byzantine node described by the fixture.

type Client

type Client struct {
	Node
	// contains filtered or unexported fields
}

Client is an Oasis client node.

func (*Client) Start

func (client *Client) Start() error

Start starts an Oasis node.

type ClientCfg

type ClientCfg struct {
	NodeCfg
}

ClientCfg is the Oasis client node provisioning configuration.

type ClientFixture

type ClientFixture struct {
	// Consensus contains configuration for the consensus backend.
	Consensus ConsensusFixture `json:"consensus"`
}

ClientFixture is a client node fixture.

func (*ClientFixture) Create

func (f *ClientFixture) Create(net *Network) (*Client, error)

Create instantiates the client node described by the fixture.

type Compute

type Compute struct {
	sync.RWMutex

	Node
	// contains filtered or unexported fields
}

Compute is an Oasis compute node.

func (*Compute) ConsensusKeyPath

func (worker *Compute) ConsensusKeyPath() string

ConsensusKeyPath returns the path to the node's consensus key.

func (*Compute) ExportsPath

func (worker *Compute) ExportsPath() string

ExportsPath returns the path to the node's exports data dir.

func (*Compute) IdentityKeyPath

func (worker *Compute) IdentityKeyPath() string

IdentityKeyPath returns the path to the node's identity key.

func (*Compute) P2PKeyPath

func (worker *Compute) P2PKeyPath() string

P2PKeyPath returns the path to the node's P2P key.

func (*Compute) Start

func (worker *Compute) Start() error

Start starts an Oasis node.

func (*Compute) TLSCertPath

func (worker *Compute) TLSCertPath() string

TLSCertPath returns the path to the node's TLS certificate.

func (*Compute) TLSKeyPath

func (worker *Compute) TLSKeyPath() string

TLSKeyPath returns the path to the node's TLS key.

func (*Compute) UpdateRuntimes

func (worker *Compute) UpdateRuntimes(runtimes []int)

UpdateRuntimes updates the worker node runtimes.

type ComputeCfg

type ComputeCfg struct {
	NodeCfg

	Entity *Entity

	RuntimeProvisioner string

	Runtimes []int
}

ComputeCfg is the Oasis compute node configuration.

type ComputeWorkerFixture

type ComputeWorkerFixture struct {
	Entity int `json:"entity"`

	RuntimeProvisioner string `json:"runtime_provisioner"`

	AllowEarlyTermination bool `json:"allow_early_termination"`
	AllowErrorTermination bool `json:"allow_error_termination"`

	NoAutoStart bool `json:"no_auto_start,omitempty"`

	// Consensus contains configuration for the consensus backend.
	Consensus ConsensusFixture `json:"consensus"`

	LogWatcherHandlerFactories []log.WatcherHandlerFactory `json:"-"`

	// Runtimes contains the indexes of the runtimes to enable.
	Runtimes []int `json:"runtimes,omitempty"`
}

ComputeWorkerFixture is a compute worker fixture.

func (*ComputeWorkerFixture) Create

func (f *ComputeWorkerFixture) Create(net *Network) (*Compute, error)

Create instantiates the compute worker described by the fixture.

type ConsensusFixture

type ConsensusFixture struct {
	// MinGasPrice specifies the minimum gas price accepted by a validator node.
	MinGasPrice uint64 `json:"min_gas_price"`
	// SubmissionGasPrice is the gas price to use when submitting consensus transactions.
	SubmissionGasPrice uint64 `json:"submission_gas_price"`

	// DisableCheckTx causes the consensus layer to skip transaction checks.
	DisableCheckTx bool `json:"disable_check_tx"`

	// PruneNumKept is the number of blocks to keep (zero disables pruning).
	PruneNumKept uint64 `json:"prune_num_kept"`

	// TendermintRecoverCorruptedWAL enables automatic recovery of corrupted Tendermint's WAL.
	TendermintRecoverCorruptedWAL bool `json:"tendermint_recover_corrupted_wal"`

	// EnableConsensusRPCWorker enables the public consensus RPC services worker.
	EnableConsensusRPCWorker bool `json:"enable_consensusrpc_worker,omitempty"`
}

ConsensusFixture is a fixture containing consensus-related configuration.

type ConsensusStateSyncCfg

type ConsensusStateSyncCfg struct {
	ConsensusNodes []string
	TrustHeight    uint64
	TrustHash      string
}

ConsensusStateSyncCfg is a node's consensus state sync configuration.

type Controller

type Controller struct {
	control.DebugController
	control.NodeController

	Consensus     consensus.ClientBackend
	Staking       staking.Backend
	Registry      registry.Backend
	RuntimeClient runtimeClient.RuntimeClient
	Storage       storage.Backend
	Keymanager    *keymanager.KeymanagerClient
	// contains filtered or unexported fields
}

Controller is a network controller that connects to one of the Oasis nodes and enables queries and issuing commands.

func NewController

func NewController(socketPath string) (*Controller, error)

NewController creates a new node controller given the path to a node's internal socket.

func (*Controller) Close

func (c *Controller) Close()

Close closes the gRPC connection with the node the controller is controlling.

type Entity

type Entity struct {
	// contains filtered or unexported fields
}

Entity is an Oasis entity.

func (*Entity) DescriptorPath

func (ent *Entity) DescriptorPath() string

DescriptorPath returns the path to the entity descriptor.

func (*Entity) EntityKeyPath

func (ent *Entity) EntityKeyPath() string

EntityKeyPath returns the path to the entity private key.

func (*Entity) Inner

func (ent *Entity) Inner() (*entity.Entity, signature.Signer)

Inner returns the actual Oasis entity and it's signer.

func (*Entity) Signer

func (ent *Entity) Signer() signature.Signer

Signer returns the entity signer.

type EntityCfg

type EntityCfg struct {
	IsDebugTestEntity bool
	Restore           bool
}

EntityCfg is the Oasis entity provisioning configuration.

type IASCfg

type IASCfg struct {
	// UseRegistry specifies whether the IAS proxy should use the registry
	// instead of the genesis document for authenticating runtime IDs.
	UseRegistry bool `json:"use_registry,omitempty"`

	// Mock specifies if Mock IAS Proxy should be used.
	Mock bool `json:"mock,omitempty"`
}

IASCfg is the Oasis test network IAS configuration.

type Keymanager

type Keymanager struct {
	Node
	// contains filtered or unexported fields
}

Keymanager is an Oasis key manager.

func (*Keymanager) ConsensusKeyPath

func (km *Keymanager) ConsensusKeyPath() string

ConsensusKeyPath returns the path to the node's consensus key.

func (*Keymanager) ExportsPath

func (km *Keymanager) ExportsPath() string

ExportsPath returns the path to the node's exports data dir.

func (*Keymanager) IdentityKeyPath

func (km *Keymanager) IdentityKeyPath() string

IdentityKeyPath returns the paths to the node's identity key.

func (*Keymanager) P2PKeyPath

func (km *Keymanager) P2PKeyPath() string

P2PKeyPath returns the paths to the node's P2P key.

func (*Keymanager) Start

func (km *Keymanager) Start() error

Start starts an Oasis node.

func (*Keymanager) TLSCertPath

func (km *Keymanager) TLSCertPath() string

TLSCertPath returns the path to the node's TLS certificate.

func (*Keymanager) TLSKeyPath

func (km *Keymanager) TLSKeyPath() string

TLSKeyPath returns the path to the node's TLS key.

type KeymanagerCfg

type KeymanagerCfg struct {
	NodeCfg

	SentryIndices []int

	Runtime *Runtime
	Entity  *Entity
	Policy  *KeymanagerPolicy
}

KeymanagerCfg is the Oasis key manager provisioning configuration.

type KeymanagerFixture

type KeymanagerFixture struct {
	Runtime int `json:"runtime"`
	Entity  int `json:"entity"`
	Policy  int `json:"policy"`

	AllowEarlyTermination bool `json:"allow_early_termination"`
	AllowErrorTermination bool `json:"allow_error_termination"`

	NoAutoStart bool `json:"no_auto_start,omitempty"`

	Sentries []int `json:"sentries,omitempty"`

	// Consensus contains configuration for the consensus backend.
	Consensus ConsensusFixture `json:"consensus"`

	LogWatcherHandlerFactories []log.WatcherHandlerFactory `json:"-"`
}

KeymanagerFixture is a key manager fixture.

func (*KeymanagerFixture) Create

func (f *KeymanagerFixture) Create(net *Network) (*Keymanager, error)

Create instantiates the key manager described by the fixture.

type KeymanagerPolicy

type KeymanagerPolicy struct {
	// contains filtered or unexported fields
}

KeymanagerPolicy is an Oasis key manager policy document.

type KeymanagerPolicyCfg

type KeymanagerPolicyCfg struct {
	Runtime *Runtime
	Serial  int
}

KeymanagerPolicyCfg is an Oasis key manager policy document configuration.

type KeymanagerPolicyFixture

type KeymanagerPolicyFixture struct {
	Runtime int `json:"runtime"`
	Serial  int `json:"serial"`
}

KeymangerPolicyFixgure is a key manager policy fixture.

func (*KeymanagerPolicyFixture) Create

Create instantiates the key manager policy described in the fixture.

type Network

type Network struct {
	// contains filtered or unexported fields
}

Network is a test Oasis network.

func New

func New(env *env.Env, cfg *NetworkCfg) (*Network, error)

New creates a new test Oasis network.

func (*Network) AddLogWatcher

func (net *Network) AddLogWatcher(node *Node) error

AddLogWatcher adds a log watcher for the given node and creates log watcher handlers from the networks's default and node's specific log watcher handler factories.

func (*Network) BasePath

func (net *Network) BasePath() string

BasePath returns the path to the network base directory.

func (*Network) Byzantine

func (net *Network) Byzantine() []*Byzantine

Byzantine returns the byzantine nodes associated with the network.

func (*Network) CheckLogWatchers

func (net *Network) CheckLogWatchers() (err error)

CheckLogWatchers closes all log watchers and checks if any errors were reported while the log watchers were running.

func (*Network) ClientController

func (net *Network) ClientController() *Controller

ClientController returns the client controller connected to the first client node.

func (*Network) Clients

func (net *Network) Clients() []*Client

Clients returns the client nodes associated with the network.

func (*Network) ComputeWorkers

func (net *Network) ComputeWorkers() []*Compute

ComputeWorkers returns the compute worker nodes associated with the network.

func (*Network) Config

func (net *Network) Config() *NetworkCfg

Config returns the network configuration.

func (*Network) Controller

func (net *Network) Controller() *Controller

Controller returns the network controller.

func (*Network) Entities

func (net *Network) Entities() []*Entity

Entities returns the entities associated with the network.

func (*Network) Errors

func (net *Network) Errors() <-chan error

Errors returns the channel by which node failures will be conveyed.

func (*Network) GenesisPath

func (net *Network) GenesisPath() string

GenesisPath returns the path to the genesis file for the network.

func (*Network) GetCLIConfig

func (net *Network) GetCLIConfig() cli.Config

Implements cli.Factory.

func (*Network) Keymanagers

func (net *Network) Keymanagers() []*Keymanager

Keymanagers returns the keymanagers associated with the network.

func (*Network) MakeGenesis added in v0.2011.0

func (net *Network) MakeGenesis() error

MakeGenesis generates a new Genesis file.

func (*Network) NewByzantine

func (net *Network) NewByzantine(cfg *ByzantineCfg) (*Byzantine, error)

NewByzantine provisions a new byzantine node and adds it to the network.

func (*Network) NewClient

func (net *Network) NewClient(cfg *ClientCfg) (*Client, error)

NewClient provisions a new client node and adds it to the network.

func (*Network) NewCompute

func (net *Network) NewCompute(cfg *ComputeCfg) (*Compute, error)

NewCompute provisions a new compute node and adds it to the network.

func (*Network) NewEntity

func (net *Network) NewEntity(cfg *EntityCfg) (*Entity, error)

NewEntity provisions a new entity and adds it to the network.

func (*Network) NewKeymanager

func (net *Network) NewKeymanager(cfg *KeymanagerCfg) (*Keymanager, error)

NewKeymanager provisions a new keymanager and adds it to the network.

func (*Network) NewKeymanagerPolicy

func (net *Network) NewKeymanagerPolicy(cfg *KeymanagerPolicyCfg) (*KeymanagerPolicy, error)

NewKeymanagerPolicy provisions a new keymanager policy and adds it to the network.

func (*Network) NewRuntime

func (net *Network) NewRuntime(cfg *RuntimeCfg) (*Runtime, error)

NewRuntime provisions a new runtime and adds it to the network.

func (*Network) NewSeed added in v0.2011.2

func (net *Network) NewSeed(cfg *SeedCfg) (*Seed, error)

NewSeed provisions a new seed node and adds it to the network.

func (*Network) NewSentry

func (net *Network) NewSentry(cfg *SentryCfg) (*Sentry, error)

NewSentry provisions a new sentry node and adds it to the network.

func (*Network) NewStorage

func (net *Network) NewStorage(cfg *StorageCfg) (*Storage, error)

NewStorage provisions a new storage node and adds it to the network.

func (*Network) NewValidator

func (net *Network) NewValidator(cfg *ValidatorCfg) (*Validator, error)

NewValidator provisions a new validator and adds it to the network.

func (*Network) Nodes added in v0.2010.0

func (net *Network) Nodes() []*Node

Nodes returns all the validator, compute, storage, keymanager and client nodes associated with the network.

Seed, sentry, byzantine and IAS proxy nodes are omitted.

func (*Network) NumRegisterNodes

func (net *Network) NumRegisterNodes() int

NumRegisterNodes returns the number of all nodes that need to register.

func (*Network) Runtimes

func (net *Network) Runtimes() []*Runtime

Runtimes returns the runtimes associated with the network.

func (*Network) Seeds added in v0.2011.2

func (net *Network) Seeds() []*Seed

Seeds returns the seed node associated with the network.

func (*Network) Sentries

func (net *Network) Sentries() []*Sentry

Sentries returns the sentry nodes associated with the network.

func (*Network) Start

func (net *Network) Start() error

Start starts the network.

func (*Network) Stop

func (net *Network) Stop()

Stop stops the network.

func (*Network) StorageWorkers

func (net *Network) StorageWorkers() []*Storage

StorageWorkers returns the storage worker nodes associated with the network.

func (*Network) Validators

func (net *Network) Validators() []*Validator

Validators returns the validators associated with the network.

type NetworkCfg

type NetworkCfg struct {
	// GenesisFile is an optional genesis file to use.
	GenesisFile string `json:"genesis_file,omitempty"`

	// NodeBinary is the path to the Oasis node binary.
	NodeBinary string `json:"node_binary"`

	// RuntimeSGXLoaderBinary is the path to the Oasis SGX runtime loader.
	RuntimeSGXLoaderBinary string `json:"runtime_loader_binary"`

	// Consensus are the network-wide consensus parameters.
	Consensus consensusGenesis.Genesis `json:"consensus"`

	// InitialHeight is the initial block height.
	InitialHeight int64 `json:"initial_height,omitempty"`

	// HaltEpoch is the halt epoch height flag.
	HaltEpoch uint64 `json:"halt_epoch"`

	// EpochtimeMock is the mock epochtime flag.
	EpochtimeMock bool `json:"epochtime_mock"`

	// EpochtimeTendermintInterval is the tendermint epochtime block interval.
	EpochtimeTendermintInterval int64 `json:"epochtime_tendermint_interval"`

	// DeterministicIdentities is the deterministic identities flag.
	DeterministicIdentities bool `json:"deterministic_identities"`

	// FundEntities is the fund entities flag.
	FundEntities bool `json:"fund_entities"`

	// IAS is the Network IAS configuration.
	IAS IASCfg `json:"ias"`

	// StakingGenesis is the staking genesis data to be included if
	// GenesisFile is not set.
	StakingGenesis *staking.Genesis `json:"StakingGenesis,omitempty"`

	// A set of log watcher handler factories used by default on all nodes
	// created in this test network.
	DefaultLogWatcherHandlerFactories []log.WatcherHandlerFactory `json:"-"`

	// UseShortGrpcSocketPaths specifies whether nodes should use internal.sock in datadir or
	// externally-provided.
	UseShortGrpcSocketPaths bool `json:"-"`
}

NetworkCfg is the Oasis test network configuration.

type NetworkFixture

type NetworkFixture struct {
	TEE                TEEFixture                `json:"tee,omitempty"`
	Network            NetworkCfg                `json:"network,omitempty"`
	Entities           []EntityCfg               `json:"entities,omitempty"`
	Runtimes           []RuntimeFixture          `json:"runtimes,omitempty"`
	Validators         []ValidatorFixture        `json:"validators,omitempty"`
	Keymanagers        []KeymanagerFixture       `json:"keymanagers,omitempty"`
	KeymanagerPolicies []KeymanagerPolicyFixture `json:"keymanager_policies,omitempty"`
	StorageWorkers     []StorageWorkerFixture    `json:"storage_workers,omitempty"`
	ComputeWorkers     []ComputeWorkerFixture    `json:"compute_workers,omitempty"`
	Sentries           []SentryFixture           `json:"sentries,omitempty"`
	Clients            []ClientFixture           `json:"clients,omitempty"`
	Seeds              []SeedFixture             `json:"seeds,omitempty"`
	ByzantineNodes     []ByzantineFixture        `json:"byzantine_nodes,omitempty"`
}

NetworkFixture describes configuration for the test Oasis network and all the spawned nodes.

func (*NetworkFixture) Create

func (f *NetworkFixture) Create(env *env.Env) (*Network, error)

Create instantiates the network described by the fixture.

type Node

type Node struct {
	sync.Mutex

	Name   string
	NodeID signature.PublicKey
	// contains filtered or unexported fields
}

Node defines the common fields for all node types.

func (*Node) BinaryPath

func (n *Node) BinaryPath() string

BinaryPath returns the path to the running node's process' image, or an empty string if the node isn't running yet. This can be used as a replacement for NetworkCfg.NodeBinary in cases where the test runner is actually using a wrapper to start the node.

func (*Node) Consensus added in v0.2010.0

func (n *Node) Consensus() ConsensusFixture

Consensus returns the node's consensus configuration.

func (*Node) DataDir

func (n *Node) DataDir() string

DataDir returns the path to the node's data directory.

func (*Node) Exit

func (n *Node) Exit() chan error

Exit returns a channel that will close once the node shuts down. If the node shut down due to an error, that error will be sent through this channel.

func (*Node) LoadIdentity

func (n *Node) LoadIdentity() (*identity.Identity, error)

LoadIdentity loads the node's identity.

func (*Node) LogPath

func (n *Node) LogPath() string

LogPath returns the path to the node's log.

func (*Node) Restart

func (n *Node) Restart(ctx context.Context) error

Restart kills the node, waits for it to stop, and starts it again.

func (*Node) RestartAfter added in v0.2011.0

func (n *Node) RestartAfter(ctx context.Context, startDelay time.Duration) error

RestartAfter kills the node, waits for it to stop, and starts it again after delay.

func (*Node) SetConsensusStateSync

func (n *Node) SetConsensusStateSync(cfg *ConsensusStateSyncCfg)

SetConsensusStateSync configures wheteher a node should perform

func (*Node) SocketPath

func (n *Node) SocketPath() string

SocketPath returns the path of the node's gRPC unix socket.

func (*Node) Stop

func (n *Node) Stop() error

Stop stops the node.

func (*Node) WaitReady

func (n *Node) WaitReady(ctx context.Context) error

WaitReady is a helper for creating a controller and calling node's WaitReady.

type NodeCfg

type NodeCfg struct {
	AllowEarlyTermination bool
	AllowErrorTermination bool

	NoAutoStart bool

	DisableDefaultLogWatcherHandlerFactories bool
	LogWatcherHandlerFactories               []log.WatcherHandlerFactory

	// Consensus contains configuration for the consensus backend.
	Consensus ConsensusFixture
}

NodeCfg defines the common node configuration options.

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

Runtime is an Oasis runtime.

func (*Runtime) GetEnclaveIdentity

func (rt *Runtime) GetEnclaveIdentity() *sgx.EnclaveIdentity

GetEnclaveIdentity returns the runtime's enclave ID.

func (*Runtime) GetGenesisStatePath

func (rt *Runtime) GetGenesisStatePath() string

GetGenesisStatePath returns the path to the runtime genesis state file (if any).

func (*Runtime) ID

func (rt *Runtime) ID() common.Namespace

ID returns the runtime ID.

func (*Runtime) Kind

func (rt *Runtime) Kind() registry.RuntimeKind

Kind returns the runtime kind.

func (*Runtime) ToRuntimeDescriptor

func (rt *Runtime) ToRuntimeDescriptor() registry.Runtime

ToRuntimeDescriptor returns a registry runtime descriptor for this runtime.

type RuntimeCfg

type RuntimeCfg struct {
	ID          common.Namespace
	Kind        registry.RuntimeKind
	Entity      *Entity
	Keymanager  *Runtime
	TEEHardware node.TEEHardware
	MrSigner    *sgx.MrSigner

	Binaries         []string
	GenesisState     storage.WriteLog
	GenesisStatePath string
	GenesisRound     uint64

	Executor     registry.ExecutorParameters
	TxnScheduler registry.TxnSchedulerParameters
	Storage      registry.StorageParameters

	AdmissionPolicy registry.RuntimeAdmissionPolicy
	Staking         registry.RuntimeStakingParameters

	Pruner RuntimePrunerCfg

	ExcludeFromGenesis bool
}

RuntimeCfg is the Oasis runtime provisioning configuration.

type RuntimeFixture

type RuntimeFixture struct {
	ID         common.Namespace     `json:"id"`
	Kind       registry.RuntimeKind `json:"kind"`
	Entity     int                  `json:"entity"`
	Keymanager int                  `json:"keymanager"`

	Binaries         []string         `json:"binaries"`
	GenesisState     storage.WriteLog `json:"genesis_state,omitempty"`
	GenesisStatePath string           `json:"genesis_state_path,omitempty"`
	GenesisRound     uint64           `json:"genesis_round,omitempty"`

	Executor     registry.ExecutorParameters     `json:"executor"`
	TxnScheduler registry.TxnSchedulerParameters `json:"txn_scheduler"`
	Storage      registry.StorageParameters      `json:"storage"`

	AdmissionPolicy registry.RuntimeAdmissionPolicy   `json:"admission_policy"`
	Staking         registry.RuntimeStakingParameters `json:"staking,omitempty"`

	Pruner RuntimePrunerCfg `json:"pruner,omitempty"`

	ExcludeFromGenesis bool `json:"exclude_from_genesis,omitempty"`
}

RuntimeFixture is a runtime fixture.

func (*RuntimeFixture) Create

func (f *RuntimeFixture) Create(netFixture *NetworkFixture, net *Network) (*Runtime, error)

Create instantiates the runtime described by the fixture.

type RuntimePrunerCfg

type RuntimePrunerCfg struct {
	Strategy string        `json:"strategy"`
	Interval time.Duration `json:"interval"`

	NumKept uint64 `json:"num_kept"`
}

RuntimePrunerCfg is the pruner configuration for an Oasis runtime.

type Seed added in v0.2011.2

type Seed struct {
	Node
	// contains filtered or unexported fields
}

Seed is an Oasis seed node.

type SeedCfg added in v0.2011.2

type SeedCfg struct {
	DisableAddrBookFromGenesis bool
}

SeedCfg is the Oasis seed node configuration.

type SeedFixture added in v0.2011.2

type SeedFixture struct {
	DisableAddrBookFromGenesis bool `json:"disable_addr_book_from_genesis"`
}

SeedFixture is a seed node fixture.

func (*SeedFixture) Create added in v0.2011.2

func (f *SeedFixture) Create(net *Network) (*Seed, error)

Create instantiates the seed node described by the fixture.

type Sentry

type Sentry struct {
	Node
	// contains filtered or unexported fields
}

Sentry is an Oasis sentry node.

func (*Sentry) GetSentryAddress

func (sentry *Sentry) GetSentryAddress() string

GetSentryAddress returns the sentry grpc endpoint address.

func (*Sentry) GetSentryControlAddress

func (sentry *Sentry) GetSentryControlAddress() string

GetSentryControlAddress returns the sentry control endpoint address.

func (*Sentry) GetTLSPubKey

func (sentry *Sentry) GetTLSPubKey() signature.PublicKey

GetTLSPubKey returns the sentry TLS public key.

func (*Sentry) TLSCertPath

func (sentry *Sentry) TLSCertPath() string

TLSCertPath returns the path to the node's TLS certificate.

type SentryCfg

type SentryCfg struct {
	NodeCfg

	ValidatorIndices  []int
	StorageIndices    []int
	KeymanagerIndices []int
}

SentryCfg is the Oasis sentry node configuration.

type SentryFixture

type SentryFixture struct {
	LogWatcherHandlerFactories []log.WatcherHandlerFactory `json:"-"`

	Validators        []int `json:"validators"`
	StorageWorkers    []int `json:"storage_workers"`
	KeymanagerWorkers []int `json:"keymanager_workers"`
}

SentryFixture is a sentry node fixture.

func (*SentryFixture) Create

func (f *SentryFixture) Create(net *Network) (*Sentry, error)

Create instantiates the sentry node described by the fixture.

type Storage

type Storage struct {
	Node
	// contains filtered or unexported fields
}

Storage is an Oasis storage node.

func (*Storage) ConsensusKeyPath

func (worker *Storage) ConsensusKeyPath() string

ConsensusKeyPath returns the path to the node's consensus key.

func (*Storage) DatabasePath

func (worker *Storage) DatabasePath() string

DatabasePath returns the path to the node's database.

func (*Storage) ExportsPath

func (worker *Storage) ExportsPath() string

Exports path returns the path to the node's exports data dir.

func (*Storage) GetClientAddress

func (worker *Storage) GetClientAddress() string

GetClientAddress returns the storage node endpoint address.

func (*Storage) IdentityKeyPath

func (worker *Storage) IdentityKeyPath() string

IdentityKeyPath returns the path to the node's identity key.

func (*Storage) P2PKeyPath

func (worker *Storage) P2PKeyPath() string

P2PKeyPath returns the path to the node's P2P key.

func (*Storage) Start

func (worker *Storage) Start() error

Start starts an Oasis node.

func (*Storage) TLSCertPath

func (worker *Storage) TLSCertPath() string

TLSCertPath returns the path to the node's TLS certificate.

func (*Storage) TLSKeyPath

func (worker *Storage) TLSKeyPath() string

TLSKeyPath returns the path to the node's TLS key.

type StorageCfg

type StorageCfg struct {
	NodeCfg

	SentryIndices []int
	Backend       string
	Entity        *Entity

	DisableCertRotation     bool
	IgnoreApplies           bool
	CheckpointSyncDisabled  bool
	CheckpointCheckInterval time.Duration

	Runtimes []int
}

StorageCfg is the Oasis storage node configuration.

type StorageWorkerFixture

type StorageWorkerFixture struct {
	Backend string `json:"backend"`
	Entity  int    `json:"entity"`

	AllowEarlyTermination bool `json:"allow_early_termination"`
	AllowErrorTermination bool `json:"allow_error_termination"`

	NoAutoStart bool `json:"no_auto_start,omitempty"`

	DisableCertRotation bool `json:"disable_cert_rotation"`

	LogWatcherHandlerFactories []log.WatcherHandlerFactory `json:"-"`

	Sentries []int `json:"sentries,omitempty"`

	// Consensus contains configuration for the consensus backend.
	Consensus ConsensusFixture `json:"consensus"`

	CheckpointCheckInterval time.Duration `json:"checkpoint_check_interval,omitempty"`
	IgnoreApplies           bool          `json:"ignore_applies,omitempty"`
	CheckpointSyncEnabled   bool          `json:"checkpoint_sync_enabled,omitempty"`

	// Runtimes contains the indexes of the runtimes to enable. Leave
	// empty or nil for the default behaviour (i.e. include all runtimes).
	Runtimes []int `json:"runtimes,omitempty"`
}

StorageWorkerFixture is a storage worker fixture.

func (*StorageWorkerFixture) Create

func (f *StorageWorkerFixture) Create(net *Network) (*Storage, error)

Create instantiates the storage worker described by the fixture.

type TEEFixture

type TEEFixture struct {
	Hardware node.TEEHardware `json:"hardware"`
	MrSigner *sgx.MrSigner    `json:"mr_signer"`
}

TEEFixture is a TEE configuration fixture.

type Validator

type Validator struct {
	Node
	// contains filtered or unexported fields
}

Validator is an Oasis validator.

func (*Validator) ConsensusKeyPath

func (val *Validator) ConsensusKeyPath() string

ConsensusKeyPath returns the path to the node's consensus key.

func (*Validator) ExportsPath

func (val *Validator) ExportsPath() string

Exports path returns the path to the node's exports data dir.

func (*Validator) ExternalGRPCAddress

func (val *Validator) ExternalGRPCAddress() string

ExternalGRPCAddress returns the address of the node's external gRPC server.

func (*Validator) IdentityKeyPath

func (val *Validator) IdentityKeyPath() string

IdentityKeyPath returns the path to the node's identity key.

func (*Validator) P2PKeyPath

func (val *Validator) P2PKeyPath() string

P2PKeyPath returns the path to the node's P2P key.

func (*Validator) Start

func (val *Validator) Start() error

Start starts an Oasis node.

type ValidatorCfg

type ValidatorCfg struct {
	NodeCfg

	Entity *Entity

	Sentries []*Sentry
}

ValidatorCfg is the Oasis validator provisioning configuration.

type ValidatorFixture

type ValidatorFixture struct {
	AllowEarlyTermination bool `json:"allow_early_termination"`
	AllowErrorTermination bool `json:"allow_error_termination"`

	NoAutoStart bool `json:"no_auto_start,omitempty"`

	Entity int `json:"entity"`

	LogWatcherHandlerFactories []log.WatcherHandlerFactory `json:"-"`

	Sentries []int `json:"sentries,omitempty"`

	// Consensus contains configuration for the consensus backend.
	Consensus ConsensusFixture `json:"consensus"`
}

ValidatorFixture is a validator fixture.

func (*ValidatorFixture) Create

func (f *ValidatorFixture) Create(net *Network) (*Validator, error)

Create instantiates the validator described by the fixture.

Directories

Path Synopsis
Package cli contains helpers for various oasis-node subcommands.
Package cli contains helpers for various oasis-node subcommands.

Jump to

Keyboard shortcuts

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