Documentation ¶
Overview ¶
Package oasis provides the Oasis network/node/client related test helpers.
Index ¶
- Constants
- func LogAssertCheckpointSync() log.WatcherHandlerFactory
- func LogAssertEvent(event, message string) log.WatcherHandlerFactory
- func LogAssertExecutionDiscrepancyDetected() log.WatcherHandlerFactory
- func LogAssertNoExecutionDiscrepancyDetected() log.WatcherHandlerFactory
- func LogAssertNoRoundFailures() log.WatcherHandlerFactory
- func LogAssertNoTimeouts() log.WatcherHandlerFactory
- func LogAssertNotEvent(event, message string) log.WatcherHandlerFactory
- func LogAssertPeerExchangeDisabled() log.WatcherHandlerFactory
- func LogAssertRoothashRoothashReindexing() log.WatcherHandlerFactory
- func LogAssertRoundFailures() log.WatcherHandlerFactory
- func LogAssertTimeouts() log.WatcherHandlerFactory
- func LogAssertUpgradeConsensus() log.WatcherHandlerFactory
- func LogAssertUpgradeStartup() log.WatcherHandlerFactory
- func LogEventABCIPruneDelete() log.WatcherHandlerFactory
- type Byzantine
- type ByzantineCfg
- type ByzantineFixture
- type Client
- type ClientCfg
- type ClientFixture
- type Compute
- func (worker *Compute) ConsensusKeyPath() string
- func (worker *Compute) ExportsPath() string
- func (worker *Compute) IdentityKeyPath() string
- func (worker *Compute) P2PKeyPath() string
- func (worker *Compute) Start() error
- func (worker *Compute) TLSCertPath() string
- func (worker *Compute) TLSKeyPath() string
- func (worker *Compute) UpdateRuntimes(runtimes []int)
- type ComputeCfg
- type ComputeWorkerFixture
- type ConsensusFixture
- type ConsensusStateSyncCfg
- type Controller
- type Entity
- type EntityCfg
- type IASCfg
- type Keymanager
- func (km *Keymanager) ConsensusKeyPath() string
- func (km *Keymanager) ExportsPath() string
- func (km *Keymanager) IdentityKeyPath() string
- func (km *Keymanager) P2PKeyPath() string
- func (km *Keymanager) Start() error
- func (km *Keymanager) TLSCertPath() string
- func (km *Keymanager) TLSKeyPath() string
- type KeymanagerCfg
- type KeymanagerFixture
- type KeymanagerPolicy
- type KeymanagerPolicyCfg
- type KeymanagerPolicyFixture
- type Network
- func (net *Network) AddLogWatcher(node *Node) error
- func (net *Network) BasePath() string
- func (net *Network) Byzantine() []*Byzantine
- func (net *Network) CheckLogWatchers() (err error)
- func (net *Network) ClientController() *Controller
- func (net *Network) Clients() []*Client
- func (net *Network) ComputeWorkers() []*Compute
- func (net *Network) Config() *NetworkCfg
- func (net *Network) Controller() *Controller
- func (net *Network) Entities() []*Entity
- func (net *Network) Errors() <-chan error
- func (net *Network) GenesisPath() string
- func (net *Network) GetCLIConfig() cli.Config
- func (net *Network) Keymanagers() []*Keymanager
- func (net *Network) MakeGenesis() error
- func (net *Network) NewByzantine(cfg *ByzantineCfg) (*Byzantine, error)
- func (net *Network) NewClient(cfg *ClientCfg) (*Client, error)
- func (net *Network) NewCompute(cfg *ComputeCfg) (*Compute, error)
- func (net *Network) NewEntity(cfg *EntityCfg) (*Entity, error)
- func (net *Network) NewKeymanager(cfg *KeymanagerCfg) (*Keymanager, error)
- func (net *Network) NewKeymanagerPolicy(cfg *KeymanagerPolicyCfg) (*KeymanagerPolicy, error)
- func (net *Network) NewRuntime(cfg *RuntimeCfg) (*Runtime, error)
- func (net *Network) NewSeed(cfg *SeedCfg) (*Seed, error)
- func (net *Network) NewSentry(cfg *SentryCfg) (*Sentry, error)
- func (net *Network) NewStorage(cfg *StorageCfg) (*Storage, error)
- func (net *Network) NewValidator(cfg *ValidatorCfg) (*Validator, error)
- func (net *Network) Nodes() []*Node
- func (net *Network) NumRegisterNodes() int
- func (net *Network) Runtimes() []*Runtime
- func (net *Network) Seeds() []*Seed
- func (net *Network) Sentries() []*Sentry
- func (net *Network) Start() error
- func (net *Network) Stop()
- func (net *Network) StorageWorkers() []*Storage
- func (net *Network) Validators() []*Validator
- type NetworkCfg
- type NetworkFixture
- type Node
- func (n *Node) BinaryPath() string
- func (n *Node) Consensus() ConsensusFixture
- func (n *Node) DataDir() string
- func (n *Node) Exit() chan error
- func (n *Node) LoadIdentity() (*identity.Identity, error)
- func (n *Node) LogPath() string
- func (n *Node) RequestShutdown(ctx context.Context, wait bool) error
- func (n *Node) Restart(ctx context.Context) error
- func (n *Node) RestartAfter(ctx context.Context, startDelay time.Duration) error
- func (n *Node) SetConsensusStateSync(cfg *ConsensusStateSyncCfg)
- func (n *Node) SocketPath() string
- func (n *Node) Stop() error
- func (n *Node) WaitReady(ctx context.Context) error
- type NodeCfg
- type Runtime
- type RuntimeCfg
- type RuntimeFixture
- type RuntimePrunerCfg
- type Seed
- type SeedCfg
- type SeedFixture
- type Sentry
- type SentryCfg
- type SentryFixture
- type Storage
- func (worker *Storage) ConsensusKeyPath() string
- func (worker *Storage) DatabasePath() string
- func (worker *Storage) ExportsPath() string
- func (worker *Storage) GetClientAddress() string
- func (worker *Storage) IdentityKeyPath() string
- func (worker *Storage) P2PKeyPath() string
- func (worker *Storage) Start() error
- func (worker *Storage) TLSCertPath() string
- func (worker *Storage) TLSKeyPath() string
- type StorageCfg
- type StorageWorkerFixture
- type TEEFixture
- type Validator
- type ValidatorCfg
- type ValidatorFixture
Constants ¶
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.
type Client ¶
type Client struct { Node // contains filtered or unexported fields }
Client is an Oasis client node.
type ClientFixture ¶
type ClientFixture struct { // Consensus contains configuration for the consensus backend. Consensus ConsensusFixture `json:"consensus"` // MaxTransactionAge configures the MaxTransactionAge configuration of the client. MaxTransactionAge int64 `json:"max_transaction_age"` }
ClientFixture is a client node fixture.
type Compute ¶
Compute is an Oasis compute node.
func (*Compute) ConsensusKeyPath ¶
ConsensusKeyPath returns the path to the node's consensus key.
func (*Compute) ExportsPath ¶
ExportsPath returns the path to the node's exports data dir.
func (*Compute) IdentityKeyPath ¶
IdentityKeyPath returns the path to the node's identity key.
func (*Compute) P2PKeyPath ¶
P2PKeyPath returns the path to the node's P2P key.
func (*Compute) TLSCertPath ¶
TLSCertPath returns the path to the node's TLS certificate.
func (*Compute) TLSKeyPath ¶
TLSKeyPath returns the path to the node's TLS key.
func (*Compute) UpdateRuntimes ¶
UpdateRuntimes updates the worker node runtimes.
type ComputeCfg ¶
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.
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 ¶
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 ¶
DescriptorPath returns the path to the entity descriptor.
func (*Entity) EntityKeyPath ¶
EntityKeyPath returns the path to the entity private key.
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) 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 ¶
KeymanagerPolicyCfg is an Oasis key manager policy document configuration.
type KeymanagerPolicyFixture ¶
KeymangerPolicyFixgure is a key manager policy fixture.
func (*KeymanagerPolicyFixture) Create ¶
func (f *KeymanagerPolicyFixture) Create(net *Network) (*KeymanagerPolicy, error)
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 ¶
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) CheckLogWatchers ¶
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) ComputeWorkers ¶
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) GenesisPath ¶
GenesisPath returns the path to the genesis file for the network.
func (*Network) GetCLIConfig ¶
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
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) NewCompute ¶
func (net *Network) NewCompute(cfg *ComputeCfg) (*Compute, error)
NewCompute provisions a new compute node 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
NewSeed provisions a new seed 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
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 ¶
NumRegisterNodes returns the number of all nodes that need to register.
func (*Network) StorageWorkers ¶
StorageWorkers returns the storage worker nodes associated with the network.
func (*Network) Validators ¶
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.
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 ¶
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) Exit ¶
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 ¶
LoadIdentity loads the node's identity.
func (*Node) RequestShutdown ¶ added in v0.2012.3
RequestShutdown is a helper for creating a controller and calling node's RequestShutdown.
func (*Node) RestartAfter ¶ added in v0.2011.0
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 ¶
SocketPath returns the path of the node's gRPC unix socket.
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 ¶
GetGenesisStatePath returns the path to the runtime genesis state file (if any).
func (*Runtime) Kind ¶
func (rt *Runtime) Kind() registry.RuntimeKind
Kind returns the runtime kind.
func (*Runtime) ToRuntimeDescriptor ¶
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.
type Sentry ¶
type Sentry struct { Node // contains filtered or unexported fields }
Sentry is an Oasis sentry node.
func (*Sentry) GetSentryAddress ¶
GetSentryAddress returns the sentry grpc endpoint address.
func (*Sentry) GetSentryControlAddress ¶
GetSentryControlAddress returns the sentry control endpoint address.
func (*Sentry) GetTLSPubKey ¶
GetTLSPubKey returns the sentry TLS public key.
func (*Sentry) TLSCertPath ¶
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.
type Storage ¶
type Storage struct { Node // contains filtered or unexported fields }
Storage is an Oasis storage node.
func (*Storage) ConsensusKeyPath ¶
ConsensusKeyPath returns the path to the node's consensus key.
func (*Storage) DatabasePath ¶
DatabasePath returns the path to the node's database.
func (*Storage) ExportsPath ¶
Exports path returns the path to the node's exports data dir.
func (*Storage) GetClientAddress ¶
GetClientAddress returns the storage node endpoint address.
func (*Storage) IdentityKeyPath ¶
IdentityKeyPath returns the path to the node's identity key.
func (*Storage) P2PKeyPath ¶
P2PKeyPath returns the path to the node's P2P key.
func (*Storage) TLSCertPath ¶
TLSCertPath returns the path to the node's TLS certificate.
func (*Storage) TLSKeyPath ¶
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.
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 ¶
ConsensusKeyPath returns the path to the node's consensus key.
func (*Validator) ExportsPath ¶
Exports path returns the path to the node's exports data dir.
func (*Validator) ExternalGRPCAddress ¶
ExternalGRPCAddress returns the address of the node's external gRPC server.
func (*Validator) IdentityKeyPath ¶
IdentityKeyPath returns the path to the node's identity key.
func (*Validator) P2PKeyPath ¶
P2PKeyPath returns the path to the node's P2P key.
type ValidatorCfg ¶
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.