demo

package
v0.0.0-...-b26fea9 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddInput

func AddInput(in string)

AddInput adds an input to the input command queue.

func Execute

func Execute(in string) error

Execute interprets commands entered by the user.

func GetDemoCmd

func GetDemoCmd() *cobra.Command

GetDemoCmd exposes demoCmd so that it can be used as a sub-command by another cobra command instance.

func ParseConfig

func ParseConfig(cfgPath, cfgNetPath string, cfg *Config)

func PrintfAsync

func PrintfAsync(format string, a ...interface{})

PrintfAsync prints the given message for an asynchronous event. More precisely, the message is prepended with a newline and appended with the command prefix.

func Prompt

func Prompt(msg string, f func(string))

Prompt waits for input on the command line and then executes the given function with the input.

func SetConfig

func SetConfig(cfgPath, cfgNetPath string)

SetConfig called by viper when the config file was parsed

func Setup

func Setup()

Setup initializes the node, can not be done in init() since it needs the configuration from viper.

Types

type CommandLineFlags

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

CommandLineFlags contains the command line flags.

type Config

type Config struct {
	Alias   string
	Sk      string
	Channel channelConfig
	Node    nodeConfig
	Chain   chainConfig
	// Read from the network.yaml. The key is the alias.
	Peers map[string]*netConfigEntry
}

Config contains all configuration read from config.yaml and network.yaml

func GetConfig

func GetConfig() *Config

GetConfig returns a pointer to the current `Config`. This is needed to make viper and cobra work together.

Jump to

Keyboard shortcuts

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