commands

package
v0.1.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: GPL-3.0 Imports: 46 Imported by: 3

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

View Source
const KeyDelimiter = "/"

KeyDelimiter is used to separate module and key in the options

Variables

View Source
var InitCmd = GetInitCmd()
View Source
var ShowNodeIDCmd = &cobra.Command{
	Use:   "show_node_id",
	Short: "Show this node's ID",
	RunE:  showNodeID,
}

ShowNodeIDCmd dumps node's ID to the standard output.

Functions

func AppendVMConfig

func AppendVMConfig(configFilePath string, conf *TravisConfig)

func GetInitCmd

func GetInitCmd() *cobra.Command

func GetStartCmd

func GetStartCmd() *cobra.Command

GetStartCmd - initialize a command as the start command with tick

func Load

func Load(app InitStater, filePath string) error

Load parses the genesis file and sets the initial state based on that

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 Doc

type Doc struct {
	Accounts []json.RawMessage `json:"accounts"`
}

Doc - All genesis values

type EthermintConfig

type EthermintConfig 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 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       []travis.GenesisValidator  `json:"validators"`
	AppHash          []byte                     `json:"app_hash"`
	AppOptions       interface{}                `json:"app_options,omitempty"`
	MaxVals          uint16                     `json:"max_vals"`
	SelfStakingRatio string                     `json:"self_staking_ratio"`
	CubePubKeys      []travis.GenesisCubePubKey `json:"cube_pub_keys"`
}

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 InitStater

type InitStater interface {
	InitState(module, key string, value interface{}) error
}

InitStater is anything that can handle app options from genesis file. Setting the merkle store, config options, or anything else

type Option

type Option struct {
	Module string
	Key    string
	Value  interface{}
}

Option just holds module/key/value triples from parsing the genesis file

func GetOptions

func GetOptions(path string) ([]Option, error)

GetOptions parses the genesis file in a format that can easily be handed into InitStaters

type Services

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

type TravisConfig

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

func DefaultConfig

func DefaultConfig() *TravisConfig

func ParseConfig

func ParseConfig() (*TravisConfig, 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