util

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2020 License: LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallContract

func CallContract(client *rpc.Client, contractID, payLoad string, height int64) (map[string]interface{}, error)

CallContract call contract

func GenerateKey

func GenerateKey(shard uint) (*common.Address, *ecdsa.PrivateKey, error)

GenerateKey generate key by shard

func GenerateTx

func GenerateTx(from *ecdsa.PrivateKey, to common.Address, amount *big.Int, price *big.Int, gasLimit uint64, nonce uint64, payload []byte) (*types.Transaction, error)

GenerateTx generate a transaction based on the address type of to

func GetAccountNonce

func GetAccountNonce(client *rpc.Client, account common.Address, hexHash string, height int64) (uint64, error)

GetAccountNonce get account nonce by account

func GetGenerateKeyPairCmd

func GetGenerateKeyPairCmd(name string) (cmds *cobra.Command)

GetGenerateKeyPairCmd represents the generateKeyPair command

func GetInfo

func GetInfo(client *rpc.Client) (api.GetMinerInfo, error)

func GetNetworkID

func GetNetworkID(client *rpc.Client) (string, error)

GetNetworkID get network ID

func GetTransactionByHash

func GetTransactionByHash(client *rpc.Client, hash string) (map[string]interface{}, error)

func SendTx

func SendTx(client *rpc.Client, tx *types.Transaction) (bool, error)

Types

type Config

type Config struct {
	//Config is the Configuration of log
	LogConfig comm.LogConfig `json:"log"`

	// basic config for Node
	BasicConfig node.BasicConfig `json:"basic"`

	// The configuration of p2p network
	P2PConfig p2p.Config `json:"p2p"`

	// HttpServer config for http server
	HTTPServer node.HTTPServer `json:"httpServer"`

	// The configuration of websocket rpc service
	WSServerConfig node.WSServerConfig `json:"wsserver"`

	// The configuration of ipc rpc service
	Ipcconfig node.IpcConfig `json:"ipcconfig"`

	// metrics config info
	MetricsConfig *metrics.Config `json:"metrics"`

	// genesis config info
	GenesisConfig core.GenesisInfo `json:"genesis"`
}

Config is the Configuration of node

Jump to

Keyboard shortcuts

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