registry

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewComposeService

func NewComposeService(registryPath string, composeNetworkName string, log zerolog.Logger) (*composeService, error)

NewComposeService creates a compose-backed registry service. If registryPath is empty, the embedded registry is used.

Types

type ContractEvent

type ContractEvent struct {
	Type        string
	ChainID     []byte
	Endpoint    string
	PublicKey   []byte
	BlockNumber uint64
	TxHash      []byte
}

type Event

type Event struct {
	Type      EventType
	ChainID   []byte
	Endpoint  string
	PublicKey []byte
	Timestamp time.Time
}

type EventType

type EventType string
const (
	EventTypeRollupAdded   EventType = "rollup_added"
	EventTypeRollupRemoved EventType = "rollup_removed"
	EventTypeRollupUpdated EventType = "rollup_updated"
)

type L1Block

type L1Block struct {
	Number    uint64
	Hash      []byte
	Timestamp time.Time
}

type L1Client

type L1Client interface {
	GetLatestBlockNumber(ctx context.Context) (uint64, error)
	GetBlockByNumber(ctx context.Context, blockNumber uint64) (*L1Block, error)
	GetContractEvents(ctx context.Context, contractAddr string, fromBlock, toBlock uint64) ([]ContractEvent, error)
	SubscribeToContractEvents(ctx context.Context, contractAddr string) (<-chan ContractEvent, error)
}

type RollupInfo

type RollupInfo struct {
	ChainID      []byte
	Endpoint     string
	PublicKey    []byte
	StartingSlot uint64
	IsActive     bool
	UpdatedAt    time.Time
}

type Service

type Service interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
	GetActiveRollups(ctx context.Context) ([][]byte, error)
	GetRollupEndpoint(ctx context.Context, chainID []byte) (string, error)
	GetRollupPublicKey(ctx context.Context, chainID []byte) ([]byte, error)
	IsRollupActive(ctx context.Context, chainID []byte) (bool, error)
	WatchRegistry(ctx context.Context) (<-chan Event, error)
	GetRollupInfo(chainID []byte) (*RollupInfo, error)
	GetAllRollups() map[string]*RollupInfo
	SetPollingInterval(interval time.Duration)
}

func NewMemoryService

func NewMemoryService(log zerolog.Logger, chainIDs [][]byte) Service

func NewService

func NewService(logger *log.Logger, l1Client L1Client, contractAddr string) Service

Jump to

Keyboard shortcuts

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