cli

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Conn is a connection to the node

Functions

func AddressArgFunc

func AddressArgFunc(key string, index int) func(*cobra.Command, []string) error

AddressArgFunc returns a cobra.Command Arg function to validate the given argument index is a common.Address.

func AddressArgOrKeystoreAddressFunc

func AddressArgOrKeystoreAddressFunc(key string, index int) func(*cobra.Command, []string) error

AddressArgOrKeystoreAddressFunc returns a cobra.Command Arg function to validate that either the 'keystoreAddress' arg is set, or a config file value is set.

func AddressForKeystoreAlias added in v0.0.3

func AddressForKeystoreAlias(alias string) (common.Address, string, bool, error)

AddressForKeystoreAlias returns the address in the config 'keystoreAddressAliases' secion of the given alias

func AddressesFlag added in v0.2.0

func AddressesFlag(cmd *cobra.Command, flag string, required bool) ([]common.Address, error)

AddressesFlag returns the addresses for the given flag, returning an error when unset and required

func BigFloatArgFunc

func BigFloatArgFunc(key string, index int) func(*cobra.Command, []string) error

BigFloatArgFunc returns a cobra.Command Arg function to validate the given argument index is a big.Float.

func BigIntArgFunc

func BigIntArgFunc(key string, index int) func(*cobra.Command, []string) error

BigIntArgFunc returns a cobra.Command Arg function to validate the given argument index is a big.Int.

func BlockFlag added in v0.2.0

func BlockFlag(cmd *cobra.Command)

BlockFlag adds the 'block' flag to the given caller-session command

func BoolArgFunc

func BoolArgFunc(key string, index int) func(*cobra.Command, []string) error

BoolArgFunc returns a cobra.Command Arg function to validate the given argument index is a bool.

func Bytes32FromArg added in v0.2.0

func Bytes32FromArg(s string) ([32]byte, error)

Bytes32FromArg returns the bytes32 for the argument at the specified index.

func ChainArgs

func ChainArgs(funcs ...func(cmd *cobra.Command, args []string) error) func(*cobra.Command, []string) error

ChainArgs chains the given args functions for use as a single cobra.Command Args.

func CheckAccreditationGetter

func CheckAccreditationGetter(cmd *cobra.Command) func(*big.Int, error)

CheckAccreditationGetter prints the UTC date and EPOCH.

func CheckAddressGetter

func CheckAddressGetter(cmd *cobra.Command) func(common.Address, error)

CheckAddressesGetter prints the address.

func CheckAddressesGetter added in v0.0.3

func CheckAddressesGetter(cmd *cobra.Command) func([]common.Address, error)

CheckAddressesGetter prints the collection of addresses.

func CheckBytes32Getter added in v0.2.0

func CheckBytes32Getter(cmd *cobra.Command) func([32]byte, error)

CheckBytes32Getter prints the return hex

func CheckBytesGetter added in v0.2.0

func CheckBytesGetter(cmd *cobra.Command) func([]byte, error)

CheckBytes32Getter prints the return hex

func CheckCountryGetter

func CheckCountryGetter(cmd *cobra.Command) func([2]byte, error)

CheckCountryGetter prints the country code.

func CheckErr

func CheckErr(cmd *cobra.Command, err error)

CheckErr prints the given error and exits, if the error is not nil.

func CheckGetter

func CheckGetter(cmd *cobra.Command) func(interface{}, error)

CheckGetter prints the given error and exits, if the error is not nil, otherwise the return value is printed.

func Connect

func Connect(cmd *cobra.Command, args []string)

Connect creates a connection to the node

func ConnectWithKeyStore

func ConnectWithKeyStore(cmd *cobra.Command, args []string)

Connect creates a connection to the node, using the address from the keystore as the transactor

func CountryCodeArgFunc

func CountryCodeArgFunc(key string, index int) func(*cobra.Command, []string) error

CountryCodeArgFunc returns a cobra.Command Arg function that validates the argument at the given index is a valid country code.

func CountryFromArg

func CountryFromArg(s string) ([2]byte, error)

CountryFromArg returns the country code in bytes.

func DateArgFunc

func DateArgFunc(key string, index int) func(*cobra.Command, []string) error

