config

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2025 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Overview

Package confg is a placeholder package for settings that will probably be config values at some point in the future. I couldn't decide on a config package or library. It's hard coded here for now in a way that I hope is convenient for refactoring in the future.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config

func Config() *config

Config will return the current configuration for the entire application (assuming it's been initialized).

Types

type ContractAddresses

type ContractAddresses struct {
	// PoS
	StateSyncSenderAddress   *string `mapstructure:"state_sync_sender_address"`
	StateSyncReceiverAddress *string `mapstructure:"state_sync_receiver_address"`
	CheckpointAddress        *string `mapstructure:"checkpoint_address"`

	// zkEVM
	GlobalExitRootL2Address *string `mapstructure:"global_exit_root_l2_address"`
	ZkEVMBridgeAddress      *string `mapstructure:"zkevm_bridge_address"`
	RollupManagerAddress    *string `mapstructure:"rollup_manager_address"`
}

type CustomNetwork

type CustomNetwork struct {
	Name    string `mapstructure:"name"`
	ChainID uint64 `mapstructure:"chain_id"`
}

func (CustomNetwork) GetChainID

func (n CustomNetwork) GetChainID() uint64

GetChainID returns the network chain ID.

func (CustomNetwork) GetName

func (n CustomNetwork) GetName() string

GetName returns the network name.

type ExchangeRates

type ExchangeRates struct {
	CoinbaseURL string              `mapstructure:"coinbase_url" validate:"required"`
	Tokens      map[string][]string `mapstructure:"tokens"`
	Interval    uint                `mapstructure:"interval"`
}

type HTTP

type HTTP struct {
	Port    int    `mapstructure:"port" validate:"required"`
	Address string `mapstructure:"address" validate:"required"`
	Path    string `mapstructure:"path" validate:"required"`
}

HTTP defines the HTTP properties that we'll use for exposing metrics.

type HashDivergence

type HashDivergence struct {
	Interval uint `mapstructure:"interval"`
}

type HeimdallEndpoint

type HeimdallEndpoint struct {
	Name          string `mapstructure:"name"`
	TendermintURL string `mapstructure:"tendermint_url" validate:"url,required_with=Name"`
	HeimdallURL   string `mapstructure:"heimdall_url" validate:"url,required_with=Name"`
	Label         string `mapstructure:"label" validate:"required_with=Name"`
	Interval      uint   `mapstructure:"interval"`
}

type Logs

type Logs struct {
	Pretty    bool   `mapstructure:"pretty"`
	Verbosity string `mapstructure:"verbosity"`
}

type Providers

type Providers struct {
	RPCs              []RPC              `mapstructure:"rpc" validate:"dive"`
	HeimdallEndpoints []HeimdallEndpoint `mapstructure:"heimdall" validate:"dive"`
	SensorNetworks    []SensorNetwork    `mapstructure:"sensor_network" validate:"dive"`
	HashDivergence    *HashDivergence    `mapstructure:"hash_divergence"`
	System            *System            `mapstructure:"system"`
	ExchangeRates     *ExchangeRates     `mapstructure:"exchange_rates"`
}

type RPC

type RPC struct {
	Name       string            `mapstructure:"name"`
	URL        string            `mapstructure:"url" validate:"url,required_with=Name"`
	Label      string            `mapstructure:"label" validate:"required_with=Name"`
	Interval   uint              `mapstructure:"interval"`
	Contracts  ContractAddresses `mapstructure:"contracts"`
	TimeToMine *TimeToMine       `mapstructure:"time_to_mine"`
	Accounts   []string          `mapstructure:"accounts"`
}

RPC defines the various RPC providers that will be monitored.

type Runner

type Runner struct {
	Interval uint `mapstructure:"interval" validate:"required"`
}

Runner holds the config values that are needed to manage the job system.

type SensorNetwork

type SensorNetwork struct {
	Name     string `mapstructure:"name"`
	Label    string `mapstructure:"label" validate:"required_with=Name"`
	Project  string `mapstructure:"project" validate:"required_with=Name"`
	Database string `mapstructure:"database"`
	Interval uint   `mapstructure:"interval"`
}

type System

type System struct {
	Interval uint `mapstructure:"interval"`
}

type TimeToMine

type TimeToMine struct {
	Sender           string `mapstructure:"sender" validate:"required"`
	SenderPrivateKey string `mapstructure:"sender_private_key" validate:"required"`
	Receiver         string `mapstructure:"receiver" validate:"required"`
	Value            int64  `mapstructure:"value" validate:"required"`
	Data             string `mapstructure:"data"`
	GasPriceFactor   int64  `mapstructure:"gas_price_factor"`
	GasLimit         uint64 `mapstructure:"gas_limit" validate:"required"`
}

Jump to

Keyboard shortcuts

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