config

package
v0.78.1-chaosnet Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackOff

type BackOff struct {
	InitialInterval     time.Duration `json:"initial_interval" mapstructure:"initial_interval"`
	RandomizationFactor float64       `json:"randomization_factor" mapstructure:"randomization_factor"`
	Multiplier          float64       `json:"multiplier" mapstructure:"multiplier"`
	MaxInterval         time.Duration `json:"max_interval" mapstructure:"max_interval"`
	MaxElapsedTime      time.Duration `json:"max_elapsed_time" mapstructure:"max_elapsed_time"`
}

BackOff configuration

type BlockScannerConfiguration

type BlockScannerConfiguration struct {
	RPCHost                    string        `json:"rpc_host" mapstructure:"rpc_host"`
	StartBlockHeight           int64         `json:"start_block_height" mapstructure:"start_block_height"`
	BlockScanProcessors        int           `json:"block_scan_processors" mapstructure:"block_scan_processors"`
	HttpRequestTimeout         time.Duration `json:"http_request_timeout" mapstructure:"http_request_timeout"`
	HttpRequestReadTimeout     time.Duration `json:"http_request_read_timeout" mapstructure:"http_request_read_timeout"`
	HttpRequestWriteTimeout    time.Duration `json:"http_request_write_timeout" mapstructure:"http_request_write_timeout"`
	MaxHttpRequestRetry        int           `json:"max_http_request_retry" mapstructure:"max_http_request_retry"`
	BlockHeightDiscoverBackoff time.Duration `json:"block_height_discover_back_off" mapstructure:"block_height_discover_back_off"`
	BlockRetryInterval         time.Duration `json:"block_retry_interval" mapstructure:"block_retry_interval"`
	EnforceBlockHeight         bool          `json:"enforce_block_height" mapstructure:"enforce_block_height"`
	DBPath                     string        `json:"db_path" mapstructure:"db_path"`
	ChainID                    common.Chain  `json:"chain_id" mapstructure:"chain_id"`
}

BlockScannerConfiguration settings for BlockScanner

type ChainConfiguration

type ChainConfiguration struct {
	ChainID             common.Chain              `json:"chain_id" mapstructure:"chain_id"`
	ChainHost           string                    `json:"chain_host" mapstructure:"chain_host"`
	ChainNetwork        string                    `json:"chain_network" mapstructure:"chain_network"`
	UserName            string                    `json:"username" mapstructure:"username"`
	Password            string                    `json:"password" mapstructure:"password"`
	RPCHost             string                    `json:"rpc_host" mapstructure:"rpc_host"`
	HTTPostMode         bool                      `json:"http_post_mode" mapstructure:"http_post_mode"` // Bitcoin core only supports HTTP POST mode
	DisableTLS          bool                      `json:"disable_tls" mapstructure:"disable_tls"`       // Bitcoin core does not provide TLS by default
	BlockScanner        BlockScannerConfiguration `json:"block_scanner" mapstructure:"block_scanner"`
	BackOff             BackOff
	OptToRetire         bool `json:"opt_to_retire" mapstructure:"opt_to_retire"` // don't emit support for this chain during keygen process
	ParallelMempoolScan int  `json:"parallel_mempool_scan" mapstructure:"parallel_mempool_scan"`
}

ChainConfiguration configuration

type ClientConfiguration

type ClientConfiguration struct {
	ChainID         common.Chain `json:"chain_id" mapstructure:"chain_id" `
	ChainHost       string       `json:"chain_host" mapstructure:"chain_host"`
	ChainRPC        string       `json:"chain_rpc" mapstructure:"chain_rpc"`
	ChainHomeFolder string       `json:"chain_home_folder" mapstructure:"chain_home_folder"`
	SignerName      string       `json:"signer_name" mapstructure:"signer_name"`
	SignerPasswd    string
	BackOff         BackOff
}

ClientConfiguration

type Configuration

type Configuration struct {
	Signer    SignerConfiguration  `json:"signer" mapstructure:"signer"`
	Thorchain ClientConfiguration  `json:"thorchain" mapstructure:"thorchain"`
	Metrics   MetricsConfiguration `json:"metrics" mapstructure:"metrics"`
	Chains    []ChainConfiguration `json:"chains" mapstructure:"chains"`
	TSS       TSSConfiguration     `json:"tss" mapstructure:"tss"`
	BackOff   BackOff              `json:"back_off" mapstructure:"back_off"`
}

func LoadBiFrostConfig

func LoadBiFrostConfig(file string) (*Configuration, error)

LoadBiFrostConfig read the bifrost configuration from the given file

type MetricsConfiguration

type MetricsConfiguration struct {
	Enabled      bool           `json:"enabled" mapstructure:"enabled"`
	ListenPort   int            `json:"listen_port" mapstructure:"listen_port"`
	ReadTimeout  time.Duration  `json:"read_timeout" mapstructure:"read_timeout"`
	WriteTimeout time.Duration  `json:"write_timeout" mapstructure:"write_timeout"`
	Chains       []common.Chain `json:"chains" mapstructure:"chains"`
}

type SignerConfiguration

type SignerConfiguration struct {
	SignerDbPath  string                    `json:"signer_db_path" mapstructure:"signer_db_path"`
	BlockScanner  BlockScannerConfiguration `json:"block_scanner" mapstructure:"block_scanner"`
	RetryInterval time.Duration             `json:"retry_interval" mapstructure:"retry_interval"`
}

SignerConfiguration all the configures need by signer

type TSSConfiguration

type TSSConfiguration struct {
	BootstrapPeers []string `json:"bootstrap_peers" mapstructure:"bootstrap_peers"`
	Rendezvous     string   `json:"rendezvous" mapstructure:"rendezvous"`
	P2PPort        int      `json:"p2p_port" mapstructure:"p2p_port"`
	InfoAddress    string   `json:"info_address" mapstructure:"info_address"`
	ExternalIP     string   `json:"external_ip" mapstructure:"external_ip"`
}

TSSConfiguration

func (TSSConfiguration) GetBootstrapPeers

func (c TSSConfiguration) GetBootstrapPeers() ([]maddr.Multiaddr, error)

GetBootstrapPeers return the internal bootstrap peers in a slice of maddr.Multiaddr

Jump to

Keyboard shortcuts

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