Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0, MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FlagCfg is the flag for the configuration file(s)
	FlagCfg = "cfg"
	// FlagComponents is the flag for the list of components to run
	FlagComponents = "components"
	// EnvVarPrefix is the prefix for the environment variables that override config values
	EnvVarPrefix = "CDK_PROXY"
	// ConfigType is the format of the configuration files
	ConfigType = "toml"
)
View Source
const (
	// PROXY name to identify the bridge-service proxy component
	PROXY = "proxy"
	// TRACKER name to identify the bridge tracker component
	TRACKER = "tracker"
)
View Source
const DefaultValues = `` /* 8571-byte string literal not displayed */

DefaultValues is the default configuration

Variables

This section is empty.

Functions

func SHA1

func SHA1(cfg *Config) (string, error)

SHA1 returns the sha1sum (hex) of the effective configuration cfg was decoded into: config file(s), defaults, and any CDK_PROXY_* environment overrides. It identifies the effective configuration of an instance (exposed by the tracker health endpoint), so instances behind a proxy can be checked to run the same configuration; hashing only the input files would miss environment overrides and let differently-behaving instances report the same fingerprint.

func ValidateComponents

func ValidateComponents(components []string) error

ValidateComponents validates that all provided components are known/supported by the proxy binary.

Types

type Config

type Config struct {
	// Log configures the logger
	Log log.Config `mapstructure:"Log"`

	// L1RPC is the L1 JSON-RPC endpoint used to enumerate the rollup manager's networks and to
	// poll the on-chain events the bridge service finder watches
	L1RPC ethermanconfig.RPCClientConfig `mapstructure:"L1RPC"`

	// L2RPC configures the JSON-RPC clients dialed for every L2 network (mode, retry policy,
	// HashFromJSON, batching). Its URL is ignored: each network's URL is resolved by the
	// BridgeServiceFinder
	L2RPC ethermanconfig.RPCClientConfig `mapstructure:"L2RPC"`

	// BridgeServiceFinder configures the networkID -> bridge service URL / JSON-RPC resolver shared
	// by the proxy and tracker components
	BridgeServiceFinder bridgeservicefinder.Config `mapstructure:"BridgeServiceFinder"`

	// REST configures the shared HTTP server where every component of this binary registers
	// its routes (tracker REST/WS endpoints, proxy routes)
	REST aggkitcommon.RESTConfig `mapstructure:"REST"`

	// Prometheus configures the metrics server (enabled by default, like aggkit's)
	Prometheus prometheus.Config `mapstructure:"Prometheus"`

	// Tracker configures the bridge tracker component (only its file-borne fields; the
	// programmatic ones are wired by the binary, see cmd)
	Tracker bridgetracker.Config `mapstructure:"Tracker"`
}

Config holds the full configuration of the proxy component

func Load

func Load(ctx *cli.Context) (*Config, error)

Load loads the configuration merging the default values with the config file(s) passed through the cli context (flag --cfg)

func LoadFiles

func LoadFiles(configFiles []string) (*Config, error)

LoadFiles loads the configuration merging the default values with the given config files

Jump to

Keyboard shortcuts

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