commands

package
v0.0.0-...-481a8b4 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: GPL-3.0 Imports: 52 Imported by: 0

Documentation

Index

Constants

View Source
const EyesCacheSize = 10000

nolint TODO: move to config file

View Source
const (
	FlagLogLevel = "log_level"
)

nolint

Variables

View Source
var (
	FlagChainID  = "chain-id"
	DockerMode   = "docker"
	DockerNodeID = "docker-id"
)
View Source
var InitCmd = GetInitCmd()
View Source
var (
	PlayFlag = "play"
)

Functions

func GetInitCmd

func GetInitCmd() *cobra.Command

func GetStartCmd

func GetStartCmd() *cobra.Command

GetStartCmd - initialize a command as the start command with tick

func SetUpRoot

func SetUpRoot(cmd *cobra.Command)

SetUpRoot - initialize the root command

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 EthermintConfig

type EthermintConfig struct {
	EthChainId        uint   `mapstructure:"eth_chain_id"`
	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"`
	WSEnabledFlag     bool   `mapstructure:"ws"`
	WSListenAddrFlag  string `mapstructure:"wsaddr"`
	WSPortFlag        uint   `mapstructure:"wsport"`
	WSApiFlag         string `mapstructure:"wsapi"`
	VerbosityFlag     uint   `mapstructure:"verbosity"`
}

func DefaultEthermintConfig

func DefaultEthermintConfig() EthermintConfig

type GenesisDoc

type GenesisDoc struct {
	GenesisTime             time.Time              `json:"genesis_time"`
	ChainID                 string                 `json:"chain_id"`
	ConsensusParams         *types.ConsensusParams `json:"consensus_params,omitempty"`
	Validators              []GenesisValidator     `json:"validators"`
	AppHash                 data.Bytes             `json:"app_hash"`
	AppOptions              interface{}            `json:"app_options,omitempty"`
	MaxVals                 uint16                 `json:"max_vals"`
	ReserveRequirementRatio string                 `json:"reserve_requirement_ratio"`
}

GenesisDoc defines the initial conditions for a tendermint blockchain, in particular its validator set.

func GenesisDocFromFile

func GenesisDocFromFile(genDocFile string) (*GenesisDoc, error)

GenesisDocFromFile reads JSON data from a file and unmarshalls it into a GenesisDoc.

func GenesisDocFromJSON

func GenesisDocFromJSON(jsonBlob []byte) (*GenesisDoc, error)

GenesisDocFromJSON unmarshalls JSON data into a GenesisDoc.

func (*GenesisDoc) SaveAs

func (genDoc *GenesisDoc) SaveAs(file string) error

SaveAs is a utility method for saving GenensisDoc as a JSON file.

func (*GenesisDoc) ValidateAndComplete

func (genDoc *GenesisDoc) ValidateAndComplete() error

ValidateAndComplete checks that all necessary fields are present and fills in defaults for optional fields left empty

func (*GenesisDoc) ValidatorHash

func (genDoc *GenesisDoc) ValidatorHash() []byte

ValidatorHash returns the hash of the validator set contained in the GenesisDoc

type GenesisValidator

type GenesisValidator struct {
	PubKey    crypto.PubKey `json:"pub_key"`
	Power     int64         `json:"power"`
	Name      string        `json:"name"`
	Address   string        `json:"address"`
	Cut       string        `json:"cut"`
	MaxAmount int64         `json:"max_amount"`
}

GenesisValidator is an initial validator.

type Services

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

type TestAccount

type TestAccount struct {
	Address    common.Address `json:"address"`
	Balance    *big.Int       `json:"balance"`
	PassPhrase string         `json:"password"`
	Url        string         `json:"path"`
}

type UltronConfig

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

func DefaultConfig

func DefaultConfig() *UltronConfig

func ParseConfig

func ParseConfig() (*UltronConfig, error)

ParseConfig retrieves the default environment configuration, sets up the Tendermint root and ensures that the root exists

Jump to

Keyboard shortcuts

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