containers

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GethContainer

type GethContainer struct {
	Container testcontainers.Container
	HttpURL   string
	WsURL     string
	ChainID   uint64
}

GethContainer represents a go-ethereum container.

func NewGethContainer

func NewGethContainer(ctx context.Context) (*GethContainer, error)

NewGethContainer creates a new geth container.

func (*GethContainer) CreateAccount

func (g *GethContainer) CreateAccount(
	ctx context.Context, address, privateKey string, initialBalance uint64,
) (big.Int, error)

CreateAccount creates and funds a new account in the geth container.

func (*GethContainer) HTTPConnStr

func (g *GethContainer) HTTPConnStr(t *testing.T, ctx context.Context) string

HTTPConnStr returns the http connection string for the geth container (from the container host).

func (*GethContainer) Teardown

func (g *GethContainer) Teardown(ctx context.Context) error

func (*GethContainer) WSConnStr

func (g *GethContainer) WSConnStr(t *testing.T, ctx context.Context) string

WSConnStr returns the websocket connection string for the geth container (from the container host).

type StdoutLogConsumer

type StdoutLogConsumer struct{ Prefix string }

StdoutLogConsumer is a LogConsumer that prints the log to stdout.

func (*StdoutLogConsumer) Accept

func (lc *StdoutLogConsumer) Accept(l testcontainers.Log)

Accept prints the log to stdout.

Jump to

Keyboard shortcuts

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