DateArgFunc returns a cobra.Command Arg function that validates the argument at the given index is a valid date.

func DateFromArg

func DateFromArg(s string) (time.Time, error)

DateFromArg returns the parsed string as a date.

func FilterOpts added in v0.2.0

func FilterOpts(cmd *cobra.Command) bind.FilterOpts

FilterOpts returns options with 'start' end 'end' values set from command-line flags

func FlagOrConfigAddress

func FlagOrConfigAddress(cmd *cobra.Command, flag, configKey string) (common.Address, error)

FlagOrConfigAddress returns the address of the given flag, when set, or the matching address for the given key, within the config file.

func GetArgAddress

func GetArgAddress(index int, args []string) (common.Address, error)

GetArgAddress returns the address for the argument at the specified index.

func GetArgAddresses added in v0.2.0

func GetArgAddresses(index int, args []string) ([]common.Address, error)

GetArgAddresses returns the addresses for the argument at the specified index.

func HexArgFunc

func HexArgFunc(key string, index int) func(*cobra.Command, []string) error

HexArgFunc returns a cobra.Command Arg function that validates the argument at the given index is a hex string

func HexArgLenFunc added in v0.2.0

func HexArgLenFunc(key string, index int, length int) func(*cobra.Command, []string) error

HexArgLenFunc returns a cobra.Command Arg function that validates the argument at the given index is a hex string of the given length.

func IntArgFunc

func IntArgFunc(key string, index int) func(*cobra.Command, []string) error

IntArgFunc returns a cobra.Command Arg function to validate the given argument index is an int.

func IsAddress

func IsAddress(s string) error

IsAddress checks if the given string is a valid address.

func IsAddressArg

func IsAddressArg(key string, args []string, i int) error

IsAddressArg validates that the args contains enough values, and if the given argument position is a valid address.

func IsIntArg

func IsIntArg(key string, args []string, i int) error

IsIntArg validates that the args contains enough values, and if the given argument position is an int.

func NewConnection

func NewConnection(cmd *cobra.Command, args []string) (*connection.Connection, error)

NewConnection returns a connection using the URL from 't0ken.yaml'

func NewKeystoreConnection

func NewKeystoreConnection(cmd *cobra.Command, args []string) (*connection.Connection, error)

NewKeystoreConnection returns a connection using the URL, address, and optional password from 't0ken.yaml'

func OptionalFlagAddress added in v0.2.0

func OptionalFlagAddress(cmd *cobra.Command, flag string) (common.Address, error)

FlagAddress returns the address of the given flag, when set.

func PrintBlock added in v0.0.3

func PrintBlock(w io.Writer, latest *types.Header, block *types.Block) error

PrintBlock prints the block info.

func PrintTransaction

func PrintTransaction(w io.Writer, tx *types.Transaction) error

PrintTransaction prints the transaction info.

func PrintTransactionFn added in v0.0.3

func PrintTransactionFn(cmd *cobra.Command) func(*types.Transaction, error)

PrintTransactionFn returns a function that checks for an error, printing the transaction when successful.

func ReplayTransaction added in v0.0.3

func ReplayTransaction(cmd *cobra.Command, h common.Hash, gasPrice *big.Int) error

ReplayTransaction attempts to replay an existing, pending transaction.

func StringsFlag added in v0.2.0

func StringsFlag(cmd *cobra.Command, flag string, required bool) ([]string, error)

StringsFlag returns the strings for the given flag, returning an error when unset and required

func UintArgFunc

func UintArgFunc(key string, index, bitSize int) func(*cobra.Command, []string) error

UintArgFunc returns a cobra.Command Arg function to validate the given argument index is an uint of the specified bit size.

func WaitFlag added in v0.0.5

func WaitFlag(cmd *cobra.Command)

WaitFlag adds the 'wait' flag to the given command, to wait for 'n' confirmations..

func WaitOnTransaction added in v0.0.3

func WaitOnTransaction(cmd *cobra.Command, tx common.Hash, timeout int) error

func WaitOnTransactions added in v0.0.3

func WaitOnTransactions(cmd *cobra.Command, transactions []common.Hash, timeout int) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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