cli

package
v0.2102.7 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package cli contains helpers for various oasis-node subcommands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunSubCommand

func RunSubCommand(env *env.Env, logger *logging.Logger, name, binary string, args []string) error

RunSubCommand launches an oasis-node subcommand and waits for it to complete.

Stdout and stderr are redirected into a command-specific file.

func RunSubCommandWithOutput

func RunSubCommandWithOutput(env *env.Env, logger *logging.Logger, name, binary string, args []string) (bytes.Buffer, error)

RunSubCommandWithOutput launches an oasis-node subcommand and waits for it to complete.

Stdout and stderr are redirected into a buffer.

func StartSubCommand

func StartSubCommand(childEnv *env.Env, logger *logging.Logger, name, binary string, args []string, stdout, stderr io.Writer) (*exec.Cmd, error)

StartSubCommand launches an oasis-node subcommand.

It does not wait for the subcommand to complete.

Types

type Config

type Config struct {
	// NodeBinary is the path to the oasis-node binary file.
	NodeBinary string

	// GenesisFile is the path to the genesis document.
	GenesisFile string

	// NodeSocketPath is the path to the internal UNIX socket of a node that should be used for any
	// commands which require talking to a working oasis-node.
	NodeSocketPath string
}

Config is the CLI helper configuration.

type ConsensusHelpers

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

ConsensusHelpers contains the oasis-node consensus CLI helpers.

func (*ConsensusHelpers) EstimateGas

func (c *ConsensusHelpers) EstimateGas(txPath string, signerPub signature.PublicKey) (transaction.Gas, error)

EstimateGas is a wrapper for "consensus estimate_gas" subcommand.

func (*ConsensusHelpers) SubmitTx

func (c *ConsensusHelpers) SubmitTx(txPath string) error

SubmitTx is a wrapper for "consensus submit_tx" subcommand.

type Factory

type Factory interface {
	// GetCLIConfig returns the configuration required for constructing a CLI helper.
	GetCLIConfig() Config
}

Factory is an interface that can be used to construct CLI helpers.

type Helpers

type Helpers struct {
	Consensus  *ConsensusHelpers
	Registry   *RegistryHelpers
	Keymanager *KeymanagerHelpers
	// contains filtered or unexported fields
}

Helpers are the oasis-node cli helpers.

func New

func New(env *env.Env, factory Factory, logger *logging.Logger) *Helpers

New creates new oasis-node cli helpers.

func (*Helpers) UnsafeReset added in v0.2012.3

func (h *Helpers) UnsafeReset(dataDir string, preserveRuntimeStorage, preserveLocalStorage bool) error

UnsafeReset launches the unsafe-reset subcommand, clearing all consensus and (optionally) runtime state.

type KeymanagerHelpers

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

KeymanagerHelpers contains the oasis-node keymanager CLI helpers.

func (*KeymanagerHelpers) GenUpdate

func (k *KeymanagerHelpers) GenUpdate(nonce uint64, polPath string, polSigPaths []string, txPath string) error

GenUpdate generates the update KM policy transaction.

func (*KeymanagerHelpers) InitPolicy

func (k *KeymanagerHelpers) InitPolicy(runtimeID common.Namespace, serial uint32, policies map[sgx.EnclaveIdentity]*keymanager.EnclavePolicySGX, polPath string) error

InitPolicy generates the KM policy file.

func (*KeymanagerHelpers) SignPolicy

func (k *KeymanagerHelpers) SignPolicy(testKey, polPath, polSigPath string) error

SignPolicy signs the KM policy file using the given test key ("1", "2", or "3").

type RegistryHelpers

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

RegistryHelpers contains the oasis-node registry CLI helpers.

func (*RegistryHelpers) GenerateRegisterRuntimeTx

func (r *RegistryHelpers) GenerateRegisterRuntimeTx(
	baseDir string,
	runtime registry.Runtime,
	nonce uint64,
	txPath string,
) error

GenerateRegisterRuntimeTx is a wrapper for "registry runtime gen_register" subcommand.

Jump to

Keyboard shortcuts

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