eth1

package
v3.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: GPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EthAddress = "0x878705ba3f8bc32fcf7f4caa1a35e72af65cf766"
)
View Source
const KeystorePassword = "password"

KeystorePassword is the password used to decrypt ETH1 keystores.

View Source
const NetworkId = 1337

NetworkId is the ID of the ETH1 chain.

Variables

This section is empty.

Functions

func SendTransaction

func SendTransaction(client *rpc.Client, key *ecdsa.PrivateKey, f *filler.Filler, gasPrice *big.Int, addr string, N uint64, al bool) error

func WaitForBlocks

func WaitForBlocks(web3 *ethclient.Client, keystore *keystore.Key, blocksToWait uint64) error

WaitForBlocks waits for a certain amount of blocks to be mined by the ETH1 chain before returning.

Types

type Miner

type Miner struct {
	e2etypes.ComponentRunner
	// contains filtered or unexported fields
}

Miner represents an ETH1 node which mines blocks.

func NewMiner

func NewMiner() *Miner

NewMiner creates and returns an ETH1 node miner.

func (*Miner) ENR

func (m *Miner) ENR() string

ENR returns the miner's enode.

func (*Miner) KeystorePath

func (m *Miner) KeystorePath() string

KeystorePath returns the path of the keystore file.

func (*Miner) Pause

func (m *Miner) Pause() error

Pause pauses the component and its underlying process.

func (*Miner) Resume

func (m *Miner) Resume() error

Resume resumes the component and its underlying process.

func (*Miner) SetBootstrapENR

func (m *Miner) SetBootstrapENR(bootstrapEnr string)

SetBootstrapENR sets the bootstrap record.

func (*Miner) Start

func (m *Miner) Start(ctx context.Context) error

Start runs a mining ETH1 node. The miner is responsible for moving the ETH1 chain forward and for deploying the deposit contract.

func (*Miner) Started

func (m *Miner) Started() <-chan struct{}

Started checks whether ETH1 node is started and ready to be queried.

func (*Miner) Stop

func (m *Miner) Stop() error

Stop kills the component and its underlying process.

type Node

type Node struct {
	e2etypes.ComponentRunner
	// contains filtered or unexported fields
}

Node represents an ETH1 node.

func NewNode

func NewNode(index int, enr string) *Node

NewNode creates and returns ETH1 node.

func (*Node) Pause

func (node *Node) Pause() error

Pause pauses the component and its underlying process.

func (*Node) Resume

func (node *Node) Resume() error

Resume resumes the component and its underlying process.

func (*Node) Start

func (node *Node) Start(ctx context.Context) error

Start runs a non-mining ETH1 node. To connect to a miner and start working properly, this node should be a part of a NodeSet.

func (*Node) Started

func (node *Node) Started() <-chan struct{}

Started checks whether ETH1 node is started and ready to be queried.

func (*Node) Stop

func (node *Node) Stop() error

Stop kills the component and its underlying process.

type NodeSet

type NodeSet struct {
	e2etypes.ComponentRunner
	// contains filtered or unexported fields
}

NodeSet represents a set of Eth1 nodes, none of which is a mining node.

func NewNodeSet

func NewNodeSet() *NodeSet

NewNodeSet creates and returns a set of Eth1 nodes.

func (*NodeSet) ComponentAtIndex

func (s *NodeSet) ComponentAtIndex(i int) (e2etypes.ComponentRunner, error)

ComponentAtIndex returns the component at the provided index.

func (*NodeSet) Pause

func (s *NodeSet) Pause() error

Pause pauses the component and its underlying process.

func (*NodeSet) PauseAtIndex

func (s *NodeSet) PauseAtIndex(i int) error

PauseAtIndex pauses the component and its underlying process at the desired index.

func (*NodeSet) Resume

func (s *NodeSet) Resume() error

Resume resumes the component and its underlying process.

func (*NodeSet) ResumeAtIndex

func (s *NodeSet) ResumeAtIndex(i int) error

ResumeAtIndex resumes the component and its underlying process at the desired index.

func (*NodeSet) SetMinerENR

func (s *NodeSet) SetMinerENR(enr string)

SetMinerENR sets the miner's enode, used to connect to the miner through P2P.

func (*NodeSet) Start

func (s *NodeSet) Start(ctx context.Context) error

Start starts all the beacon nodes in set.

func (*NodeSet) Started

