ethtool

package module
v0.0.0-...-91114de Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

README

ethtool

介绍

封装 ethtool

软件架构

软件架构说明

安装教程
  1. xxxx
  2. xxxx
  3. xxxx
使用说明
  1. xxxx
  2. xxxx
  3. xxxx
参与贡献
  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
特技
  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromWei

func FromWei(value *big.Int, unit ValueUnit) *big.Float

func ToWei

func ToWei(value *big.Float, unit ValueUnit) *big.Int

Types

type Client

type Client struct {
	RpcClient *rpc.Client
	ethclient.Client
}

func Dial

func Dial(url string) (*Client, error)

func (*Client) EthAccounts

func (c *Client) EthAccounts(ctx context.Context) ([]common.Address, error)

func (*Client) EthCall

func (c *Client) EthCall(ctx context.Context, msg interface{}) ([]byte, error)

func (*Client) EthCoinbase

func (c *Client) EthCoinbase(ctx context.Context) (common.Address, error)

func (*Client) EthEstimateGas

func (c *Client) EthEstimateGas(ctx context.Context, msg interface{}) (uint64, error)

func (*Client) EthGasPrice

func (c *Client) EthGasPrice(ctx context.Context) (*big.Int, error)

func (*Client) EthGetBalance

func (c *Client) EthGetBalance(ctx context.Context, account common.Address, blockLocator interface{}) (*big.Int, error)

func (*Client) EthGetBlockByHash

func (c *Client) EthGetBlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)

func (*Client) EthGetBlockByNumber

func (c *Client) EthGetBlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)

func (*Client) EthGetBlockTransactionCountByHash

func (c *Client) EthGetBlockTransactionCountByHash(ctx context.Context, blockHash common.Hash) (uint, error)

func (*Client) EthGetBlockTransactionCountByNumber

func (c *Client) EthGetBlockTransactionCountByNumber(ctx context.Context, blockLocator interface{}) (uint, error)

func (*Client) EthGetCode

func (c *Client) EthGetCode(ctx context.Context, account common.Address, blockLocator interface{}) ([]byte, error)

func (*Client) EthGetFilterChanges

func (c *Client) EthGetFilterChanges(ctx context.Context, filterId string) ([]common.Hash, error)

func (*Client) EthGetFilterLogs

func (c *Client) EthGetFilterLogs(ctx context.Context, filterId uint64) (*types.Log, error)

func (*Client) EthGetLogFilterChanges

func (c *Client) EthGetLogFilterChanges(ctx context.Context, filterId string) ([]types.Log, error)

func (*Client) EthGetStorageAt

func (c *Client) EthGetStorageAt(ctx context.Context, account common.Address, key common.Hash, blockNumber *big.Int) ([]byte, error)

func (*Client) EthGetTransactionCount

func (c *Client) EthGetTransactionCount(ctx context.Context, account common.Address, blockLocator interface{}) (uint64, error)

func (*Client) EthGetTransactionReceipt

func (c *Client) EthGetTransactionReceipt(ctx context.Context, hash common.Hash) (*types.Receipt, error)

func (*Client) EthGetUncleCountByBlockHash

func (c *Client) EthGetUncleCountByBlockHash(ctx context.Context, blockHash common.Hash) (uint, error)

to test

func (*Client) EthGetUncleCountByBlockNumber

func (c *Client) EthGetUncleCountByBlockNumber(ctx context.Context, blockLocator interface{}) (uint, error)

func (*Client) EthHashrate

func (c *Client) EthHashrate(ctx context.Context) (uint64, error)

func (*Client) EthMining

func (c *Client) EthMining(ctx context.Context) (bool, error)

func (*Client) EthNewBlockFilter

func (c *Client) EthNewBlockFilter(ctx context.Context) (string, error)

func (*Client) EthNewFilter

func (c *Client) EthNewFilter(ctx context.Context, filterOpts interface{}) (string, error)

func (*Client) EthNewPendingTransactionFilter

func (c *Client) EthNewPendingTransactionFilter(ctx context.Context) (string, error)

func (*Client) EthProtocolVersion

func (c *Client) EthProtocolVersion(ctx context.Context) (string, error)

func (*Client) EthSendRawTransaction

func (c *Client) EthSendRawTransaction(ctx context.Context, rawtx []byte) (common.Hash, error)

func (*Client) EthSendTransaction

func (c *Client) EthSendTransaction(ctx context.Context, msg interface{}) (common.Hash, error)

func (*Client) EthSign

func (c *Client) EthSign(ctx context.Context, account common.Address, data []byte) ([]byte, error)

func (*Client) NetListening

func (c *Client) NetListening(ctx context.Context) (bool, error)

func (*Client) NetPeerCount

func (c *Client) NetPeerCount(ctx context.Context) (uint, error)

func (*Client) NetVersion

func (c *Client) NetVersion(ctx context.Context) (*big.Int, error)

func (*Client) SubscribeNewPendingTransactions

func (c *Client) SubscribeNewPendingTransactions(ctx context.Context, ch chan<- *common.Hash) (ethereum.Subscription, error)

func (*Client) Web3ClientVersion

func (c *Client) Web3ClientVersion(ctx context.Context) (string, error)

func (*Client) Web3Sha3

func (c *Client) Web3Sha3(ctx context.Context, data string) (string, error)

type Credential

type Credential struct {
	PrivateKey *ecdsa.PrivateKey
	PublicKey  *ecdsa.PublicKey
	Address    common.Address
}

func HexToCredential

func HexToCredential(hexkey string) (*Credential, error)

func KeyToCredential

func KeyToCredential(privateKey *ecdsa.PrivateKey) (*Credential, error)

func NewCredential

func NewCredential() (*Credential, error)

func (*Credential) AddressHex

func (c *Credential) AddressHex() string

func (*Credential) GetTransactOpts

func (c *Credential) GetTransactOpts() *bind.TransactOpts

func (*Credential) PrivateKeyHex

func (c *Credential) PrivateKeyHex() string

func (*Credential) PublicKeyHex

func (c *Credential) PublicKeyHex() string

func (*Credential) Sign

func (c *Credential) Sign(data []byte) ([]byte, error)

func (*Credential) SignTx

func (c *Credential) SignTx(tx *types.Transaction, chainid *big.Int) (*types.Transaction, error)

func (*Credential) Verify

func (c *Credential) Verify(data, signature []byte) bool

type SimpleTx

type SimpleTx struct {
	From     common.Address `json:"from"`
	To       common.Address `json:"to"`
	Gas      uint64         `json:"gas"`
	GasPrice *big.Int       `json:"gasPrice"`
	Value    *big.Int       `json:"value"`
	Data     []byte         `json:"data"`
	Nonce    uint64         `json:"nonce"`
}

type ValueUnit

type ValueUnit int64
const (
	Kwei  ValueUnit = 1e3
	Mwei  ValueUnit = 1e6
	Gwei  ValueUnit = 1e9
	Micon ValueUnit = 1e12
	Milli ValueUnit = 1e15
	Ether ValueUnit = 1e18
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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