commands

package
v0.0.0-...-bc2dafa Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: Apache-2.0 Imports: 44 Imported by: 1

Documentation

Index

Constants

View Source
const (
	FlagChainID = "chain-id"
	FlagENV     = "env"
)
View Source
const (
	Staging      = 20
	TestNet      = 19
	MainNet      = 18
	PrivateChain = 1234
)
View Source
const EyesCacheSize = 10000

nolint TODO: move to config file

View Source
const (
	FlagLogLevel = "log_level"
)

nolint

Variables

View Source
var (
	GenesisTargetGasLimit = big.NewInt(100000000)

	// TendermintAddrFlag is the address that will use to connect to the tendermint core node
	TendermintAddrFlag = cli.StringFlag{
		Name:  "tendermint_addr",
		Value: "tcp://localhost:26657",
		Usage: "This is the address that tendermint will use to connect to the tendermint core node. Please provide a port.",
	}

	// ABCIAddrFlag is the address that tendermint will use to listen to incoming ABCI connections
	// #stable - 0.4.0
	ABCIAddrFlag = cli.StringFlag{
		Name:  "abci_laddr",
		Value: "tcp://0.0.0.0:26658",
		Usage: "This is the address that the ABCI server will use to listen to incoming connection from tendermint core.",
	}

	// ABCIProtocolFlag defines whether GRPC or SOCKET should be used for the ABCI connections
	// #stable - 0.4.0
	ABCIProtocolFlag = cli.StringFlag{
		Name:  "abci_protocol",
		Value: "socket",
		Usage: "socket | grpc",
	}

	// VerbosityFlag defines the verbosity of the logging
	// #unstable
	VerbosityFlag = cli.IntFlag{
		Name:  "verbosity",
		Value: 3,
		Usage: "Logging verbosity: 0=silent, 1=error, 2=warn, 3=info, 4=core, 5=debug, 6=detail",
	}

	// ConfigFileFlag defines the path to a TOML config for go-ethereum
	// #unstable
	ConfigFileFlag = cli.StringFlag{
		Name:  "config",
		Usage: "TOML configuration file",
	}

	// TargetGasLimitFlag defines gas limit of the Genesis block
	// #unstable
	TargetGasLimitFlag = cli.Uint64Flag{
		Name:  "targetgaslimit",
		Usage: "Target gas limit sets the artificial target gas floor for the blocks to mine",
		Value: GenesisTargetGasLimit.Uint64(),
	}

	// WithTendermintFlag asks to start Tendermint
	// `tendermint init` and `tendermint node` when `tendermint init`
	// and `tendermint` are invoked respectively.
	WithTendermintFlag = cli.BoolFlag{
		Name: "with-tendermint",
		Usage: "If set, it will invoke `tendermint init` and `tendermint node` " +
			"when `tendermint init` and `tendermint` are invoked respectively",
	}
)
View Source
var AttachCmd = GetAttachCmd()
View Source
var (
	CliContext *cli.Context
)
View Source
var CreatenodeCmd = GetCreatenodeCmd()
View Source
var InitCmd = GetInitCmd()

Functions

func AppendVMConfig

func AppendVMConfig(configFilePath string, conf *UNetworkConfig)

func GetAttachCmd

func GetAttachCmd() *cobra.Command

func GetCreatenodeCmd

func GetCreatenodeCmd() *cobra.Command

func GetInitCmd

func GetInitCmd() *cobra.Command

func GetStartCmd

func GetStartCmd() *cobra.Command

GetStartCmd - initialize a command as the start command with tick

func InitConfigFiles

func InitConfigFiles(path string) error

func SetUpRoot

func SetUpRoot(cmd *cobra.Command)

SetUpRoot - initialize the root command

func Setup

func Setup(ctx *cli.Context) error

Setup sets up the logging infrastructure #unstable

func TendermintLogger

func TendermintLogger() tmlog.Logger

TendermintLogger returns a new instance of an tendermint logger. With() should be called upon the returned instance to set default keys #unstable

Types

type BaseConfig

type BaseConfig struct {
	// The root directory for all data.
	// This should be set in viper so it can unmarshal into this struct
	RootDir string `mapstructure:"home"`
}

func DefaultBaseConfig

func DefaultBaseConfig() BaseConfig

type Services

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

func StartServices

func StartServices(rootDir string) (*Services, error)

func (*Services) BroadcastTransaction

func (s *Services) BroadcastTransaction(tx []byte)

broadcast tx by tendermint

type TenderminConfig

type TenderminConfig struct {
	ChainId             uint   `mapstructure:"chainid"`
	RootDir             string `mapstructure:"home"`
	ABCIAddr            string `mapstructure:"abci_laddr"`
	ABCIProtocol        string `mapstructure:"abci_protocol"`
	RPCEnabledFlag      bool   `mapstructure:"rpc"`
	RPCListenAddrFlag   string `mapstructure:"rpcaddr"`
	RPCPortFlag         uint   `mapstructure:"rpcport"`
	RPCCORSDomainFlag   string `mapstructure:"rpccorsdomain"`
	RPCApiFlag          string `mapstructure:"rpcapi"`
	RPCVirtualHostsFlag string `mapstructure:"rpcvhosts"`
	WSEnabledFlag       bool   `mapstructure:"ws"`
	WSListenAddrFlag    string `mapstructure:"wsaddr"`
	WSPortFlag          uint   `mapstructure:"wsport"`
	WSApiFlag           string `mapstructure:"wsapi"`
	VerbosityFlag       uint   `mapstructure:"verbosity"`
	GCMode              string `mapstructure:"gcmode"`
}

func DefaultTendermintConfig

func DefaultTendermintConfig() TenderminConfig

type UNetworkConfig

type UNetworkConfig struct {
	BaseConfig BaseConfig      `mapstructure:",squash"`
	TMConfig   tmcfg.Config    `mapstructure:",squash"`
	EMConfig   TenderminConfig `mapstructure:"vm"`
}

func DefaultConfig

func DefaultConfig() *UNetworkConfig

func ParseConfig

func ParseConfig() (*UNetworkConfig, error)

copied from tendermint/commands/root.go to call our revised EnsureRoot

Jump to

Keyboard shortcuts

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