Documentation
¶
Index ¶
- Variables
- func Fatalf(format string, args ...interface{})
- func GlobalBig(ctx *cli.Context, name string) *big.Int
- func MigrateFlags(action func(ctx *cli.Context) error) func(*cli.Context) error
- func NewApp(gitCommit, usage string) *cli.App
- func RegisterService(stack *node.Node, cfg *server.Config)
- func SetNodeConfig(ctx *cli.Context, cfg *node.Config)
- func SetServerConfig(ctx *cli.Context, node *node.Node, cfg *server.Config)
- func StartNode(node *node.Node)
- type BigFlag
- type DirectoryFlag
- type DirectoryString
- type TextMarshaler
- type TextMarshalerFlag
Constants ¶
This section is empty.
Variables ¶
var ( // General settings DataDirFlag = DirectoryFlag{ Name: "datadir", Usage: "Data directory for the databases and keystore", Value: DirectoryString{node.DefaultDataDir()}, } KeyStoreDirFlag = DirectoryFlag{ Name: "keystore", Usage: "Directory for the keystore (default = inside the datadir)", } IdentityFlag = cli.StringFlag{ Name: "identity", Usage: "Custom node name", } TestnetFlag = cli.BoolFlag{ Name: "testnet", Usage: "Ropsten network: pre-configured proof-of-work test network", } // Miner settings MiningEnabledFlag = cli.BoolFlag{ Name: "mine", Usage: "Enable mining", } MinerThreadsFlag = cli.IntFlag{ Name: "miner.threads", Usage: "Number of CPU threads to use for mining", Value: 0, } MinerCoinbaseFlag = cli.StringFlag{ Name: "miner.coinbase", Usage: "Public address for block mining rewards (default = first account)", Value: "0", } )
These are all the command line flags we support.
var (
CommandHelpTemplate = `` /* 471-byte string literal not displayed */
)
Functions ¶
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf formats a message to standard error and exits the program. The message is also printed to standard output if standard error is redirected to a different file.
func MigrateFlags ¶
MigrateFlags sets the global flag from a local flag when it's set. This is a temporary function used for migrating old command/flags to the new format.
func RegisterService ¶
RegisterService adds an srcd client to the node.
func SetNodeConfig ¶
SetNodeConfig applies node-related command line flags to the config.
func SetServerConfig ¶
SetServerConfig applies server-related command line flags to the config.
Types ¶
type BigFlag ¶
BigFlag is a command line flag that accepts 256 bit big integers in decimal or hexadecimal syntax.
type DirectoryFlag ¶
type DirectoryFlag struct {
Name string
Value DirectoryString
Usage string
}
Custom cli.Flag type which expand the received string to an absolute path.
func (DirectoryFlag) Apply ¶
func (self DirectoryFlag) Apply(set *flag.FlagSet)
called by cli library, grabs variable from environment (if in env) and adds variable to flag set for parsing.
func (DirectoryFlag) GetName ¶
func (self DirectoryFlag) GetName() string
func (*DirectoryFlag) Set ¶
func (self *DirectoryFlag) Set(value string)
func (DirectoryFlag) String ¶
func (self DirectoryFlag) String() string
type DirectoryString ¶
type DirectoryString struct {
Value string
}
Custom type which is registered in the flags library which cli uses for argument parsing. This allows us to expand Value to an absolute path when the argument is parsed
func (*DirectoryString) Set ¶
func (self *DirectoryString) Set(value string) error
func (*DirectoryString) String ¶
func (self *DirectoryString) String() string
type TextMarshaler ¶
type TextMarshaler interface {
encoding.TextMarshaler
encoding.TextUnmarshaler
}
func GlobalTextMarshaler ¶
func GlobalTextMarshaler(ctx *cli.Context, name string) TextMarshaler
GlobalTextMarshaler returns the value of a TextMarshalerFlag from the global flag set.
type TextMarshalerFlag ¶
type TextMarshalerFlag struct {
Name string
Value TextMarshaler
Usage string
}
TextMarshalerFlag wraps a TextMarshaler value.
func (TextMarshalerFlag) Apply ¶
func (f TextMarshalerFlag) Apply(set *flag.FlagSet)
func (TextMarshalerFlag) GetName ¶
func (f TextMarshalerFlag) GetName() string
func (TextMarshalerFlag) String ¶
func (f TextMarshalerFlag) String() string