config

package
v0.0.0-...-7319846 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIOptions

type APIOptions struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

func (*APIOptions) Addr

func (api *APIOptions) Addr() string

type AlgorithmOptions

type AlgorithmOptions struct {
	Name               string `json:"name"`
	Multiplier         int    `json:"multiplier"`
	SHA256dBlockHasher bool   `json:"sha256dBlockHasher"`
}

type BanningOptions

type BanningOptions struct {
	Time           int     `json:"time"`
	InvalidPercent float64 `json:"invalidPercent"`
	CheckThreshold uint64  `json:"checkThreshold"`
	PurgeInterval  int     `json:"purgeInterval"` // unit seconds
}

type CoinOptions

type CoinOptions struct {
	Name       string `json:"name"`
	Symbol     string `json:"symbol"`
	TxMessages bool   `json:"txMessages"`

	// auto-filled from rpc
	Reward        string `json:"reward"`
	NoSubmitBlock bool   `json:"noSubmitBlock"`
	Testnet       bool   `json:"testnet"`
}

type DaemonOptions

type DaemonOptions struct {
	Host     string            `json:"host"`
	Port     int               `json:"port"`
	User     string            `json:"user"`
	Password string            `json:"password"`
	TLS      *TLSClientOptions `json:"tls"`
}

func (*DaemonOptions) String

func (d *DaemonOptions) String() string

func (*DaemonOptions) URL

func (d *DaemonOptions) URL() string

type Options

type Options struct {
	DisablePayment bool         `json:"disablePayment"`
	Coin           *CoinOptions `json:"coin"`

	PoolAddress      *Recipient   `json:"poolAddress"`
	RewardRecipients []*Recipient `json:"rewardRecipients"`

	BlockRefreshInterval   int  `json:"blockRefreshInterval"`
	JobRebroadcastTimeout  int  `json:"jobRebroadcastTimeout"`
	ConnectionTimeout      int  `json:"connectionTimeout"`
	EmitInvalidBlockHashes bool `json:"emitInvalidBlockHashes"`
	TCPProxyProtocol       bool `json:"tcpProxyProtocol"` // http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt

	API       *APIOptions          `json:"api"`
	Banning   *BanningOptions      `json:"banning"`
	Ports     map[int]*PortOptions `json:"ports"`
	Daemons   []*DaemonOptions     `json:"daemons"`
	P2P       *P2POptions          `json:"p2p"`
	Storage   *RedisOptions        `json:"storage"`
	Algorithm *AlgorithmOptions    `json:"algorithm"`
}

func (*Options) TotalFeePercent

func (o *Options) TotalFeePercent() float64

type P2POptions

type P2POptions struct {
	Host                string `json:"host"`
	Port                int    `json:"port"`
	Magic               string `json:"magic"`
	DisableTransactions bool   `json:"disableTransactions"`
}

func (*P2POptions) Addr

func (p2p *P2POptions) Addr() string

type PortOptions

type PortOptions struct {
	Diff    float64           `json:"diff"`
	VarDiff *VarDiffOptions   `json:"varDiff"`
	TLS     *TLSServerOptions `json:"tls"`
}

type Recipient

type Recipient struct {
	Address string  `json:"address"`
	Type    string  `json:"type"`
	Percent float64 `json:"percent"`
	// contains filtered or unexported fields
}

func (*Recipient) GetScript

func (r *Recipient) GetScript() []byte

type RedisOptions

type RedisOptions struct {
	// The network type, either tcp or unix.
	// Default is tcp.
	Network string `json:"network"`

	Host string `json:"host"`
	Port int    `json:"port"`

	Password string `json:"password"`
	DB       int    `json:"db"`

	TLS *TLSClientOptions `json:"tls"`
}

func (*RedisOptions) Addr

func (ro *RedisOptions) Addr() string

func (*RedisOptions) ToRedisOptions

func (ro *RedisOptions) ToRedisOptions() *redis.Options

type TLSClientOptions

type TLSClientOptions struct {
	CertFile string `json:"certFile"`
	KeyFile  string `json:"keyFile"`
}

func (*TLSClientOptions) ToTLSConfig

func (to *TLSClientOptions) ToTLSConfig() *tls.Config

type TLSServerOptions

type TLSServerOptions struct {
	CertFile string `json:"certFile"`
	KeyFile  string `json:"keyFile"`
}

func (*TLSServerOptions) ToTLSConfig

func (to *TLSServerOptions) ToTLSConfig() *tls.Config

type VarDiffOptions

type VarDiffOptions struct {
	MinDiff         float64 `json:"minDiff"`
	MaxDiff         float64 `json:"maxDiff"`
	TargetTime      int64   `json:"targetTime"`
	RetargetTime    int64   `json:"retargetTime"`
	VariancePercent float64 `json:"variancePercent"`
	X2Mode          bool    `json:"x2mode"`
}

Jump to

Keyboard shortcuts

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