chains

package
v2.5.1-clf-20230831 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrChainIDEmpty is returned when chain is required but was empty.
	ErrChainIDEmpty = errors.New("chain id empty")
	ErrNotFound     = errors.New("not found")
)
View Source
var (
	ErrLOOPPUnsupported = errors.New("LOOPP not yet supported")
	ErrChainDisabled    = errors.New("chain is disabled")
)
View Source
var ErrNoSuchChainID = errors.New("chain id does not exist")

Functions

This section is empty.

Types

type ChainConfigs

type ChainConfigs interface {
	Chains(offset, limit int, ids ...string) ([]types.ChainStatus, int, error)
}

type ChainOpts added in v2.6.0

type ChainOpts[I ID, N Node] interface {
	Validate() error
	ConfigsAndLogger() (Configs[I, N], logger.Logger)
}

ChainOpts holds options for configuring a Chain

type ChainStatuser added in v2.5.0

type ChainStatuser interface {
	// must return [ErrNotFound] if the id is not found
	ChainStatus(ctx context.Context, id string) (types.ChainStatus, error)
	ChainStatuses(ctx context.Context, offset, limit int) ([]types.ChainStatus, int, error)
}

ChainStatuser is a generic interface for chain configuration.

type ChainsKV added in v2.5.0

type ChainsKV[T types.ChainService] struct {
	// contains filtered or unexported fields
}

func NewChainsKV added in v2.5.0

func NewChainsKV[T types.ChainService](cs map[string]T) *ChainsKV[T]

func (*ChainsKV[T]) Get added in v2.5.0

func (c *ChainsKV[T]) Get(id string) (T, error)

Get return ErrNoSuchChainID if [id] is not found

func (*ChainsKV[T]) Len added in v2.5.0

func (c *ChainsKV[T]) Len() int

func (*ChainsKV[T]) List added in v2.5.0

func (c *ChainsKV[T]) List(ids ...string) ([]T, error)

func (*ChainsKV[T]) Slice added in v2.5.0

func (c *ChainsKV[T]) Slice() []T

type Configs

type Configs[I ID, N Node] interface {
	ChainConfigs
	NodeConfigs[I, N]
}

Configs holds chain and node configurations. TODO: BCF-2605 audit the usage of this interface and potentially remove it

func NewConfigs

func NewConfigs[I ID, N Node](cfgs ConfigsV2[I, N]) Configs[I, N]

NewConfigs returns a Configs backed by ConfigsV2.

type ConfigsV2

type ConfigsV2[I ID, N Node] interface {
	// contains filtered or unexported methods
}

type ID

type ID any

ID types represent unique identifiers within a particular chain type. Using string is recommended.

type Node

type Node any

Node types should be a struct including these default fields:

ID        int32
Name      string

type NodeConfigs

type NodeConfigs[I ID, N Node] interface {
	Node(name string) (N, error)
	Nodes(chainID I) (nodes []N, err error)

	NodeStatus(name string) (types.NodeStatus, error)
}

type NodesStatuser added in v2.5.0

type NodesStatuser interface {
	NodeStatuses(ctx context.Context, offset, limit int, chainIDs ...string) (nodes []types.NodeStatus, count int, err error)
}

NodesStatuser is an interface for node configuration and state. TODO BCF-2440, BCF-2511 may need Node(ctx,name) to get a node status by name

Directories

Path Synopsis
evm
gas
gas/cmd/arbgas
arbgas takes a single URL argument and prints the result of three GetLegacyGas calls to the Arbitrum gas estimator.
arbgas takes a single URL argument and prints the result of three GetLegacyGas calls to the Arbitrum gas estimator.
log
logpoller
Package logpoller is a service for querying EVM log data.
Package logpoller is a service for querying EVM log data.

Jump to

Keyboard shortcuts

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