config

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: Apache-2.0, MIT Imports: 4 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 L2RPCClientConfig `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 L2RPCClientConfig added in v0.8.0

type L2RPCClientConfig struct {
	// RPCClientConfig contains the basic RPC client configuration
	RPCClientConfig `mapstructure:",squash"`
	// 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"`
	// ExtraParams contains any additional parameters that may be needed for the RPC client
	ExtraParams map[string]any `jsonschema:"omitempty" mapstructure:",remain"`
}

L2RPCClientConfig represents the configuration of the L2 RPC client

func (L2RPCClientConfig) GetString added in v0.8.0

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

func (*L2RPCClientConfig) Validate added in v0.8.0

func (c *L2RPCClientConfig) Validate() error

Validate checks if the L2RPCClientConfig is valid

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"`
}

RPCClientConfig represents the configuration of the RPC client

func (*RPCClientConfig) Validate added in v0.8.0

func (c *RPCClientConfig) Validate() error

Validate checks if the RPCClientConfig is valid

type RPCMode added in v0.1.0

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

Jump to

Keyboard shortcuts

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