config

package
v1.1.13-beta Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(cfgFile string) error

Types

type APIConfig

type APIConfig struct {
	Host                string                   `mapstructure:"host"`
	BasicAuth           BasicAuthConfig          `mapstructure:"basicAuth"`
	ThirdwebContractApi string                   `mapstructure:"thirdwebContractApi"`
	ContractApiRequest  ContractApiRequestConfig `mapstructure:"contractApiRequest"`
	AbiDecodingEnabled  bool                     `mapstructure:"abiDecodingEnabled"`
	Thirdweb            ThirdwebConfig           `mapstructure:"thirdweb"`
}

type BasicAuthConfig

type BasicAuthConfig struct {
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
}

type BlockPublisherConfig

type BlockPublisherConfig struct {
	Enabled   bool   `mapstructure:"enabled"`
	TopicName string `mapstructure:"topicName"`
}

type ClickhouseConfig

type ClickhouseConfig struct {
	Host                         string                         `mapstructure:"host"`
	Port                         int                            `mapstructure:"port"`
	Username                     string                         `mapstructure:"username"`
	Password                     string                         `mapstructure:"password"`
	Database                     string                         `mapstructure:"database"`
	DisableTLS                   bool                           `mapstructure:"disableTLS"`
	AsyncInsert                  bool                           `mapstructure:"asyncInsert"`
	MaxRowsPerInsert             int                            `mapstructure:"maxRowsPerInsert"`
	MaxOpenConns                 int                            `mapstructure:"maxOpenConns"`
	MaxIdleConns                 int                            `mapstructure:"maxIdleConns"`
	ChainBasedConfig             map[string]TableOverrideConfig `mapstructure:"chainBasedConfig"`
	EnableParallelViewProcessing bool                           `mapstructure:"enableParallelViewProcessing"`
}

type CommitterConfig

type CommitterConfig struct {
	Enabled         bool `mapstructure:"enabled"`
	Interval        int  `mapstructure:"interval"`
	BlocksPerCommit int  `mapstructure:"blocksPerCommit"`
	FromBlock       int  `mapstructure:"fromBlock"`
}

type Config

type Config struct {
	RPC              RPCConfig              `mapstructure:"rpc"`
	Log              LogConfig              `mapstructure:"log"`
	Poller           PollerConfig           `mapstructure:"poller"`
	Committer        CommitterConfig        `mapstructure:"committer"`
	FailureRecoverer FailureRecovererConfig `mapstructure:"failureRecoverer"`
	ReorgHandler     ReorgHandlerConfig     `mapstructure:"reorgHandler"`
	Storage          StorageConfig          `mapstructure:"storage"`
	API              APIConfig              `mapstructure:"api"`
	Publisher        PublisherConfig        `mapstructure:"publisher"`
	WorkMode         WorkModeConfig         `mapstructure:"workMode"`
}
var Cfg Config

type ContractApiRequestConfig

type ContractApiRequestConfig struct {
	MaxIdleConns        int  `mapstructure:"maxIdleConns"`
	MaxIdleConnsPerHost int  `mapstructure:"maxIdleConnsPerHost"`
	MaxConnsPerHost     int  `mapstructure:"maxConnsPerHost"`
	IdleConnTimeout     int  `mapstructure:"idleConnTimeout"`
	DisableCompression  bool `mapstructure:"disableCompression"`
	Timeout             int  `mapstructure:"timeout"`
}

type EventPublisherConfig

type EventPublisherConfig struct {
	Enabled       bool     `mapstructure:"enabled"`
	TopicName     string   `mapstructure:"topicName"`
	AddressFilter []string `mapstructure:"addressFilter"`
	Topic0Filter  []string `mapstructure:"topic0Filter"`
}

type FailureRecovererConfig

type FailureRecovererConfig struct {
	Enabled      bool `mapstructure:"enabled"`
	Interval     int  `mapstructure:"interval"`
	BlocksPerRun int  `mapstructure:"blocksPerRun"`
}

type LogConfig

type LogConfig struct {
	Level    string `mapstructure:"level"`
	Prettify bool   `mapstructure:"prettify"`
}

type PollerConfig

