cli

package
v0.2403.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 30 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(_ *env.Env, logger *logging.Logger, _, 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 GenesisHelpers added in v0.2300.0

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

GenesisHelpers contains the oasis-node genesis CLI helpers.

func (*GenesisHelpers) Check added in v0.2300.0

func (g *GenesisHelpers) Check(
	genesisFilePath string,
) (string, error)

Check is a wrapper for "genesis check" subcommand.

func (*GenesisHelpers) Dump added in v0.2300.0

func (g *GenesisHelpers) Dump(
	genesisFilePath string,
) error

Dump is a wrapper for "genesis dump" subcommand.

func (*GenesisHelpers) Migrate added in v0.2300.0

func (g *GenesisHelpers) Migrate(
	genesisFilePath string,
	newGenesisFilePath string,
) error

Migrate is a wrapper for "genesis migrate" subcommand.

type Helpers

type Helpers struct {
	Consensus  *ConsensusHelpers
	Registry   *RegistryHelpers
	Keymanager *KeymanagerHelpers
	Genesis    *GenesisHelpers
	// 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) SetConfig added in v0.2300.0

func (h *Helpers) SetConfig(cfg Config)

SetConfig sets the configuration for the oasis-node cli helpers.

func (*Helpers) UnsafeReset added in v0.2012.3

func (h *Helpers) UnsafeReset(dataDir string, preserveRuntimeStorage, preserveLocalStorage, force 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, rotationInterval beacon.EpochTime, policies map[sgx.EnclaveIdentity]*secrets.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) GenerateRegisterEntityTx added in v0.2300.0

func (r *RegistryHelpers) GenerateRegisterEntityTx(
	entDir string,
	nonce uint64,
	txPath string,
) error

GenerateRegisterEntityTx is a wrapper for "registry entity gen_register" subcommand.

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