config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Project string           `mapstructure:"project"`
	Log     LogConfig        `mapstructure:"log"`
	Scanner ScannerConfig    `mapstructure:"scanner"`
	RPC     []rpc.NodeConfig `mapstructure:"rpc_nodes"`
}

Config represents the global configuration for the scanner application.

func Load

func Load(path string) (*Config, error)

Load reads and parses configuration from a YAML file and environment variables.

type LogConfig

type LogConfig struct {
	Level  string `mapstructure:"level"`  // debug, info, warn, error
	Format string `mapstructure:"format"` // text, json
}

LogConfig holds configuration for application logging.

type ScannerConfig

type ScannerConfig struct {
	ChainID   string        `mapstructure:"chain_id"`
	BatchSize uint64        `mapstructure:"batch_size"`
	Interval  time.Duration `mapstructure:"interval"`

	// Confirmations (ReorgSafeDepth): Protection at the scanning endpoint
	Confirmations uint64 `mapstructure:"confirmations"`

	// Startup strategy
	StartBlock   uint64 `mapstructure:"start_block"`   // If > 0 and ForceStart=true, forces start from here
	ForceStart   bool   `mapstructure:"force_start"`   // Whether to force override persistence records
	Rewind       uint64 `mapstructure:"start_rewind"`  // If no saved cursor, start from Latest - Rewind
	CursorRewind uint64 `mapstructure:"cursor_rewind"` // If saved cursor exists, start from Cursor - CursorRewind (safety buffer)

	UseBloom bool `mapstructure:"use_bloom"`

	// StoragePrefix: Prefix for storage layer (e.g., PG table prefix or Redis Key prefix)
	StoragePrefix string `mapstructure:"storage_prefix"`
}

ScannerConfig holds specific settings for the EVM scanning process.

Jump to

Keyboard shortcuts

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