commands

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2017 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagAddress           = "address"
	FlagWithoutTendermint = "without-tendermint"
)

nolint

View Source
const EyesCacheSize = 10000

nolint TODO: move to config file

View Source
const (
	FlagLogLevel = "log_level"
)

nolint

Variables

View Source
var (
	// InitCmd - node initialization command
	InitCmd = GetInitCmd("mycoin", []string{})

	//nolint - flags
	FlagChainID = "chain-id" //TODO group with other flags or remove? is this already a flag here?
	FlagDenom   = "denom"    //TODO group with other flags or remove? is this already a flag here?
	FlagOption  = "option"
	FlagStatic  = "static"
)
View Source
var (
	// Handler - use a global to store the handler, so we can set it in main.
	// TODO: figure out a cleaner way to register plugins
	Handler sdk.Handler
)
View Source
var StartCmd = &cobra.Command{
	Use:   "start",
	Short: "Start this full node",
	RunE:  startCmd,
}

StartCmd - command to start running the abci app (and tendermint)!

View Source
var StaticPK = "7B90EA87E7DC0C7145C8C48C08992BE271C7234134343E8A8E8008E617DE7B30"

StaticPK - static public key for test cases

View Source
var StaticPrivValJSON = `` /* 475-byte string literal not displayed */

StaticPrivValJSON - static validator private key file contents in json

View Source
var UnsafeResetAllCmd = &cobra.Command{
	Use:   "unsafe_reset_all",
	Short: "Reset all blockchain data",
	RunE:  unsafeResetAllCmd,
}

UnsafeResetAllCmd - extension of the tendermint command, resets initialization

Functions

func CreateGenesisValidatorFiles

func CreateGenesisValidatorFiles(cfg *config.Config, genesis, privVal, appName string) error

CreateGenesisValidatorFiles creates a genesis file with these contents and a private validator file

func GetGenesisJSON

func GetGenesisJSON(pubkey, chainID, denom, addr string, options string) string

GetGenesisJSON returns a new tendermint genesis with Basecoin app_options that grant a large amount of "mycoin" to a single address TODO: A better UX for generating genesis files

func GetInitCmd

func GetInitCmd(defaultDenom string, options []string) *cobra.Command

GetInitCmd - get the node initialization command, with a custom genesis account denom

func GetTickStartCmd

func GetTickStartCmd(tick sdk.Ticker) *cobra.Command

GetTickStartCmd - initialize a command as the start command with tick

func SetUpRoot

func SetUpRoot(cmd *cobra.Command)

SetUpRoot - initialize the root command

Types

type Address

type Address [20]byte

Address - public address for a key

func (Address) MarshalJSON

func (a Address) MarshalJSON() ([]byte, error)

MarshalJSON - marshal the json bytes of the address

func (*Address) UnmarshalJSON

func (a *Address) UnmarshalJSON(addrHex []byte) error

UnmarshalJSON - unmarshal the json bytes of the address

type Key

type Key struct {
	Address Address        `json:"address"`
	PubKey  crypto.PubKey  `json:"pub_key"`
	PrivKey crypto.PrivKey `json:"priv_key"`
}

Key - full private key

func LoadKey

func LoadKey(keyFile string) (*Key, error)

LoadKey - load key from json file

func (*Key) Sign

func (k *Key) Sign(msg []byte) crypto.Signature

Sign - Implements Signer

Jump to

Keyboard shortcuts

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