func (s *NodeSet) Started() <-chan struct{}

Started checks whether beacon node set is started and all nodes are ready to be queried.

func (*NodeSet) Stop

func (s *NodeSet) Stop() error

Stop stops the component and its underlying process.

func (*NodeSet) StopAtIndex

func (s *NodeSet) StopAtIndex(i int) error

StopAtIndex stops the component and its underlying process at the desired index.

type Proxy

type Proxy struct {
	e2etypes.ComponentRunner
	// contains filtered or unexported fields
}

Proxy represents an engine-api proxy.

func NewProxy

func NewProxy(index int) *Proxy

NewProxy creates and returns an engine-api proxy.

func (*Proxy) AddRequestInterceptor

func (node *Proxy) AddRequestInterceptor(rpcMethodName string, responseGen func() interface{}, trigger func() bool)

AddRequestInterceptor adds in a json-rpc request interceptor.

func (*Proxy) Pause

func (node *Proxy) Pause() error

Pause pauses the component and its underlying process.

func (*Proxy) ReleaseBackedUpRequests

func (node *Proxy) ReleaseBackedUpRequests(rpcMethodName string)

ReleaseBackedUpRequests releases backed up http requests which were previously ignored due to our interceptors.

func (*Proxy) RemoveRequestInterceptor

func (node *Proxy) RemoveRequestInterceptor(rpcMethodName string)

RemoveRequestInterceptor removes the request interceptor for the provided method.

func (*Proxy) Resume

func (node *Proxy) Resume() error

Resume resumes the component and its underlying process.

func (*Proxy) Start

func (node *Proxy) Start(ctx context.Context) error

Start runs a proxy.

func (*Proxy) Started

func (node *Proxy) Started() <-chan struct{}

Started checks whether the eth1 proxy is started and ready to be queried.

func (*Proxy) Stop

func (node *Proxy) Stop() error

Stop kills the component and its underlying process.

type ProxySet

type ProxySet struct {
	e2etypes.ComponentRunner
	// contains filtered or unexported fields
}

ProxySet represents a set of proxies for the engine-api.

func NewProxySet

func NewProxySet() *ProxySet

NewProxySet creates and returns a set of engine-api proxies.

func (*ProxySet) ComponentAtIndex

func (s *ProxySet) ComponentAtIndex(i int) (e2etypes.ComponentRunner, error)

ComponentAtIndex returns the component at the provided index.

func (*ProxySet) Pause

func (s *ProxySet) Pause() error

Pause pauses the component and its underlying process.

func (*ProxySet) PauseAtIndex

func (s *ProxySet) PauseAtIndex(i int) error

PauseAtIndex pauses the component and its underlying process at the desired index.

func (*ProxySet) Resume

func (s *ProxySet) Resume() error

Resume resumes the component and its underlying process.

func (*ProxySet) ResumeAtIndex

func (s *ProxySet) ResumeAtIndex(i int) error

ResumeAtIndex resumes the component and its underlying process at the desired index.

func (*ProxySet) Start

func (s *ProxySet) Start(ctx context.Context) error

Start starts all the proxies in set.

func (*ProxySet) Started

func (s *ProxySet) Started() <-chan struct{}

Started checks whether proxy set is started and all proxies are ready to be queried.

func (*ProxySet) Stop

func (s *ProxySet) Stop() error

Stop stops the component and its underlying process.

func (*ProxySet) StopAtIndex

func (s *ProxySet) StopAtIndex(i int) error

StopAtIndex stops the component and its underlying process at the desired index.

type TransactionGenerator

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

func NewTransactionGenerator

func NewTransactionGenerator(keystore string, seed int64) *TransactionGenerator

func (*TransactionGenerator) Pause

func (t *TransactionGenerator) Pause() error

Pause pauses the component and its underlying process.

func (*TransactionGenerator) Resume

func (t *TransactionGenerator) Resume() error

Resume resumes the component and its underlying process.

func (*TransactionGenerator) Start

func (t *TransactionGenerator) Start(ctx context.Context) error

func (*TransactionGenerator) Started

func (s *TransactionGenerator) Started() <-chan struct{}

Started checks whether beacon node set is started and all nodes are ready to be queried.

func (*TransactionGenerator) Stop

func (t *TransactionGenerator) Stop() error

Stop stops the component and its underlying process.

Jump to

Keyboard shortcuts

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