type PollerConfig struct {
	Enabled         bool `mapstructure:"enabled"`
	Interval        int  `mapstructure:"interval"`
	BlocksPerPoll   int  `mapstructure:"blocksPerPoll"`
	FromBlock       int  `mapstructure:"fromBlock"`
	ForceFromBlock  bool `mapstructure:"forceFromBlock"`
	UntilBlock      int  `mapstructure:"untilBlock"`
	ParallelPollers int  `mapstructure:"parallelPollers"`
}

type PublisherConfig

type PublisherConfig struct {
	Enabled      bool                       `mapstructure:"enabled"`
	Brokers      string                     `mapstructure:"brokers"`
	Username     string                     `mapstructure:"username"`
	Password     string                     `mapstructure:"password"`
	Blocks       BlockPublisherConfig       `mapstructure:"blocks"`
	Transactions TransactionPublisherConfig `mapstructure:"transactions"`
	Traces       TracePublisherConfig       `mapstructure:"traces"`
	Events       EventPublisherConfig       `mapstructure:"events"`
}

type RPCBatchRequestConfig

type RPCBatchRequestConfig struct {
	BlocksPerRequest int `mapstructure:"blocksPerRequest"`
	BatchDelay       int `mapstructure:"batchDelay"`
}

type RPCConfig

type RPCConfig struct {
	URL           string                          `mapstructure:"url"`
	Blocks        RPCBatchRequestConfig           `mapstructure:"blocks"`
	Logs          RPCBatchRequestConfig           `mapstructure:"logs"`
	BlockReceipts ToggleableRPCBatchRequestConfig `mapstructure:"blockReceipts"`
	Traces        ToggleableRPCBatchRequestConfig `mapstructure:"traces"`
	ChainID       string                          `mapstructure:"chainId"`
}

type ReorgHandlerConfig

type ReorgHandlerConfig struct {
	Enabled        bool `mapstructure:"enabled"`
	Interval       int  `mapstructure:"interval"`
	BlocksPerScan  int  `mapstructure:"blocksPerScan"`
	FromBlock      int  `mapstructure:"fromBlock"`
	ForceFromBlock bool `mapstructure:"forceFromBlock"`
}

type StorageConfig

type StorageConfig struct {
	Staging      StorageConnectionConfig `mapstructure:"staging"`
	Main         StorageConnectionConfig `mapstructure:"main"`
	Orchestrator StorageConnectionConfig `mapstructure:"orchestrator"`
}

type StorageConnectionConfig

type StorageConnectionConfig struct {
	Clickhouse *ClickhouseConfig `mapstructure:"clickhouse"`
}

type StorageType

type StorageType string
const (
	StorageTypeMain         StorageType = "main"
	StorageTypeStaging      StorageType = "staging"
	StorageTypeOrchestrator StorageType = "orchestrator"
)

type TableConfig

type TableConfig struct {
	DefaultSelectFields []string `mapstructure:"defaultSelectFields"`
	TableName           string   `mapstructure:"tableName"`
}

type TableOverrideConfig

type TableOverrideConfig map[string]TableConfig

type ThirdwebConfig

type ThirdwebConfig struct {
	ClientId string `mapstructure:"clientId"`
}

type ToggleableRPCBatchRequestConfig

type ToggleableRPCBatchRequestConfig struct {
	Enabled bool `mapstructure:"enabled"`
	RPCBatchRequestConfig
}

type TracePublisherConfig

type TracePublisherConfig struct {
	Enabled   bool   `mapstructure:"enabled"`
	TopicName string `mapstructure:"topicName"`
}

type TransactionPublisherConfig

type TransactionPublisherConfig struct {
	Enabled    bool     `mapstructure:"enabled"`
	TopicName  string   `mapstructure:"topicName"`
	ToFilter   []string `mapstructure:"toFilter"`
	FromFilter []string `mapstructure:"fromFilter"`
}

type WorkModeConfig

type WorkModeConfig struct {
	CheckIntervalMinutes int   `mapstructure:"checkIntervalMinutes"`
	LiveModeThreshold    int64 `mapstructure:"liveModeThreshold"`
}

Jump to

Keyboard shortcuts

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