Documentation ¶
Overview ¶
Package commands contains any general setup/helpers valid for all subcommands
Index ¶
- Constants
- Variables
- func AddBasicFlags(cmd *cobra.Command)
- func GetChainID() string
- func GetNode() rpcclient.Client
- func GetOneArg(args []string, argname string) (string, error)
- func GetProviders() (trusted lite.Provider, source lite.Provider)
- func GetSourceProvider() lite.Provider
- func GetTrustedProvider() lite.Provider
- func ParseActor(input string) (res common.Address, err error)
- func ParseActors(key string) (signers []common.Address, err error)
- func ParseHexFlag(flag string) ([]byte, error)
- func WasInited(root string) (bool, error)
- type Config
- type Runable
Constants ¶
const ( ChainFlag = "chain-id" NodeFlag = "node" )
const ( CommitFlag = "commit" HashFlag = "valhash" GenesisFlag = "genesis" FlagTrustNode = "trust-node" ConfigFile = "config.toml" )
nolint
Variables ¶
var InitCmd = &cobra.Command{
Use: "init",
Short: "Initialize the light client for a new chain",
RunE: runInit,
}
InitCmd will initialize the basecli store
var ResetCmd = &cobra.Command{
Use: "reset_all",
Short: "DANGEROUS: Wipe out all client data, including keys",
RunE: runResetAll,
}
Functions ¶
func AddBasicFlags ¶
AddBasicFlags adds --node and --chain-id, which we need for everything
func GetProviders ¶
GetProviders creates a trusted (local) seed provider and a remote provider based on configuration.
func GetSourceProvider ¶
GetSourceProvider returns a provider pointing to an rpc handler
func GetTrustedProvider ¶
GetTrustedProvider returns a reference to a local store with cache
func ParseActor ¶
ParseActor parses an address of form: [<chain>:][<app>:]<hex address> into a sdk.Actor. If app is not specified or "", then assume auth.NameSigs
func ParseActors ¶
ParseActors takes a comma-separated list of actors and parses them into a slice
func ParseHexFlag ¶
ParseHexFlag takes a flag name and parses the viper contents as hex
Types ¶
type Runable ¶
func RequireInit ¶
Any commands that require and init'ed basecoin directory should wrap their RunE command with RequireInit to make sure that the client is initialized.
This cannot be called during PersistentPreRun, as they are called from the most specific command first, and root last, and the root command sets up viper, which is needed to find the home dir.