config

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Profiles = map[string]Profile{

	"cardano-preprod-testing": Profile{
		Network:       "preprod",
		Tld:           "cardano",
		PolicyId:      "6af60c2a7a06551ef09b3810a41d086b26ca26f926d22e462103194d",
		ScriptAddress: "addr_test1vr75xezmpxastymx985l3gamuxrwqdwcfrcnjlygs55aynsqu3edq",
		InterceptSlot: 50844079,
		InterceptHash: "81325118471fddb00a20327572b371aee7cce13b846a18500d011b9cefd2a34c",
	},
}

Functions

This section is empty.

Types

type Config

type Config struct {
	Logging LoggingConfig `yaml:"logging"`
	Metrics MetricsConfig `yaml:"metrics"`
	Dns     DnsConfig     `yaml:"dns"`
	Debug   DebugConfig   `yaml:"debug"`
	Indexer IndexerConfig `yaml:"indexer"`
	State   StateConfig   `yaml:"state"`
	Profile string        `yaml:"profile" envconfig:"PROFILE"`
}

func GetConfig

func GetConfig() *Config

GetConfig returns the global config instance

func Load

func Load(configFile string) (*Config, error)

type DebugConfig

type DebugConfig struct {
	ListenAddress string `yaml:"address" envconfig:"DEBUG_ADDRESS"`
	ListenPort    uint   `yaml:"port"    envconfig:"DEBUG_PORT"`
}

type DnsConfig

type DnsConfig struct {
	ListenAddress    string   `yaml:"address"          envconfig:"DNS_LISTEN_ADDRESS"`
	ListenPort       uint     `yaml:"port"             envconfig:"DNS_LISTEN_PORT"`
	RecursionEnabled bool     `yaml:"recursionEnabled" envconfig:"DNS_RECURSION"`
	FallbackServers  []string `yaml:"fallbackServers"  envconfig:"DNS_FALLBACK_SERVERS"`
}

type IndexerConfig

type IndexerConfig struct {
	Network       string `yaml:"network"       envconfig:"INDEXER_NETWORK"`
	NetworkMagic  uint32 `yaml:"networkMagic"  envconfig:"INDEXER_NETWORK_MAGIC"`
	Address       string `yaml:"address"       envconfig:"INDEXER_TCP_ADDRESS"`
	SocketPath    string `yaml:"socketPath"    envconfig:"INDEXER_SOCKET_PATH"`
	ScriptAddress string `yaml:"scriptAddress" envconfig:"INDEXER_SCRIPT_ADDRESS"`
	InterceptHash string `yaml:"interceptHash" envconfig:"INDEXER_INTERCEPT_HASH"`
	InterceptSlot uint64 `yaml:"interceptSlot" envconfig:"INDEXER_INTERCEPT_SLOT"`
	Tld           string `yaml:"tld" envconfig:"INDEXER_TLD"`
	PolicyId      string `yaml:"policyId" envconfig:"INDEXER_POLICY_ID"`
	Verify        bool   `yaml:"verify" envconfig:"INDEXER_VERIFY"`
}

type LoggingConfig

type LoggingConfig struct {
	Healthchecks bool   `yaml:"healthchecks" envconfig:"LOGGING_HEALTHCHECKS"`
	Level        string `yaml:"level"        envconfig:"LOGGING_LEVEL"`
	QueryLog     bool   `yaml:"queryLog"     envconfig:"LOGGING_QUERY_LOG"`
}

type MetricsConfig

type MetricsConfig struct {
	ListenAddress string `yaml:"address" envconfig:"METRICS_LISTEN_ADDRESS"`
	ListenPort    uint   `yaml:"port"    envconfig:"METRICS_LISTEN_PORT"`
}

type Profile added in v0.10.0

type Profile struct {
	Network       string // Cardano network name
	Tld           string // Top-level domain
	PolicyId      string // Verification asset policy ID
	ScriptAddress string // Address to follow
	InterceptSlot uint64 // Chain-sync initial intercept slot
	InterceptHash string // Chain-sync initial intercept hash
}

type StateConfig

type StateConfig struct {
	Directory string `yaml:"dir" envconfig:"STATE_DIR"`
}

Jump to

Keyboard shortcuts

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