Documentation ¶
Index ¶
- Variables
- func ConnectP2P(t *testing.T, node1 *ethclient.Client, node2 *ethclient.Client)
- func FindBlock(client *ethclient.Client, from, to int, timeout time.Duration, ...) (*types.Block, error)
- func WaitForBlock(number *big.Int, client *ethclient.Client, opts ...WaitForBlockOption) (*types.Block, error)
- func WaitForBlockToBeFinalized(number *big.Int, client *ethclient.Client, timeout time.Duration) (*types.Block, error)
- func WaitForBlockToBeSafe(number *big.Int, client *ethclient.Client, timeout time.Duration) (*types.Block, error)
- func WaitForL1OriginOnL2(rollupCfg *rollup.Config, l1BlockNum uint64, client *ethclient.Client, ...) (*types.Block, error)
- func WaitForTransaction(hash common.Hash, client *ethclient.Client, timeout time.Duration) (*types.Receipt, error)
- func WithP2P() func(ethCfg *ethconfig.Config, nodeCfg *node.Config) error
- type Beacon
- type GethInstance
- type GethOption
- type WaitForBlockOption
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("not found")
Functions ¶
func ConnectP2P ¶
ConnectP2P creates a p2p peer connection between node1 and node2.
func FindBlock ¶ added in v1.7.2
func FindBlock(client *ethclient.Client, from, to int, timeout time.Duration, pred func(*types.Block) (bool, error), ) (*types.Block, error)
FindBlock finds the first block for which the predicate [pred] matches and returns it. It starts at [from] and iterates until [to], inclusively, using the provided [client]. It supports both search directions, forwards and backwards.
func WaitForBlock ¶
func WaitForBlock(number *big.Int, client *ethclient.Client, opts ...WaitForBlockOption) (*types.Block, error)
WaitForBlock waits for the chain to advance to the provided block number. It can be configured with two different timeout: an absolute timeout, and a no change timeout. The absolute timeout caps the maximum amount of time this method will run. The no change timeout will return an error if the block number does not change within that time window. This is useful to bail out early in the event of a stuck chain, but allow things to continue if the chain is still advancing.
This function will also retry fetch errors up to three times before returning an error in order to protect against transient network problems. This function uses polling rather than websockets.
func WaitForBlockToBeFinalized ¶ added in v1.4.2
func WaitForBlockToBeSafe ¶ added in v1.4.2
func WaitForL1OriginOnL2 ¶
func WaitForTransaction ¶
Types ¶
type Beacon ¶ added in v1.4.2
type Beacon interface {
StoreBlobsBundle(slot uint64, bundle *engine.BlobsBundleV1) error
}
type GethInstance ¶ added in v1.9.1
func InitL2 ¶
func InitL2(name string, genesis *core.Genesis, jwtPath string, opts ...GethOption) (*GethInstance, error)
InitL2 inits a L2 geth node.
func (*GethInstance) AuthRPC ¶ added in v1.9.1
func (gi *GethInstance) AuthRPC() endpoint.RPC
func (*GethInstance) Close ¶ added in v1.9.1
func (gi *GethInstance) Close() error
func (*GethInstance) UserRPC ¶ added in v1.9.1
func (gi *GethInstance) UserRPC() endpoint.RPC
type WaitForBlockOption ¶ added in v1.9.5
type WaitForBlockOption func(*waitForBlockOptions)
func WithAbsoluteTimeout ¶ added in v1.9.5
func WithAbsoluteTimeout(timeout time.Duration) WaitForBlockOption
func WithNoChangeTimeout ¶ added in v1.9.5
func WithNoChangeTimeout(timeout time.Duration) WaitForBlockOption