chains

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainRegistry

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

ChainRegistry manages chain clients based on their configurations

func NewChainRegistry

func NewChainRegistry(dbManager *db.ChainDBManager, logger zerolog.Logger) *ChainRegistry

NewChainRegistry creates a new chain registry

func (*ChainRegistry) AddOrUpdateChain

func (r *ChainRegistry) AddOrUpdateChain(ctx context.Context, config *uregistrytypes.ChainConfig) error

AddOrUpdateChain adds a new chain or updates an existing one

func (*ChainRegistry) CreateChainClient

func (r *ChainRegistry) CreateChainClient(config *uregistrytypes.ChainConfig) (common.ChainClient, error)

CreateChainClient creates a chain client based on VM type

func (*ChainRegistry) GetAllChains

func (r *ChainRegistry) GetAllChains() map[string]common.ChainClient

GetAllChains returns all registered chain clients

func (*ChainRegistry) GetChain

func (r *ChainRegistry) GetChain(chainID string) common.ChainClient

GetChain retrieves a chain client by ID

func (*ChainRegistry) GetDatabaseStats

func (r *ChainRegistry) GetDatabaseStats() map[string]interface{}

GetDatabaseStats returns statistics about all managed databases

func (*ChainRegistry) GetHealthStatus

func (r *ChainRegistry) GetHealthStatus() map[string]bool

GetHealthStatus returns the health status of all chains

func (*ChainRegistry) RemoveChain

func (r *ChainRegistry) RemoveChain(chainID string)

RemoveChain removes a chain from the registry

func (*ChainRegistry) SetAppConfig

func (r *ChainRegistry) SetAppConfig(cfg *config.Config)

SetAppConfig sets the application config for the registry

func (*ChainRegistry) SetObserver

func (r *ChainRegistry) SetObserver(observer ChainRegistryObserver)

SetObserver sets the observer for chain events

func (*ChainRegistry) SetVoteHandler

func (r *ChainRegistry) SetVoteHandler(handler common.VoteHandler)

SetVoteHandler sets the vote handler for all chains (backward compatibility)

func (*ChainRegistry) SetVoteHandlers

func (r *ChainRegistry) SetVoteHandlers(handlers map[string]common.VoteHandler)

SetVoteHandlers sets per-chain vote handlers

func (*ChainRegistry) StopAll

func (r *ChainRegistry) StopAll()

StopAll stops all chain clients

type ChainRegistryObserver

type ChainRegistryObserver interface {
	OnChainAdded(chainID string)
}

ChainRegistryObserver is an interface for observing chain addition events

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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