chain

package
v0.0.0-...-d673ec7 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FlagRpcAddr = cli.StringFlag{
		Name:  "rpc",
		Usage: "geth server rpc address: format: http://..., https://..., ws://...",
		Value: "http://127.0.0.1:8545",
	}
	FlagNoPending = cli.BoolTFlag{
		Name:  "no-pending",
		Usage: "get no pending state",
	}
)
View Source
var BalanceCmd = cli.Command{
	Name:      "balance",
	Usage:     "get balance of an address",
	UsageText: "balance <address> [number]",
	Action:    BalanceAction,
	Flags:     []cli.Flag{FlagNoPending},
}
View Source
var BlockCmd = cli.Command{
	Name:      "block",
	Usage:     "get block by number or hash",
	UsageText: "block [number|hash]",
	Action:    BlockAction,
	Flags:     []cli.Flag{},
}
View Source
var CallCmd = cli.Command{
	Name:      "call",
	Usage:     "call contract",
	UsageText: "call <from> <to> <gas> <gasPrice> <value> <data> [number]",
	Action:    CallAction,
	Flags:     []cli.Flag{FlagNoPending},
}
View Source
var ChainCmd = cli.Command{
	Name:  "chain",
	Usage: "communicate with chain",
	Flags: []cli.Flag{FlagRpcAddr},
	Subcommands: []cli.Command{
		HeaderCmd,
		BlockCmd,
		TransactionCmd,
		ReceiptCmd,
		BalanceCmd,
		NonceCmd,
		CodeCmd,
		StorageCmd,
		SendCmd,
		CallCmd,
		GasCmd,
		PriceCmd,
		ChainIdCmd,
	},
}
View Source
var ChainIdCmd = cli.Command{
	Name:      "id",
	Usage:     "get chain id",
	UsageText: "id",
	Action:    ChainIdAction,
	Flags:     []cli.Flag{},
}
View Source
var CodeCmd = cli.Command{
	Name:      "code",
	Usage:     "get code of a contract",
	UsageText: "code <address> [number]",
	Action:    CodeAction,
	Flags:     []cli.Flag{FlagNoPending},
}
View Source
var (
	ErrInsufficientArguments = fmt.Errorf("insufficient arguments")
)
View Source
var GasCmd = cli.Command{
	Name:      "gas",
	Usage:     "estimate gas",
	UsageText: "gas <from> <to> <gas> <gasPrice> <value> <data>",
	Action:    EstimateGasAction,
	Flags:     []cli.Flag{},
}
View Source
var HeaderCmd = cli.Command{
	Name:      "header",
	Usage:     "get header by number or hash",
	UsageText: "header [number|hash]",
	Action:    HeaderAction,
	Flags:     []cli.Flag{},
}
View Source
var NonceCmd = cli.Command{
	Name:      "nonce",
	Usage:     "get nonce of an address",
	UsageText: "nonce <address> [number]",
	Action:    NonceAction,
	Flags:     []cli.Flag{FlagNoPending},
}
View Source
var ParseBigInt = utils.ParseBigInt
View Source
var ParseUint64 = utils.ParseUint64
View Source
var PriceCmd = cli.Command{
	Name:      "price",
	Usage:     "get suggested gas price",
	UsageText: "price",
	Action:    SuggestGasPriceAction,
	Flags:     []cli.Flag{},
}
View Source
var ReceiptCmd = cli.Command{
	Name:   "receipt",
	Usage:  "get receipt by hash",
	Action: ReceiptAction,
	Flags:  []cli.Flag{},
}
View Source
var SendCmd = cli.Command{
	Name:      "send",
	Usage:     "send a transaction",
	UsageText: "send <tx>",
	Action:    SendAction,
	Flags:     []cli.Flag{},
}
View Source
var StorageCmd = cli.Command{
	Name:      "storage",
	Usage:     "get storage value of a contract by key",
	UsageText: "storage <address> <hash> [number]",
	Action:    StorageAction,
	Flags:     []cli.Flag{FlagNoPending},
}
View Source
var TransactionCmd = cli.Command{
	Name:   "transaction",
	Usage:  "get transaction by hash",
	Action: TransactionAction,
	Flags:  []cli.Flag{},
}

Functions

func BalanceAction

func BalanceAction(c *cli.Context) error

func BalanceAt

func BalanceAt(rpcUrl, account, number string) error

func BlockAction

func BlockAction(c *cli.Context) error

func BlockByHash

func BlockByHash(rpcUrl, hash string) error

func BlockByNumber

func BlockByNumber(rpcUrl, number string) error

func CallAction

func CallAction(c *cli.Context) error

func CallContract

func CallContract(rpcUrl, from, to, gas, gasPrice, value, data, number string) error

func ChainId

func ChainId(rpcUrl string) error

func ChainIdAction

func ChainIdAction(c *cli.Context) error

func CodeAction

func CodeAction(c *cli.Context) error

func CodeAt

func CodeAt(rpcUrl, account, number string) error

func EstimateGas

func EstimateGas(rpcUrl, from, to, gas, gasPrice, value, data string) error

func EstimateGasAction

func EstimateGasAction(c *cli.Context) error

func HeaderAction

func HeaderAction(c *cli.Context) error

func HeaderByHash

func HeaderByHash(rpcUrl, hash string) error

func HeaderByNumber

func HeaderByNumber(rpcUrl, number string) error

func NonceAction

func NonceAction(c *cli.Context) error

func NonceAt

func NonceAt(rpcUrl, account, number string) error

func ParseFlagNoPending

func ParseFlagNoPending(c *cli.Context) bool

func ParseFlagRpcAddr

func ParseFlagRpcAddr(c *cli.Context) string

func PendingBalanceAt

func PendingBalanceAt(rpcUrl, account string) error

func PendingCallContract

func PendingCallContract(rpcUrl, from, to, gas, gasPrice, value, data string) error

func PendingCodeAt

func PendingCodeAt(rpcUrl, account string) error

func PendingNonceAt

func PendingNonceAt(rpcUrl, account string) error

func PendingStorageAt

func PendingStorageAt(rpcUrl, account, key string) error

func ReceiptAction

func ReceiptAction(c *cli.Context) error

func SendAction

func SendAction(c *cli.Context) error

func SendTransaction

func SendTransaction(rpcUrl, rawTxStr string) error

func StorageAction

func StorageAction(c *cli.Context) error

func StorageAt

func StorageAt(rpcUrl, account, key, number string) error

func SubNewHeaderAction

func SubNewHeaderAction(c *cli.Context) error

func SubscribeNewHead

func SubscribeNewHead(rpcUrl string) error

func SuggestGasPrice

func SuggestGasPrice(rpcUrl string) error

func SuggestGasPriceAction

func SuggestGasPriceAction(c *cli.Context) error

func TransactionAction

func TransactionAction(c *cli.Context) error

func TransactionByHash

func TransactionByHash(rpcUrl, hash string) error

func TransactionCount

func TransactionCount(rpcUrl, hash string) error

func TransactionInBlock

func TransactionInBlock(rpcUrl, hash string, index uint) error

func TransactionReceipt

func TransactionReceipt(rpcUrl, hash string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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