config

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MIT 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 {
	LogLevel string `toml:"log_level"`

	Signer  SignerServiceConfig `toml:"signer_service"`
	Metrics MetricsConfig       `toml:"metrics"`
	Healthz HealthzConfig       `toml:"healthz"`

	Wallets   map[string]*WalletConfig   `toml:"wallets"`
	Providers map[string]*ProviderConfig `toml:"providers"`
}

func New

func New(file string) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type HealthzConfig

type HealthzConfig struct {
	Enabled bool   `toml:"enabled"`
	Host    string `toml:"host"`
	Port    string `toml:"port"`
}

type MetricsConfig

type MetricsConfig struct {
	Enabled bool   `toml:"enabled"`
	Debug   bool   `toml:"debug"`
	Host    string `toml:"host"`
	Port    string `toml:"port"`
}

type ProviderConfig

type ProviderConfig struct {
	Network string `toml:"network"`
	URL     string `toml:"url"`

	ReadOnly     bool         `toml:"read_only"`
	ReadInterval TOMLDuration `toml:"read_interval"`

	SendInterval                 TOMLDuration `toml:"send_interval"`
	SendTransactionRetryInterval TOMLDuration `toml:"send_transaction_retry_interval"`
	SendTransactionRetryTimeout  TOMLDuration `toml:"send_transaction_retry_timeout"`
	SendTransactionCoolDown      TOMLDuration `toml:"send_transaction_cool_down"`
	ReceiptRetrievalInterval     TOMLDuration `toml:"receipt_retrieval_interval"`
	ReceiptRetrievalTimeout      TOMLDuration `toml:"receipt_retrieval_timeout"`

	Wallet string `toml:"wallet"`
}

type SignerServiceConfig

type SignerServiceConfig struct {
	URL       string `toml:"url"`
	TLSCaCert string `toml:"tls_ca_cert"`
	TLSCert   string `toml:"tls_cert"`
	TLSKey    string `toml:"tls_key"`
}

type TOMLDuration

type TOMLDuration time.Duration

func (*TOMLDuration) UnmarshalText

func (t *TOMLDuration) UnmarshalText(b []byte) error

type WalletConfig

type WalletConfig struct {
	ChainID big.Int `toml:"chain_id"`

	// signer | static
	SignerMethod string `toml:"signer_method"`
	Address      string `toml:"address"`
	// private key is used for static signing
	PrivateKey string `toml:"private_key"`

	// transaction parameters
	TxValue big.Int `toml:"tx_value"`
}

Jump to

Keyboard shortcuts

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