Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultDisputeThreshold = 0.01
threshold, a percentage of the expected value
View Source
const DefaultMaxCheckTimeDelta = 5 * time.Minute
View Source
const PrivateKeyEnvName = "ETH_PRIVATE_KEY"
Variables ¶
This section is empty.
Functions ¶
func ParseConfigBytes ¶
Types ¶
type Config ¶
type Config struct { ContractAddress string `json:"contractAddress"` NodeURL string `json:"nodeURL"` DatabaseURL string `json:"databaseURL"` PublicAddress string `json:"publicAddress"` EthClientTimeout uint `json:"ethClientTimeout"` TrackerSleepCycle Duration `json:"trackerCycle"` Trackers []string `json:"trackers"` DBFile string `json:"dbFile"` ServerHost string `json:"serverHost"` ServerPort uint `json:"serverPort"` FetchTimeout Duration `json:"fetchTimeout"` RequestData uint `json:"requestData"` MinConfidence float64 `json:"minConfidence"` RequestDataInterval Duration `json:"requestDataInterval"` RequestTips int64 `json:"requestTips"` MiningInterruptCheckInterval Duration `json:"miningInterruptCheckInterval"` GasMultiplier float32 `json:"gasMultiplier"` GasMax uint `json:"gasMax"` NumProcessors int `json:"numProcessors"` Heartbeat Duration `json:"heartbeat"` ServerWhitelist []string `json:"serverWhitelist"` GPUConfig map[string]*GPUConfig `json:"gpuConfig"` EnablePoolWorker bool `json:"enablePoolWorker"` Worker string `json:"worker"` Password string `json:"password"` PoolURL string `json:"poolURL"` IndexFolder string `json:"indexFolder"` DisputeTimeDelta Duration `json:"disputeTimeDelta"` //ignore data further than this away from the value we are checking DisputeThreshold float64 `json:"disputeThreshold"` //maximum allowed relative difference between observed and submitted value //config parameters excluded from the json config file PrivateKey string `json:"privateKey"` }
Config holds global config info derived from config.json
type Duration ¶
unfortunate hack to enable json parsing of human readable time strings see https://github.com/golang/go/issues/10275 code from https://stackoverflow.com/questions/48050945/how-to-unmarshal-json-into-durations
func (*Duration) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.