Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CName = "config"

Variables

This section is empty.

Functions

This section is empty.

Types

type AA

type AA struct {
	AlchemyApiKey     string `yaml:"alchemyApiKey"`
	AlchemyRpcUrl     string `yaml:"alchemyRpcUrl"`
	AccountFactory    string `yaml:"accountFactory"`
	EntryPoint        string `yaml:"entryPoint"`
	GasPolicyId       string `yaml:"gasPolicyID"`
	ChainID           int    `yaml:"chainID"`
	NameTokensPerName uint8  `yaml:"nameTokensPerName"`
}

type Cache added in v0.7.0

type Cache struct {
	// the cache needs a replica set (or a sharded cluster): every write of a name is a
	// transaction that compares chain blocks. a standalone Mongo can not do that atomically,
	// two concurrent refreshes can then store an older chain state over a newer one.
	// the node refuses to start on a standalone Mongo unless this is set (local development only)
	AllowUnsafeStandalone bool `yaml:"allowUnsafeStandalone"`

	// how often the background repair scans the cache for the records that need a refresh
	// (seconds): incomplete ones, expired ones, lapsed ones. 0: the default (60), negative: off
	RepairIntervalSec int `yaml:"repairIntervalSec"`
}

Cache configures the Mongo name cache (see the "Name cache" section of the README)

type Config

type Config struct {
	Drpc             rpc.Config             `yaml:"drpc"`
	Log              logger.Config          `yaml:"log"`
	Account          accountservice.Config  `yaml:"account"`
	Network          nodeconf.Configuration `yaml:"network"`
	NetworkStorePath string                 `yaml:"networkStorePath"`
	Quic             quic.Config            `yaml:"quic"`
	Yamux            yamux.Config           `yaml:"yamux"`
	Mongo            Mongo                  `yaml:"mongo"`
	Cache            Cache                  `yaml:"cache"`
	Contracts        Contracts              `yaml:"contracts"`
	Aa               AA                     `yaml:"accountAbstraction"`
	Metric           metric.Config          `yaml:"metric"`
	Nonce            Nonce                  `yaml:"nonce"`
	Queue            Queue                  `yaml:"queue"`
	Limiter          limiter.Config         `yaml:"limiter"`
	Sentry           Sentry                 `yaml:"sentry"`
	// use mongo cache to read data from
	ReadFromCache bool `yaml:"readFromCache"`

	// if false -> will use old-school ENSIP1
	//
	// 1. ENSIP1 standard: ens-go v3.6.0 (current) is using it
	// 2. ENSIP15 standard: that is an another standard for ENS namehashes
	// that was accepted in June 2023.
	//
	// Current AnyNS (as of June 2024) implementation supports ENSIP1, ENSIP15
	Ensip15Validation bool `yaml:"ensip15validation"`
}

func NewFromFile

func NewFromFile(path string) (c *Config, err error)

func (*Config) GetAA

func (c *Config) GetAA() AA

func (*Config) GetAccount

func (c *Config) GetAccount() accountservice.Config

func (*Config) GetContracts

func (c *Config) GetContracts() Contracts

func (*Config) GetDrpc

func (c *Config) GetDrpc() rpc.Config

func (*Config) GetLimiterConf added in v0.2.2

func (c *Config) GetLimiterConf() limiter.Config

func (*Config) GetMetric added in v0.0.2

func (c *Config) GetMetric() metric.Config

func (*Config) GetNodeConf

func (c *Config) GetNodeConf() nodeconf.Configuration

func (*Config) GetNodeConfStorePath

func (c *Config) GetNodeConfStorePath() string

func (*Config) GetNonce added in v0.1.4

func (c *Config) GetNonce() Nonce

func (*Config) GetQueue

func (c *Config) GetQueue() Queue

func (*Config) GetQuic

func (c *Config) GetQuic() quic.Config

func (*Config) GetSentry added in v0.2.2

func (c *Config) GetSentry() Sentry

func (*Config) GetYamux

func (c *Config) GetYamux() yamux.Config

func (*Config) Init

func (c *Config) Init(a *app.App) (err error)

func (*Config) Name

func (c *Config) Name() (name string)

type Contracts

type Contracts struct {
	GethUrl                        string `yaml:"gethUrl"`
	AddrRegistry                   string `yaml:"ensRegistry"`
	AddrResolver                   string `yaml:"resolver"`
	AddrRegistrarImplementation    string `yaml:"registrarImplementation"`
	AddrRegistrarConroller         string `yaml:"registrarController"`
	AddrRegistrarPrivateController string `yaml:"registrarControllerPrivate"`
	AddrToken                      string `yaml:"nameToken"`
	TokenDecimals                  uint8  `yaml:"tokenDecimals"`
	AddrNameWrapper                string `yaml:"nameWrapper"`

	AddrAdmin string `yaml:"admin"`
	AdminPk   string `yaml:"adminPk"`

	// when tx is sent, we will first try to get it N times
	// each time waiting for X seconds. If we will not get it -> we will think that TX
	// was immediately rejected without mining, which is a "high nonce" sign
	// (probabilistic, but it's ok)
	WaitMiningRetryCount uint `yaml:"waitMintingRetryCount"`
}

type Mongo

type Mongo struct {
	Connect    string `yaml:"connect"`
	Database   string `yaml:"database"`
	Collection string `yaml:"collection"`
}

type Nonce

type Nonce struct {
	NonceOverride uint64 `yaml:"nonce_override"`
}

type Queue

type Queue struct {
	// if true - do not scan DB for items in "stuck" states
	// and do not try to process them
	SkipExistingItemsInDB bool `yaml:"skipExistingItemsInDB"`

	// do not process items means that we will just update their status in the DB
	// as if they were successfully processed (for testing purposes only!)
	SkipProcessing bool `yaml:"isSkipProcessing"`

	SkipBackroundProcessing bool `yaml:"isSkipProcessingBackground"`

	LowNonceRetryCount uint `yaml:"retryCountNonce"`

	HighNonceRetryCount uint `yaml:"retryCountHighNonce"`
}

type Sentry added in v0.2.2

type Sentry struct {
	Dsn         string `yaml:"dsn"`
	Environment string `yaml:"environment"`
}

Jump to

Keyboard shortcuts

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