configs

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: LGPL-2.1 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() *viper.Viper

Types

type EthChainConfig

type EthChainConfig struct {
	Registry string `mapstructure:"bsc_registry"`
	ChainId  uint   `mapstructure:"bsc_chain_id"`
	RPCUrl   string `mapstructure:"bsc_rpc_url"`
}

type IpfsConfig

type IpfsConfig struct {
	Host          string `mapstructure:"ipfs_url"`
	ProjectId     string `mapstructure:"ipfs_username"`
	ProjectSecret string `mapstructure:"ipfs_password"`
}

type MLChainAPI

type MLChainAPI struct {
	// contains filtered or unexported fields
}

type MainConfiguration

type MainConfiguration struct {
	AddressPrefix            string         `mapstructure:"address_prefix"`
	NodePrivateKey           string         `mapstructure:"node_private_key"`
	NetworkPrivateKey        string         `mapstructure:"network_private_key"`
	StakeContract            string         `mapstructure:"stake_contract"`
	ChainId                  uint           `mapstructure:"chain_id"`
	Token                    string         `mapstructure:"token_address"`
	EVMRPCUrl                string         `mapstructure:"evm_rpc_url"` // deprecated
	EVMRPCHttp               string         `mapstructure:"evm_rpc_http"`
	EVMRPCWss                string         `mapstructure:"evm_rpc_wss"`
	Network                  string         `mapstructure:"network"`
	ChannelMessageBufferSize uint           `mapstructure:"channel_message_buffer_size"`
	Ipfs                     IpfsConfig     `mapstructure:"ipfs"`
	Bsc                      EthChainConfig `mapstructure:"bsc"`
	LogLevel                 string         `mapstructure:"log_level"`
	BootstrapPeers           []string       `mapstructure:"bootstrap_peers"`
	Listeners                []string       `mapstructure:"listeners"`
	RPCHost                  string         `mapstructure:"rpc_host"`
	WSAddress                string         `mapstructure:"ws_address"`
	RestAddress              string         `mapstructure:"rest_address"`
	RPCPort                  string         `mapstructure:"rpc_port"`
	RPCHttpPort              string         `mapstructure:"rpc_http_port"`
	Validator                bool           `mapstructure:"validator"`
	BootstrapNode            bool           `mapstructure:"bootstrap_node"`
	DataDir                  string         `mapstructure:"data_dir"`
	SQLDB                    SqlConfig      `mapstructure:"sql"`
	MLBlockchainAPIUrl       string         `mapstructure:"mlayer_api_url"`
	NetworkPublicKey         string
	NetworkKeyAddress        string
}
var (
	Config MainConfiguration
)

func LoadMainConfig

func LoadMainConfig() *MainConfiguration

type SqlConfig

type SqlConfig struct {
	DbDialect         string `mapstructure:"db_dialect"`
	DbHost            string `mapstructure:"db_host"`
	DbStoragePath     string `mapstructure:"db_storage_dir"`
	DbPort            uint   `mapstructure:"db_port"`
	DbDatabase        string `mapstructure:"db_database"`
	DbUser            string `mapstructure:"db_user"`
	DbPassword        string `mapstructure:"db_password"`
	DbSSLMode         string `mapstructure:"db_sslmode"`
	DbTimezone        string `mapstructure:"db_timezone"`
	DbMaxOpenConns    int    `mapstructure:"db_max_open_conns"`
	DbMaxIdleConns    int    `mapstructure:"db_max_idle_conns"`
	DbMaxConnLifetime int    `mapstructure:"db_max_conn_lifetime_seconds"`
}

Jump to

Keyboard shortcuts

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