Documentation ¶
Index ¶
- Constants
- Variables
- func BlockBitsToTarget(bits string, width int) []byte
- func CheckBase58Addr(addr, network string, p *params.Params) bool
- func ConvertLogLevel(level string) l.Lvl
- func DiffToTarget(diff float64, powLimit *big.Int, powType pow.PowType) (*big.Int, error)
- func FormatHashRate(h float64, unit string) string
- func GetCurrentDir() string
- func GetNeedHashTimesByTarget(target string) *big.Int
- func GetVersion() string
- func InArray(val interface{}, arr interface{}) bool
- func InitNet(network string, p *params.Params) *params.Params
- func Int2lehex(x int64, width int) string
- func Int2varinthex(x int64) string
- func RandUint64() uint64
- func Reverse(src []byte) []byte
- func ReverseByWidth(s []byte, width int) []byte
- func String() string
- func Timeout(fun func(), t int64, callBack func())
- func UpdateSysTime()
- func UpdateSystemDate(dateTime string) bool
- func UseLogger(logger log.Logger)
- func Usleep(sec int)
- type CommandConfig
- type FileConfig
- type GlobalConfig
- type NecessaryConfig
- type OptionalConfig
- type PoolConfig
- type SoloConfig
Constants ¶
const ( Major uint = 1 Minor uint = 0 Patch uint = 1 )
These constants define the application version and follow the semantic versioning 2.0.0 spec (http://semver.org/).
const (
CoinBaseVersion = "0.10.3"
)
Variables ¶
var ( // PreRelease is defined as a variable so it can be overridden during // the build process with '-ldflags "-X github.com/Qitmeer/qitmeer/version.PreRelease=foo"' if // needed. It MUST only contain characters from semanticAlphabet per // the semantic versioning spec. PreRelease = "" // appBuild is defined as a variable so it can be overridden during the // build process with '-ldflags "-X github.com/Qitmeer/qitmeer/version.Build=foo"' if needed. It // MUST only contain characters from semanticBuildAlphabet per the // semantic versioning spec. Build = "dev" )
var CurrentHeight = uint64(0)
var JobID = ""
var LatestGBTID = int64(0)
var MinerLoger log.Logger
log is a logger that is initialized with no output filters. This means the package will not perform any logging by default until the caller requests it.
Functions ¶
func BlockBitsToTarget ¶
func ConvertLogLevel ¶
func DiffToTarget ¶
func FormatHashRate ¶
FormatHashRate sets the units properly when displaying a hashrate.
func GetCurrentDir ¶
func GetCurrentDir() string
func GetVersion ¶
func GetVersion() string
func Int2varinthex ¶
func RandUint64 ¶
func RandUint64() uint64
func ReverseByWidth ¶
func String ¶
func String() string
version returns the application version as a properly formed string per the semantic versioning 2.0.0 spec (http://semver.org/).
func UpdateSysTime ¶
func UpdateSysTime()
func UpdateSystemDate ¶
Types ¶
type CommandConfig ¶
type FileConfig ¶
type GlobalConfig ¶
type GlobalConfig struct { OptionConfig OptionalConfig LogConfig FileConfig DeviceConfig CommandConfig SoloConfig SoloConfig PoolConfig PoolConfig NecessaryConfig NecessaryConfig }
func LoadConfig ¶
func LoadConfig() (*GlobalConfig, []string, error)
loadConfig initializes and parses the config using a config file and command line options.
The configuration proceeds as follows:
- Start with a default config with sane settings
- Pre-parse the command line to check for an alternative config file
- Load configuration file overwriting defaults with any specified options
- Parse CLI options and overwrite/add any specified options
The above results in btcd functioning properly without any config settings while still allowing the user to override settings with config files and command line options. Command line options always take precedence.
type NecessaryConfig ¶
type NecessaryConfig struct { // Config / log options Pow string `short:"P" long:"pow" description:"blake2bd|cuckaroo|cuckatoo"` Symbol string `short:"S" long:"symbol" description:"Symbol" default-mask:"PMEER"` NetWork string `short:"N" long:"network" description:"network privnet|testnet|mainnet" default-mask:"testnet"` Param *params.Params }
type OptionalConfig ¶
type OptionalConfig struct { // Config / log options CPUMiner bool `long:"cpuminer" description:"CPUMiner" default-mask:"false"` CpuWorkers int `long:"cpuworkers" description:"CPUWorkers" default-mask:"1"` Proxy string `long:"proxy" description:"Connect via SOCKS5 proxy (eg. 127.0.0.1:9050)"` ProxyUser string `long:"proxyuser" description:"Username for proxy server"` ProxyPass string `long:"proxypass" default-mask:"-" description:"Password for proxy server"` Timeout int `long:"timeout" description:"rpc timeout." default-mask:"60"` UseDevices string `` /* 132-byte string literal not displayed */ MaxTxCount int `long:"max_tx_count" description:"max pack tx count" default-mask:"10000000"` MaxSigCount int `long:"max_sig_count" description:"max sign tx count" default-mask:"400000000"` LogLevel string `long:"log_level" description:"info|debug|error|warn|trace" default-mask:"info"` StatsServer string `long:"stats_server" description:"stats web server" default-mask:"127.0.0.1:1235"` Restart int ` description:"restart server" default-mask:"0"` Accept int ` description:"Accept count" default-mask:"0"` Reject int ` description:"Reject count" default-mask:"0"` Stale int ` description:"Stale count" default-mask:"0"` Target string ` description:"Target"` NumOfChips int `long:"num_of_chips" description:"num of chips" default-mask:"1"` TaskInterval int `long:"task_interval" description:"get blocktemplate interval" default-mask:"5000"` TaskForceStop bool `` /* 149-byte string literal not displayed */ ForceSolo bool `long:"force_solo" description:"force solo mining" default-mask:"false"` Freqs string `long:"freqs" description:"freq settings" default-mask:"1000,200|"` BaseDiff uint `long:"base_diff" description:"base_diff settings,default 4G" default-mask:"224"` UartPath string `long:"uart_path" description:"uarts path split with ," default-mask:"/dev/ttyS1"` WindowSize int `long:"windowsize" description:"windows size" default-mask:"10"` BlockPerTime int `long:"blockpertime" description:"block per time" default-mask:"1"` EnableTxConfirm bool `long:"enabletxconfirm" description:"enable tx confirm notification" default-mask:"false"` }
type PoolConfig ¶
type PoolConfig struct { // Pool related options Pool string `short:"o" long:"pool" description:"Pool to connect to (e.g.stratum+tcp://pool:port)"` PoolUser string `short:"m" long:"pooluser" description:"Pool username"` PoolTLS bool `long:"pooltls" default-mask:"-" description:"Pool tls"` SkipTLSCERT bool `long:"skiptlscert" default-mask:"-" description:"skip pool tls cert"` PoolPassword string `short:"n" long:"poolpass" default-mask:"-" description:"Pool password"` }
type SoloConfig ¶
type SoloConfig struct { // RPC connection options MinerAddr string `short:"M" long:"mineraddress" description:"Miner Address" default-mask:""` RPCServer string `short:"s" long:"rpcserver" description:"RPC server to connect to"` RPCUser string `short:"u" long:"rpcuser" description:"RPC username"` RPCPassword string `short:"p" long:"rpcpass" default-mask:"-" description:"RPC password"` RandStr string `long:"randstr" description:"Rand String,Your Unique Marking." default-mask:""` NoTLS bool `long:"notls" description:"Do not verify tls certificates" default-mask:"true"` RPCCert string `long:"rpccert" description:"RPC server certificate chain for validation"` ConfirmHeight uint64 `long:"confirmheight" description:"min confirm height" default-mask:"3"` NotConfirmHeight uint64 `long:"notconfirmheight" description:"min confirm height" default-mask:"50000000"` }