Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var BTCAddressByChainConfigs = map[string]*chaincfg.Params{ "bitcoin-regtest": &chaincfg.RegressionNetParams, "bitcoin-testnet": &chaincfg.TestNet3Params, "bitcoin-mainnet": &chaincfg.MainNetParams, "bitcoin-simnet": &chaincfg.SimNetParams, }
TODO: Fix chain following https://github.com/satoshilabs/slips/blob/master/slip-0044.md
Functions ¶
Types ¶
type Config ¶
type Config struct { Server ServerConfig `mapstructure:"server"` // TODO: Refactor db config ScalarDb PostgresDBConfig `mapstructure:"db"` Metrics MetricsConfig `mapstructure:"metrics"` InitDApps InitDAppsConfig }
type InitDAppsConfig ¶
type InitDAppsConfig struct { Env string ConfigChainsPath string RuntimeChainsPath string ProtocolAddressHex string ProtocolPubKeyHex string EvmFileName string AddressesFileName string }
func (*InitDAppsConfig) ReadConfig ¶
func (cfg *InitDAppsConfig) ReadConfig() error
type MetricsConfig ¶
type MetricsConfig struct { // IP of the prometheus server Host string `mapstructure:"host"` // Port of the prometheus server Port int `mapstructure:"port"` }
MetricsConfig defines the server's metric configuration
func DefaultMetricsConfig ¶
func DefaultMetricsConfig() MetricsConfig
func (*MetricsConfig) GetMetricsPort ¶
func (cfg *MetricsConfig) GetMetricsPort() int
func (*MetricsConfig) Validate ¶
func (cfg *MetricsConfig) Validate() error
type PostgresDBConfig ¶
type PostgresDBConfig struct { DbName string `mapstructure:"db-name"` Host string `mapstructure:"host"` Port int `mapstructure:"port"` User string `mapstructure:"user"` Password string `mapstructure:"password"` LogLevel string `mapstructure:"log-level"` }
func (*PostgresDBConfig) Validate ¶
func (cfg *PostgresDBConfig) Validate() error
type ServerConfig ¶
type ServerConfig struct { Host string `mapstructure:"host"` Port int `mapstructure:"port"` WriteTimeout time.Duration `mapstructure:"write-timeout"` ReadTimeout time.Duration `mapstructure:"read-timeout"` IdleTimeout time.Duration `mapstructure:"idle-timeout"` AllowedOrigins []string `mapstructure:"allowed-origins"` BTCNet string `mapstructure:"btc-net"` LogLevel string `mapstructure:"log-level"` MaxContentLength int64 `mapstructure:"max-content-length"` HealthCheckInterval int `mapstructure:"health-check-interval"` BTCNetParam *chaincfg.Params }
func (*ServerConfig) Validate ¶
func (cfg *ServerConfig) Validate() error
func (*ServerConfig) ValidateServerLogLevel ¶
func (cfg *ServerConfig) ValidateServerLogLevel() error
Click to show internal directories.
Click to hide internal directories.