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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingRPCURL                       = errors.New("missing RPC URL")
	ErrMissingRollupAddress                = errors.New("missing rollup address")
	ErrMissingRollupManagerAddress         = errors.New("missing rollup manager address")
	ErrMissingPOLTokenAddress              = errors.New("missing POL token address")
	ErrMissingGlobalExitRootManagerAddress = errors.New("missing global exit root manager address")
	ErrInvalidBlocksChunkSize              = errors.New("blocks chunk size must be greater than 0")
	ErrInvalidRollupManagerCreationBlock   = errors.New("rollup manager creation block must be greater than 0")
)

Functions

This section is empty.

Types

type CommonConfig added in v0.8.0

type CommonConfig struct {
	// L2URL is the URL of the L2 node
	L2RPC RPCClientConfig `mapstructure:"L2RPC"`
}

Config holds the common configuration for the Aggkit services

type L1NetworkConfig added in v0.8.0

type L1NetworkConfig struct {
	// RPC client configuration for the L1 network
	RPC RPCClientConfig `mapstructure:"RPC"`
	// Chain ID of the L1 network
	ChainID uint64 `json:"chainId"`
	// RollupAddr Address of the L1 rollup contract
	RollupAddr gethcommon.Address `json:"polygonZkEVMAddress"`
	// RollupManagerAddr Address of the L1 contract
	RollupManagerAddr gethcommon.Address `json:"polygonRollupManagerAddress"`
	// POLTokenAddr Address of the L1 POL token Contract
	POLTokenAddr gethcommon.Address `json:"polTokenAddress"`
	// GlobalExitRootManagerAddr Address of the L1 GlobalExitRootManager contract
	GlobalExitRootManagerAddr gethcommon.Address `json:"polygonZkEVMGlobalExitRootAddress"`
	// BlocksChunkSize defines the number of blocks to be queried in each chunk when filtering events
	BlocksChunkSize uint64 `json:"blocksChunkSize"`
	// RollupManagerCreationBlock is the block number when the RollupManager contract was deployed
	RollupManagerCreationBlock uint64 `json:"rollupManagerCreationBlock"`
}

L1NetworkConfig represents the configuration of the network used in L1

func (*L1NetworkConfig) Validate added in v0.8.0

func (c *L1NetworkConfig) Validate() error

Validate checks if the L1NetworkConfig is valid

type L2NetworkConfig added in v0.10.0

type L2NetworkConfig struct {
	// InitialLER is an optional override for the initial Local Exit Root.
	// If set, the RollupManager contract is not queried for the initial LER.
	// Note: 0x000...000 is a valid value. Omit this field to use the contract.
	InitialLER *gethcommon.Hash `mapstructure:"InitialLER"`
}

L2NetworkConfig holds configuration specific to the L2 network

type RPCClientConfig added in v0.1.0

type RPCClientConfig struct {
	common.RetryPolicyGenericConfig `mapstructure:",squash"`
	// URL is the URL of the RPC client
	URL string `mapstructure:"URL"`
	// Mode defines the mode of the RPC client (basic or op)
	// In basic mode, the client connects to a standard RPC endpoint.
	// In op mode, the client connects to an Optimistic RPC endpoint.
	Mode RPCMode `jsonschema:"enum=basic, enum=op" mapstructure:"Mode"`
	//
	// Common params
	//
	// If true, the block Hash is getted from JSON RPC
	// if false, the block Hash is getted from go-ethereum RLP hashing of header
	HashFromJSON bool `mapstructure:"HashFromJSON"`
	// BatchBlockHeaderRetrieval enables using JSON-RPC batch requests when fetching block headers.
	// Disable this if the node does not support batch requests. Default: true.
	BatchBlockHeaderRetrieval bool `mapstructure:"BatchBlockHeaderRetrieval"`
	//
	// Params specific per client
	// ExtraParams contains any additional parameters that may be needed for the RPC client
	ExtraParams map[string]any `jsonschema:"omitempty" mapstructure:",remain"`
}

RPCClientConfig represents the configuration of the RPC client

func NewDefaultRPCClientConfig added in v0.10.0

func NewDefaultRPCClientConfig() *RPCClientConfig

NewDefaultRPCClientConfig returns a new RPCClientConfig with default values

func (RPCClientConfig) GetString added in v0.1.0

func (c RPCClientConfig) GetString(key string) (string, error)

func (*RPCClientConfig) Validate added in v0.8.0

func (c *RPCClientConfig) Validate() error

Validate checks if the L2RPCClientConfig is valid

type RPCMode added in v0.1.0

type RPCMode string
var (
	RPCModeDefault RPCMode = ""
	RPCModeBasic   RPCMode = "basic"
	RPCModeOp      RPCMode = "op"
)

Jump to

Keyboard shortcuts

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