configs

package
v1.2.14 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: LGPL-2.1 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() *viper.Viper

Types

type ChainId added in v1.2.0

type ChainId string

func (*ChainId) Bytes added in v1.2.0

func (n *ChainId) Bytes() []byte

func (*ChainId) Equals added in v1.2.0

func (n *ChainId) Equals(s ChainId) bool

type EthConfig added in v1.2.0

type EthConfig struct {
	Name                  string `toml:"name"`
	Http                  string `toml:"http"`
	Wss                   string `toml:"wss"`
	TokenContract         string `toml:"token_contract"`
	XTokenContract        string `toml:"x_token_contract"`
	ChainInfoContract     string `toml:"chain_info_contract"`
	SentryNodeContract    string `toml:"sentry_node_contract"`
	ValidatorNodeContract string `toml:"validator_node_contract"`
	SubnetContract        string `toml:"subnet_contract"`
	RegistryContract      string `toml:"registry_contract"`
}

type IpfsConfig

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

type MLChainAPI

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

type MainConfiguration

type MainConfiguration struct {
	AddressPrefix string `toml:"network_address_prefix"`
	// StakeContract            string         `toml:"stake_contract"`
	ChainId ChainId `toml:"chain_id"`
	// Token                    string         `toml:"token_address"`
	// EVMRPCUrl                string         `toml:"evm_rpc_url"` // deprecated
	// EVMRPCHttp               string         `toml:"evm_rpc_http"`
	// EVMRPCWss                string         `toml:"evm_rpc_wss"`
	ProtocolVersion          string               `toml:"protocol_version"`
	ChannelMessageBufferSize uint                 `toml:"channel_message_buffer_size"`
	Ipfs                     IpfsConfig           `toml:"ipfs"`
	LogLevel                 string               `toml:"log_level"`
	BootstrapPeers           []string             `toml:"bootstrap_peers"`
	ListenerAdresses         []string             `toml:"listener_addresses"`
	RPCHost                  string               `toml:"rpc_host"`
	WSAddress                string               `toml:"ws_address"`
	RestAddress              string               `toml:"rest_address"`
	RPCPort                  string               `toml:"rpc_port"`
	RPCHttpPort              string               `toml:"rpc_http_port"`
	Validator                bool                 `toml:"validator"`
	BootstrapNode            bool                 `toml:"bootstrap_node"`
	DataDir                  string               `toml:"data_dir"`
	KeyStoreDir              string               `toml:"keystore_dir"`
	SQLDB                    SqlConfig            `toml:"sql"`
	MLBlockchainAPIUrl       string               `toml:"mlayer_api_url"`
	PrivateKey               string               `toml:"private_key"`
	EvmRpcConfig             map[string]EthConfig `toml:"evm_rpc"`
	PublicKey                string
	OperatorAddress          string

	PrivateKeyEDD  []byte
	PublicKeyEDD   []byte
	PrivateKeySECP []byte
	PublicKeySECP  []byte

	OwnerAddress common.Address
	NoSync       bool
	Context      *context.Context
}
var (
	Config MainConfiguration
)

func LoadConfig added in v1.2.0

func LoadConfig() (*MainConfiguration, error)

func LoadMainConfig

func LoadMainConfig() *MainConfiguration

type SqlConfig

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

Jump to

Keyboard shortcuts

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