config

package
v0.0.0-...-efbd42f Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// mainnet p2p config.
	MainNetP2ppNetworkID      = "/deltaswap/mainnet/2"
	MainNetP2pBootstrap       = "/dns4/bootstrap.deltaswap.io/udp/8999/quic/p2p/12D3KooWNfBepa7QQDAsy18e5s3VmBp7Urvj9QFFsEimax4wKnG4"
	MainNetP2pPort       uint = 8999

	// testnet p2p config.
	TestNetP2ppNetworkID      = "/deltaswap/testnet/2/1"
	TestNetP2pBootstrap       = "" /* 328-byte string literal not displayed */
	TestNetP2pPort       uint = 8999

	// devnet p2p config.
	DevNetP2ppNetworkID      = "/deltaswap/dev"
	DevNetP2pBootstrap       = "/dns4/phylax-0.phylax/udp/8999/quic/p2p/12D3KooWL3XJ9EMCyZvmmGXL2LMiVBtrVa2BuESsJiXkSj7333Jw"
	DevNetP2pPort       uint = 8999
)

p2p network configuration constants.

Variables

This section is empty.

Functions

func GetAlertConfig

func GetAlertConfig() (alert.AlertConfig, error)

GetAlertConfig get alert config.

func GetEnvironment

func GetEnvironment() string

GetEnvironment get environment.

func GetMaxHealthTimeSeconds

func GetMaxHealthTimeSeconds() int64

GetMaxHealthTimeSeconds get MaxHealthTimeSeconds env value.

func GetMetricsEnabled

func GetMetricsEnabled() bool

GetMetricsEnabled get if metrics is enabled.

func GetPprofEnabled

func GetPprofEnabled() bool

GetPprofEnabled get if pprof is enabled.

func GetPrefix

func GetPrefix() string

Types

type Configuration

type Configuration struct {
	ObservationsChannelSize   int  `env:"OBSERVATIONS_CHANNEL_SIZE,required"`
	VaasChannelSize           int  `env:"VAAS_CHANNEL_SIZE,required"`
	HeartbeatsChannelSize     int  `env:"HEARTBEATS_CHANNEL_SIZE,required"`
	GovernorConfigChannelSize int  `env:"GOVERNOR_CONFIG_CHANNEL_SIZE,required"`
	GovernorStatusChannelSize int  `env:"GOVERNOR_STATUS_CHANNEL_SIZE,required"`
	ApiPort                   uint `env:"API_PORT,required"`
	P2pPort                   uint `env:"P2P_PORT,required"`
}

func New

func New(ctx context.Context) (*Configuration, error)

New creates a configuration with the values from .env file and environment variables.

type P2pNetworkConfig

type P2pNetworkConfig struct {
	Enviroment   string
	P2pNetworkID string
	P2pBootstrap string
}

P2pNetworkConfig config struct.

func GetP2pNetwork

func GetP2pNetwork() (*P2pNetworkConfig, error)

GetP2pNetwork get p2p network config.

Jump to

Keyboard shortcuts

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