config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: MIT Imports: 26 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Mining: mining.Config{
		Heartbeat: time.Minute,
	},
	Web: web.Config{
		ListenHost: "",
		ListenPort: 9090,
	},
	Db: db.Config{
		RemotePort:    9090,
		Path:          "db",
		RemoteTimeout: format.Duration{Duration: 5 * time.Second},
	},
	TransactorTellor: transactorTellor.Config{
		GasMaxTipGwei: 10,
	},
	SubmitterTellor: tellor.Config{
		Enabled: true,

		MinSubmitPeriod: format.Duration{Duration: 15*time.Minute + 1*time.Second},
	},
	PsrTellor: psrTellor.Config{
		MinConfidence: 80,
	},
	Aggregator: aggregator.Config{
		ManualDataFile: "configs/manualData.json",
	},
	TrackerIndex: index.Config{
		Interval:  format.Duration{Duration: time.Minute},
		IndexFile: "configs/index.json",
	},
	EnvFile: "configs/.env",
}

Functions

func DeеpCopy

func DeеpCopy(logger log.Logger, path string, cfg, cfgDefault interface{}, strictParsing bool) (interface{}, error)

func LoadEnvFile

func LoadEnvFile(logger log.Logger, path string) error

Types

type Config

type Config struct {
	Web              web.Config
	Mining           mining.Config
	SubmitterTellor  tellor.Config
	Tasker           tasker.Config
	TransactorTellor transactorTellor.Config
	TrackerIndex     index.Config
	Aggregator       aggregator.Config
	PsrTellor        psrTellor.Config
	Db               db.Config
	// EnvFile location that include all private details like private key etc.
	EnvFile string `json:"envFile"`
}

Config is the top-level configuration that holds configs for all components.

func LoadConfig added in v0.2.0

func LoadConfig(logger log.Logger, path string, strictParsing bool) (*Config, error)

func OpenTestConfig

func OpenTestConfig(dir string) (*Config, error)

func Parse

func Parse(logger log.Logger, path string, strictParsing bool) (*Config, error)

Jump to

Keyboard shortcuts

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