ethclient

package
v0.0.0-...-abe358f Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePrivateKey

func GeneratePrivateKey() (*ecdsa.PrivateKey, error)

GeneratePrivateKey generates a new private key

func PrivateKeyFromHex

func PrivateKeyFromHex(hexKey string) (*ecdsa.PrivateKey, error)

PrivateKeyFromHex converts a hex string to private key

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client encapsulates Ethereum client connection information

func ClientFromSuite

func ClientFromSuite(suite *ethtest.Suite, cfg *config.Config, nodeIndex int) *Client

ClientFromSuite creates a Client from an existing Suite (for legacy code compatibility)

func NewClient

func NewClient(cfg *config.Config, nodeIndex int) (*Client, error)

NewClient creates a new Ethereum client from configuration This is the SINGLE entry point for creating clients, eliminating dial repetition

func NewClientWithPrivateKey

func NewClientWithPrivateKey(cfg *config.Config, nodeIndex int, privateKey *ecdsa.PrivateKey) (*Client, error)

NewClientWithPrivateKey creates a client with a custom private key

func (*Client) Dial

func (c *Client) Dial() (*ethtest.Conn, error)

Dial establishes a connection to the node This is the unified dial method, replacing all the scattered dial code

func (*Client) DialAndPeer

func (c *Client) DialAndPeer() (*ethtest.Conn, error)

DialAndPeer establishes a connection and performs peering Pass nil for default peering

func (*Client) GetNode

func (c *Client) GetNode() *enode.Node

GetNode returns the enode information

func (*Client) GetNodeIP

func (c *Client) GetNodeIP() string

GetNodeIP returns the node IP address

func (*Client) GetNodeName

func (c *Client) GetNodeName() string

GetNodeName returns the node name

func (*Client) GetSuite

func (c *Client) GetSuite() *ethtest.Suite

GetSuite returns the underlying eth test suite

func (*Client) String

func (c *Client) String() string

String returns a string representation of the client

Jump to

Keyboard shortcuts

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