config

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

README

Config Package

Locates and parses a chia configuration file into a config struct. If the CHIA_ROOT environment variable is set, the config will be loaded from that location. Otherwise, the package will look in ~/.chia/mainnet. See the wiki for for more information on using the CHIA_ROOT variable.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChiaRootPath

func GetChiaRootPath() (string, error)

GetChiaRootPath returns the root path for the chia installation

Types

type ChiaConfig

type ChiaConfig struct {
	ChiaRoot        string
	DaemonPort      uint16          `yaml:"daemon_port"`
	DaemonSSL       SSLConfig       `yaml:"daemon_ssl"`
	Farmer          FarmerConfig    `yaml:"farmer"`
	FullNode        FullNodeConfig  `yaml:"full_node"`
	Harvester       HarvesterConfig `yaml:"harvester"`
	Wallet          WalletConfig    `yaml:"wallet"`
	Seeder          SeederConfig    `yaml:"seeder"`
	DataLayer       DataLayerConfig `yaml:"data_layer"`
	Timelord        TimelordConfig  `yaml:"timelord"`
	SelectedNetwork string          `yaml:"selected_network"`
}

ChiaConfig the chia config.yaml

func GetChiaConfig

func GetChiaConfig() (*ChiaConfig, error)

GetChiaConfig returns a struct containing the config.yaml values

func (*ChiaConfig) GetFullPath added in v0.0.7

func (c *ChiaConfig) GetFullPath(filename string) string

GetFullPath returns the full path to a particular filename within CHIA_ROOT

type CrawlerConfig

type CrawlerConfig struct {
	PortConfig `yaml:",inline"`
	SSL        SSLConfig `yaml:"ssl"`
}

CrawlerConfig is the subsection of the seeder config specific to the crawler

type DataLayerConfig added in v0.4.0

type DataLayerConfig struct {
	PortConfig `yaml:",inline"`
	SSL        SSLConfig `yaml:"ssl"`
}

DataLayerConfig datalayer configuration section

type FarmerConfig

type FarmerConfig struct {
	PortConfig `yaml:",inline"`
	SSL        SSLConfig `yaml:"ssl"`
}

FarmerConfig farmer configuration section

type FullNodeConfig

type FullNodeConfig struct {
	PortConfig      `yaml:",inline"`
	SSL             SSLConfig `yaml:"ssl"`
	SelectedNetwork string    `yaml:"selected_network"`
	DatabasePath    string    `yaml:"database_path"`
	DNSServers      []string  `yaml:"dns_servers"`
}

FullNodeConfig full node configuration section

type HarvesterConfig

type HarvesterConfig struct {
	PortConfig `yaml:",inline"`
	SSL        SSLConfig `yaml:"ssl"`
}

HarvesterConfig harvester configuration section

type PortConfig

type PortConfig struct {
	Port    uint16 `yaml:"port"`
	RPCPort uint16 `yaml:"rpc_port"`
}

PortConfig common port settings found in many sections of the config

type SSLConfig

type SSLConfig struct {
	PrivateCRT string `yaml:"private_crt"`
	PrivateKey string `yaml:"private_key"`
	PublicCRT  string `yaml:"public_crt"`
	PublicKey  string `yaml:"public_key"`
}

SSLConfig common ssl settings found in many sections of the config

func (*SSLConfig) LoadPrivateKeyPair

func (s *SSLConfig) LoadPrivateKeyPair(rootPath string) (*tls.Certificate, error)

LoadPrivateKeyPair loads the private key pair for the SSLConfig

func (*SSLConfig) LoadPublicKeyPair

func (s *SSLConfig) LoadPublicKeyPair(rootPath string) (*tls.Certificate, error)

LoadPublicKeyPair loads the public key pair for the SSLConfig

type SeederConfig

type SeederConfig struct {
	CrawlerConfig CrawlerConfig `yaml:"crawler"`
}

SeederConfig seeder configuration section

type TimelordConfig added in v0.7.0

type TimelordConfig struct {
	PortConfig `yaml:",inline"`
	SSL        SSLConfig `yaml:"ssl"`
}

TimelordConfig timelord configuration section

type WalletConfig

type WalletConfig struct {
	PortConfig `yaml:",inline"`
	SSL        SSLConfig `yaml:"ssl"`
}

WalletConfig wallet configuration section

Jump to

Keyboard shortcuts

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