Documentation ¶
Overview ¶
Package utils contains internal helper functions for go-ethereum commands.
Index ¶
Constants ¶
const (
ChainIdSize = 64
)
Variables ¶
var ( //account KeyStoreDirFlag = common.DirectoryFlag{ Name: "keystore", Usage: "Directory for the keystore (default = inside the homedir)", } // ATM the url is left to the user and deployment to JSpathFlag = cli.StringFlag{ Name: "jspath", Usage: "JavaScript root path for `loadScript`", Value: ".", } ExecFlag = cli.StringFlag{ Name: "exec", Usage: "Execute JavaScript statement", } PreloadJSFlag = cli.StringFlag{ Name: "preload", Usage: "Comma separated list of JavaScript files to preload into the console", } )
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 MakeConsolePreloads ¶
func MakeConsolePreloads(ctx *cli.Context) []string
MakeConsolePreloads retrieves the absolute paths for the console JavaScript scripts to preload before starting.
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.
e.g. drep account new --keystore /tmp/mykeystore --lightkdf
is equivalent after calling this method with:
drep --keystore /tmp/mykeystore --lightkdf account new
This allows the use of the existing configuration functionality. When all flags are migrated this function can be removed and the existing configuration functionality must be changed that is uses local flags
Types ¶
type ChainIdType ¶
type ChainIdType [ChainIdSize]byte
func Bytes2ChainId ¶
func Bytes2ChainId(b []byte) ChainIdType
func Hex2ChainId ¶
func Hex2ChainId(s string) ChainIdType
func (ChainIdType) Hex ¶
func (c ChainIdType) Hex() string
func (ChainIdType) MarshalText ¶
func (c ChainIdType) MarshalText() ([]byte, error)
func (*ChainIdType) SetBytes ¶
func (c *ChainIdType) SetBytes(b []byte)
func (*ChainIdType) UnmarshalJSON ¶
func (c *ChainIdType) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
func (*ChainIdType) UnmarshalText ¶
func (c *ChainIdType) UnmarshalText(input []byte) error
UnmarshalText implements encoding.TextUnmarshaler