Documentation ¶
Index ¶
- Variables
- func AccountConfig(keystoreDir string) (int, int, string, error)
- func Fatalf(format string, args ...interface{})
- func Find(address string) (accounts.Account, error)
- func FindByDir(address string, keystoreDir string) (accounts.Account, error)
- func GetUnlockedKey(address string, passphrase string) (accounts.Account, *keystore.Key, error)
- func GetUnlockedKeyByDir(address string, passphrase string, keystoreDir string) (accounts.Account, *keystore.Key, error)
- func ListAccounts(keyStoreDir string) error
- func Lock(ks *keystore.KeyStore, addr string) error
- func MakeAccountManager(keystoreDir string) (*accounts.Manager, string, error)
- func MakeAddress(ks *keystore.KeyStore, account string) (accounts.Account, error)
- func MakePasswordList(ctx *cli.Context) []string
- func MigrateFlags(action func(ctx *cli.Context) error) func(*cli.Context) error
- func NewAccount(keyStoreDir string, password string) (common.Address, error)
- func NewApp(gitCommit, usage string) *cli.App
- func NewWeb3(hostname string, port string, verbose bool) (*web3.Web3, error)
- func SendRawTransaction(tx *types.Transaction) (common.Hash, error)
- func SendRawTransactionWeb3(web *web3.Web3, txBytesStr string) (common.Hash, error)
- func SendTransaction(tx *types.Transaction) (common.Hash, error)
- func SendTransactionWeb3(tx *web3cmn.TransactionRequest) (common.Hash, error)
- func SignTx(address string, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error)
- func SignTxByDir(address string, tx *types.Transaction, chainID *big.Int, keystoreDir string, ...) (*types.Transaction, error)
- func SignTxByPassWord(tx *types.Transaction, password string) (*types.Transaction, error)
- func Unlock(ks *keystore.KeyStore, addr string, passphrase string) error
- type DirectoryFlag
- type DirectoryString
Constants ¶
This section is empty.
Variables ¶
var ( // General settings DataDirFlag = DirectoryFlag{ Name: "datadir", Usage: "Data directory for the databases and keystore", Value: DirectoryString{filepath.Join(os.Getenv("HOME"), ".wallet")}, } KeyStoreDirFlag = DirectoryFlag{ Name: "keystore", Usage: "Directory for the keystore (default = inside the datadir)", } PasswordFileFlag = cli.StringFlag{ Name: "password", Usage: "Password file to use for non-interactive password input", Value: "", } LightKDFFlag = cli.BoolFlag{ Name: "lightkdf", Usage: "Reduce key-derivation RAM & CPU usage at some expense of KDF strength", } )
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 GetUnlockedKey ¶
func GetUnlockedKeyByDir ¶
func ListAccounts ¶
func MakeAccountManager ¶
func MakeAddress ¶
MakeAddress converts an account specified directly as a hex encoded string or a key index in the key store to an internal account representation.
func MakePasswordList ¶
MakePasswordList reads password lines from the file specified by the global --password flag.
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. geth account new --keystore /tmp/mykeystore --lightkdf
is equivalent after calling this method with:
geth --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
func SendRawTransaction ¶
func SendRawTransaction(tx *types.Transaction) (common.Hash, error)
func SendRawTransactionWeb3 ¶
func SendTransaction ¶
func SendTransaction(tx *types.Transaction) (common.Hash, error)
Send a signed transaction
func SendTransactionWeb3 ¶
func SendTransactionWeb3(tx *web3cmn.TransactionRequest) (common.Hash, error)
func SignTx ¶
func SignTx(address string, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error)
func SignTxByDir ¶
func SignTxByDir(address string, tx *types.Transaction, chainID *big.Int, keystoreDir string, password *string) (*types.Transaction, error)
func SignTxByPassWord ¶
func SignTxByPassWord(tx *types.Transaction, password string) (*types.Transaction, error)
Types ¶
type DirectoryFlag ¶
type DirectoryFlag struct { Name string Value DirectoryString Usage string }
Custom cli.Flag type which expand the received string to an absolute path. e.g. ~/.wallet -> /home/username/.wallet
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) 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