guardianproverheartbeater

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockSenderHeartbeater

type BlockSenderHeartbeater interface {
	BlockSigner
	Heartbeater
}

BlockSenderHeartbeater defines an interface that communicates with a central Guardian Prover server, sending heartbeats and signed blocks (and in the future, contested blocks).

type BlockSigner

type BlockSigner interface {
	SignAndSendBlock(ctx context.Context, blockID *big.Int) error
	SendStartup(
		ctx context.Context,
		revision string,
		version string,
		l1NodeVersion string,
		l2NodeVersion string,
	) error
}

BlockSigner defines an interface that communicates with a central Guardian Prover server, sending signed blocks.

type GuardianProverHeartBeater

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

GuardianProverHeartBeater is responsible for signing and sending known blocks to the health check server.

func New

func New(
	privateKey *ecdsa.PrivateKey,
	healthCheckServerEndpoint *url.URL,
	rpc *rpc.Client,
	proverAddress common.Address,
) *GuardianProverHeartBeater

New creates a new GuardianProverBlockSender instance.

func (*GuardianProverHeartBeater) SendHeartbeat

func (s *GuardianProverHeartBeater) SendHeartbeat(
	ctx context.Context,
	latestL1Block uint64,
	latestL2Block uint64,
) error

SendHeartbeat sends a heartbeat to the health check server.

func (*GuardianProverHeartBeater) SendStartup

func (s *GuardianProverHeartBeater) SendStartup(
	ctx context.Context,
	revision string,
	version string,
	l1NodeVersion string,
	l2NodeVersion string,
) error

SendStartup sends the startup message to the health check server.

func (*GuardianProverHeartBeater) SignAndSendBlock

func (s *GuardianProverHeartBeater) SignAndSendBlock(ctx context.Context, blockID *big.Int) error

SignAndSendBlock signs the given block and sends it to the health check server.

type Heartbeater

type Heartbeater interface {
	SendHeartbeat(ctx context.Context, latestL1Block uint64, latestL2Block uint64) error
}

Heartbeater defines an interface that communicates with a central Guardian Prover server, sending heartbeats.

Jump to

Keyboard shortcuts

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