config

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

Config Package

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChikRootPath

func GetChikRootPath() (string, error)

GetChikRootPath returns the root path for the chik installation

Types

type ChikConfig

type ChikConfig struct {
	ChikRoot        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"`
	SelectedNetwork string          `yaml:"selected_network"`
}

ChikConfig the chik config.yaml

func GetChikConfig

func GetChikConfig() (*ChikConfig, error)

GetChikConfig returns a struct containing the config.yaml values

func (*ChikConfig) GetFullPath

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

GetFullPath returns the full path to a particular filename within CHIK_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

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 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