Documentation ¶
Index ¶
- Constants
- Variables
- func AppendVMConfig(configFilePath string, conf *TravisConfig)
- func GetInitCmd() *cobra.Command
- func GetStartCmd() *cobra.Command
- func Load(app InitStater, filePath string) error
- func SetUpRoot(cmd *cobra.Command)
- type BaseConfig
- type Doc
- type EthermintConfig
- type GenesisDoc
- type InitStater
- type Option
- type Services
- type TravisConfig
Constants ¶
const ( FlagChainID = "chain-id" FlagENV = "env" )
const ( Staging = 20 TestNet = 19 MainNet = 18 PrivateChain = 1234 )
const EyesCacheSize = 10000
nolint TODO: move to config file
const (
FlagLogLevel = "log_level"
)
nolint
const KeyDelimiter = "/"
KeyDelimiter is used to separate module and key in the options
Variables ¶
var InitCmd = GetInitCmd()
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 GetStartCmd ¶
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
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 ¶
InitStater is anything that can handle app options from genesis file. Setting the merkle store, config options, or anything else
type Option ¶
Option just holds module/key/value triples from parsing the genesis file
func GetOptions ¶
GetOptions parses the genesis file in a format that can easily be handed into InitStaters
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