chainmanager

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Overview

Package chainmanager manages contexts about multiple chains

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain interface {
	// ConfirmationsThreshold gets the confirmation count
	ConfirmationsThreshold() uint16
	// URLs gets the urls
	URLs() []string
	// ID returns the id of the chain
	ID() uint32
}

Chain contains the context for a single chain.

type ChainManager

type ChainManager interface {
	// GetChainIDs gets all chainids
	GetChainIDs() (chainIDs []uint32)
	// RefreshRPCInfo refreshes rpc info for a chain id
	RefreshRPCInfo(ctx context.Context, chainID uint32)
	// GetChain gets the chain
	GetChain(chainID uint32) Chain
	// PutChain adds chain urls. Any previous chain data is overwritten
	PutChain(chainID uint32, urls []string, confirmations uint16)
}

ChainManager manages chain context.

func NewChainManager

func NewChainManager(handler metrics.Handler) ChainManager

NewChainManager creates a new chain manager.

func NewChainManagerFromConfig

func NewChainManagerFromConfig(configuration config.Config, handler metrics.Handler) ChainManager

NewChainManagerFromConfig creates a new chain manager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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