commands

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2017 License: Apache-2.0 Imports: 20 Imported by: 5

Documentation

Overview

Package commands contains any general setup/helpers valid for all subcommands

Index

Constants

View Source
const (
	ChainFlag = "chain-id"
	NodeFlag  = "node"
)
View Source
const (
	SeedFlag    = "seed"
	HashFlag    = "valhash"
	GenesisFlag = "genesis"

	ConfigFile = "config.toml"
)

Variables

View Source
var InitCmd = &cobra.Command{
	Use:   "init",
	Short: "Initialize the light client for a new chain",
	RunE:  runInit,
}

InitCmd will initialize the basecli store

View Source
var ResetCmd = &cobra.Command{
	Use:   "reset_all",
	Short: "DANGEROUS: Wipe out all client data, including keys",
	RunE:  runResetAll,
}

Functions

func AddBasicFlags

func AddBasicFlags(cmd *cobra.Command)

func GetCertifier

func GetCertifier() (*certifiers.InquiringCertifier, error)

func GetChainID added in v0.10.1

func GetChainID() string

func GetNode added in v0.10.0

func GetNode() rpcclient.Client

func GetProviders added in v0.10.1

func GetProviders() (trusted certifiers.Provider, source certifiers.Provider)

func WasInited added in v0.10.3

func WasInited(root string) (bool, error)

WasInited returns true if a light-client was previously initialized in this directory. Important to ensure proper behavior.

Returns error if we have filesystem errors

Types

type Config added in v0.10.0

type Config struct {
	Chain    string `toml:"chain-id,omitempty"`
	Node     string `toml:"node,omitempty"`
	Output   string `toml:"output,omitempty"`
	Encoding string `toml:"encoding,omitempty"`
}

type Runable added in v0.10.3

type Runable func(cmd *cobra.Command, args []string) error

func RequireInit added in v0.10.3

func RequireInit(run Runable) Runable

Any commands that require and init'ed light-client 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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