Documentation ¶
Index ¶
- type BlockData
- type Config
- type LuckCharts
- type Miner
- type MinerCharts
- type NetCharts
- type PaymentCharts
- type PendingPayment
- type PoolCharts
- type RedisClient
- func (r *RedisClient) BgSave() (string, error)
- func (r *RedisClient) Check() (string, error)
- func (r *RedisClient) Client() *redis.Client
- func (r *RedisClient) CollectBlocks(login string) (map[string]interface{}, error)
- func (r *RedisClient) CollectLuckCharts(max int) (stats []*LuckCharts, err error)
- func (r *RedisClient) CollectLuckStats(windows []int) (map[string]interface{}, error)
- func (r *RedisClient) CollectStats(smallWindow time.Duration, maxBlocks, maxPayments int64) (map[string]interface{}, error)
- func (r *RedisClient) CollectWorkersStats(sWindow, lWindow time.Duration, login string) (map[string]interface{}, error)
- func (r *RedisClient) DeleteOldMinerData() error
- func (r *RedisClient) DeleteOldShareData() error
- func (r *RedisClient) FlushStaleStats(staleDuration, largeWindow time.Duration) (int64, error)
- func (r *RedisClient) GetAllMinerAccount() (account []string, err error)
- func (r *RedisClient) GetBalance(login string) (int64, error)
- func (r *RedisClient) GetBlacklist() ([]string, error)
- func (r *RedisClient) GetCandidates(maxHeight int64) ([]*BlockData, error)
- func (r *RedisClient) GetCurrentHashrate(login string) (int64, error)
- func (r *RedisClient) GetExchangeData(coinsymbol string) (map[string]string, error)
- func (r *RedisClient) GetIP(login string) string
- func (r *RedisClient) GetImmatureBlocks(maxHeight int64) ([]*BlockData, error)
- func (r *RedisClient) GetMailAddress(login string) string
- func (r *RedisClient) GetMinerCharts(hashNum int64, login string) (stats []*MinerCharts, err error)
- func (r *RedisClient) GetMinerStats(login string, maxPayments int64) (map[string]interface{}, error)
- func (r *RedisClient) GetMinerStatsSolo(login string, maxPayments int64) (map[string]interface{}, error)
- func (r *RedisClient) GetMiningType(login string) string
- func (r *RedisClient) GetNetCharts(netHashLen int64) (stats []*NetCharts, err error)
- func (r *RedisClient) GetNetworkDifficulty() (*big.Int, error)
- func (r *RedisClient) GetNodeStates() ([]map[string]interface{}, error)
- func (r *RedisClient) GetPassword(login string) string
- func (r *RedisClient) GetPayees() ([]string, error)
- func (r *RedisClient) GetPaymentCharts(login string) (stats []*PaymentCharts, err error)
- func (r *RedisClient) GetPendingPayments() []*PendingPayment
- func (r *RedisClient) GetPoolCharts(poolHashLen int64) (stats []*PoolCharts, err error)
- func (r *RedisClient) GetRewards(login string) ([]*RewardData, error)
- func (r *RedisClient) GetRoundShares(height int64, nonce string) (map[string]int64, error)
- func (r *RedisClient) GetShareCharts(shareNum int64, login string) (stats []*ShareCharts, err error)
- func (r *RedisClient) GetThreshold(login string) (int64, error)
- func (r *RedisClient) GetTotalShares() (int64, error)
- func (r *RedisClient) GetWhitelist() ([]string, error)
- func (r *RedisClient) GetWorker(login string, worker string) string
- func (r *RedisClient) IsMinerExists(login string) (bool, error)
- func (r *RedisClient) IsPayoutsLocked() (bool, error)
- func (r *RedisClient) LockPayouts(login string, amount int64) error
- func (r *RedisClient) LogIP(login string, ip string)
- func (r *RedisClient) NumberStratumWorker(count int)
- func (r *RedisClient) ResetWorkerShareStatus()
- func (r *RedisClient) RollbackBalance(login string, amount int64) error
- func (r *RedisClient) SetAlert(login string, alert string) (bool, error)
- func (r *RedisClient) SetIP(login string, ip string)
- func (r *RedisClient) SetMailAddress(login string, email string) (bool, error)
- func (r *RedisClient) SetMiningType(login string, miningType string)
- func (r *RedisClient) SetThreshold(login string, threshold int64) (bool, error)
- func (r *RedisClient) SetWorkerWithEmailStatus(login string, worker string, emailSent string)
- func (r *RedisClient) StoreExchangeData(ExchangeData []map[string]interface{})
- func (r *RedisClient) UnlockPayouts() error
- func (r *RedisClient) UpdateBalance(login string, amount int64) error
- func (r *RedisClient) WriteBlock(login, id string, params []string, diff, shareDiffCalc int64, roundDiff int64, ...) (bool, error)
- func (r *RedisClient) WriteBlockSolo(login, id string, params []string, diff, shareDiffCalc int64, roundDiff int64, ...) (bool, error)
- func (r *RedisClient) WriteBlocksFound(ms, ts int64, login, id, share string, diff int64)
- func (r *RedisClient) WriteDiffCharts(time1 int64, time2, netHash string) error
- func (r *RedisClient) WriteImmatureBlock(block *BlockData, roundRewards map[string]int64) error
- func (r *RedisClient) WriteMaturedBlock(block *BlockData, roundRewards map[string]int64) error
- func (r *RedisClient) WriteMinerCharts(time1 int64, time2, k string, hash, largeHash, workerOnline int64) error
- func (r *RedisClient) WriteNodeState(id string, height uint64, diff *big.Int, blocktime float64) error
- func (r *RedisClient) WriteOrphan(block *BlockData) error
- func (r *RedisClient) WritePasswordByMiner(login string, password string)
- func (r *RedisClient) WritePayment(login, txHash string, amount int64, txCharges int64) error
- func (r *RedisClient) WritePendingOrphans(blocks []*BlockData) error
- func (r *RedisClient) WritePoolCharts(time1 int64, time2, poolHash string) error
- func (r *RedisClient) WriteReward(login string, amount int64, percent *big.Rat, immature bool, block *BlockData) error
- func (r *RedisClient) WriteShare(login, id string, params []string, diff int64, shareDiffCalc int64, ...) (bool, error)
- func (r *RedisClient) WriteShareCharts(time1 int64, time2, login string, valid, stale, workerOnline int64) error
- func (r *RedisClient) WriteShareSolo(login, id string, params []string, diff int64, shareDiffCalc int64, ...) (bool, error)
- func (r *RedisClient) WriteWorkerShareStatus(login string, id string, valid bool, stale bool, invalid bool)
- type RewardData
- type ShareCharts
- type SumRewardData
- type TimestampSorter
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockData ¶
type BlockData struct { Height int64 `json:"height"` Timestamp int64 `json:"timestamp"` Difficulty int64 `json:"difficulty"` Uncle bool `json:"uncle"` UncleHeight int64 `json:"uncleHeight"` Orphan bool `json:"orphan"` Hash string `json:"hash"` Finder string `json:"finder"` Worker string `json:"worker"` Nonce string `json:"-"` PowHash string `json:"-"` MixDigest string `json:"-"` Reward *big.Int `json:"-"` ExtraReward *big.Int `json:"-"` ImmatureReward string `json:"-"` RewardString string `json:"reward"` RoundHeight int64 `json:"-"` MiningType string `json:"miningType"` // contains filtered or unexported fields }
func (*BlockData) RewardInShannon ¶
type LuckCharts ¶
type MinerCharts ¶
type PaymentCharts ¶
type PendingPayment ¶
type PoolCharts ¶
type RedisClient ¶
type RedisClient struct { CoinName string // contains filtered or unexported fields }
func NewRedisClient ¶
func (*RedisClient) BgSave ¶
func (r *RedisClient) BgSave() (string, error)
func (*RedisClient) Check ¶
func (r *RedisClient) Check() (string, error)
func (*RedisClient) Client ¶
func (r *RedisClient) Client() *redis.Client
func (*RedisClient) CollectBlocks ¶ added in v1.0.5
func (r *RedisClient) CollectBlocks(login string) (map[string]interface{}, error)
func (*RedisClient) CollectLuckCharts ¶
func (r *RedisClient) CollectLuckCharts(max int) (stats []*LuckCharts, err error)
func (*RedisClient) CollectLuckStats ¶
func (r *RedisClient) CollectLuckStats(windows []int) (map[string]interface{}, error)
func (*RedisClient) CollectStats ¶
func (*RedisClient) CollectWorkersStats ¶
func (*RedisClient) DeleteOldMinerData ¶
func (r *RedisClient) DeleteOldMinerData() error
DeleteOldMinerData deletes old miner data from the "miner" ZSets. All entries that are older than 24 hours are removed.
func (*RedisClient) DeleteOldShareData ¶
func (r *RedisClient) DeleteOldShareData() error
DeleteOldShareData deletes old share data from the "share" ZSets. All entries that are older than 24 hours are removed.
func (*RedisClient) FlushStaleStats ¶
func (r *RedisClient) FlushStaleStats(staleDuration, largeWindow time.Duration) (int64, error)
FlushStaleStats deletes all stale statistics in Redis. window defines the duration after which the statistics become stale. largeWindow defines the duration after which the statistics are permanently deleted.
func (*RedisClient) GetAllMinerAccount ¶
func (r *RedisClient) GetAllMinerAccount() (account []string, err error)
func (*RedisClient) GetBalance ¶
func (r *RedisClient) GetBalance(login string) (int64, error)
func (*RedisClient) GetBlacklist ¶
func (r *RedisClient) GetBlacklist() ([]string, error)
Always returns list of addresses. If Redis fails it will return empty list.
func (*RedisClient) GetCandidates ¶
func (r *RedisClient) GetCandidates(maxHeight int64) ([]*BlockData, error)
func (*RedisClient) GetCurrentHashrate ¶
func (r *RedisClient) GetCurrentHashrate(login string) (int64, error)
func (*RedisClient) GetExchangeData ¶
func (r *RedisClient) GetExchangeData(coinsymbol string) (map[string]string, error)
func (*RedisClient) GetIP ¶
func (r *RedisClient) GetIP(login string) string
func (*RedisClient) GetImmatureBlocks ¶
func (r *RedisClient) GetImmatureBlocks(maxHeight int64) ([]*BlockData, error)
func (*RedisClient) GetMailAddress ¶ added in v1.0.5
func (r *RedisClient) GetMailAddress(login string) string
func (*RedisClient) GetMinerCharts ¶
func (r *RedisClient) GetMinerCharts(hashNum int64, login string) (stats []*MinerCharts, err error)
func (*RedisClient) GetMinerStats ¶
func (r *RedisClient) GetMinerStats(login string, maxPayments int64) (map[string]interface{}, error)
func (*RedisClient) GetMinerStatsSolo ¶ added in v1.0.5
func (r *RedisClient) GetMinerStatsSolo(login string, maxPayments int64) (map[string]interface{}, error)
func (*RedisClient) GetMiningType ¶ added in v1.0.5
func (r *RedisClient) GetMiningType(login string) string
func (*RedisClient) GetNetCharts ¶
func (r *RedisClient) GetNetCharts(netHashLen int64) (stats []*NetCharts, err error)
func (*RedisClient) GetNetworkDifficulty ¶ added in v1.0.5
func (r *RedisClient) GetNetworkDifficulty() (*big.Int, error)
func (*RedisClient) GetNodeStates ¶
func (r *RedisClient) GetNodeStates() ([]map[string]interface{}, error)
func (*RedisClient) GetPassword ¶ added in v1.0.5
func (r *RedisClient) GetPassword(login string) string
func (*RedisClient) GetPayees ¶
func (r *RedisClient) GetPayees() ([]string, error)
func (*RedisClient) GetPaymentCharts ¶
func (r *RedisClient) GetPaymentCharts(login string) (stats []*PaymentCharts, err error)
func (*RedisClient) GetPendingPayments ¶
func (r *RedisClient) GetPendingPayments() []*PendingPayment
func (*RedisClient) GetPoolCharts ¶
func (r *RedisClient) GetPoolCharts(poolHashLen int64) (stats []*PoolCharts, err error)
func (*RedisClient) GetRewards ¶
func (r *RedisClient) GetRewards(login string) ([]*RewardData, error)
func (*RedisClient) GetRoundShares ¶
func (*RedisClient) GetShareCharts ¶
func (r *RedisClient) GetShareCharts(shareNum int64, login string) (stats []*ShareCharts, err error)
func (*RedisClient) GetThreshold ¶
func (r *RedisClient) GetThreshold(login string) (int64, error)
func (*RedisClient) GetTotalShares ¶
func (r *RedisClient) GetTotalShares() (int64, error)
func (*RedisClient) GetWhitelist ¶
func (r *RedisClient) GetWhitelist() ([]string, error)
Always returns list of IPs. If Redis fails it will return empty list.
func (*RedisClient) GetWorker ¶ added in v1.0.5
func (r *RedisClient) GetWorker(login string, worker string) string
func (*RedisClient) IsMinerExists ¶
func (r *RedisClient) IsMinerExists(login string) (bool, error)
func (*RedisClient) IsPayoutsLocked ¶
func (r *RedisClient) IsPayoutsLocked() (bool, error)
func (*RedisClient) LockPayouts ¶
func (r *RedisClient) LockPayouts(login string, amount int64) error
func (*RedisClient) LogIP ¶
func (r *RedisClient) LogIP(login string, ip string)
func (*RedisClient) NumberStratumWorker ¶
func (r *RedisClient) NumberStratumWorker(count int)
func (*RedisClient) ResetWorkerShareStatus ¶
func (r *RedisClient) ResetWorkerShareStatus()
Need a function to delete on round end or whatever, and another function to get.
func (*RedisClient) RollbackBalance ¶
func (r *RedisClient) RollbackBalance(login string, amount int64) error
func (*RedisClient) SetAlert ¶ added in v1.0.5
func (r *RedisClient) SetAlert(login string, alert string) (bool, error)
func (*RedisClient) SetIP ¶
func (r *RedisClient) SetIP(login string, ip string)
func (*RedisClient) SetMailAddress ¶ added in v1.0.5
func (r *RedisClient) SetMailAddress(login string, email string) (bool, error)
func (*RedisClient) SetMiningType ¶ added in v1.0.5
func (r *RedisClient) SetMiningType(login string, miningType string)
func (*RedisClient) SetThreshold ¶
func (r *RedisClient) SetThreshold(login string, threshold int64) (bool, error)
func (*RedisClient) SetWorkerWithEmailStatus ¶ added in v1.0.5
func (r *RedisClient) SetWorkerWithEmailStatus(login string, worker string, emailSent string)
func (*RedisClient) StoreExchangeData ¶
func (r *RedisClient) StoreExchangeData(ExchangeData []map[string]interface{})
func (*RedisClient) UnlockPayouts ¶
func (r *RedisClient) UnlockPayouts() error
func (*RedisClient) UpdateBalance ¶
func (r *RedisClient) UpdateBalance(login string, amount int64) error
Deduct miner's balance for payment
func (*RedisClient) WriteBlock ¶
func (*RedisClient) WriteBlockSolo ¶ added in v1.0.5
func (*RedisClient) WriteBlocksFound ¶
func (r *RedisClient) WriteBlocksFound(ms, ts int64, login, id, share string, diff int64)
func (*RedisClient) WriteDiffCharts ¶
func (r *RedisClient) WriteDiffCharts(time1 int64, time2, netHash string) error
func (*RedisClient) WriteImmatureBlock ¶
func (r *RedisClient) WriteImmatureBlock(block *BlockData, roundRewards map[string]int64) error
func (*RedisClient) WriteMaturedBlock ¶
func (r *RedisClient) WriteMaturedBlock(block *BlockData, roundRewards map[string]int64) error
func (*RedisClient) WriteMinerCharts ¶
func (r *RedisClient) WriteMinerCharts(time1 int64, time2, k string, hash, largeHash, workerOnline int64) error
func (*RedisClient) WriteNodeState ¶
func (*RedisClient) WriteOrphan ¶
func (r *RedisClient) WriteOrphan(block *BlockData) error
func (*RedisClient) WritePasswordByMiner ¶ added in v1.0.5
func (r *RedisClient) WritePasswordByMiner(login string, password string)
func (*RedisClient) WritePayment ¶
func (r *RedisClient) WritePayment(login, txHash string, amount int64, txCharges int64) error
func (*RedisClient) WritePendingOrphans ¶
func (r *RedisClient) WritePendingOrphans(blocks []*BlockData) error
func (*RedisClient) WritePoolCharts ¶
func (r *RedisClient) WritePoolCharts(time1 int64, time2, poolHash string) error
func (*RedisClient) WriteReward ¶
func (*RedisClient) WriteShare ¶
func (*RedisClient) WriteShareCharts ¶
func (r *RedisClient) WriteShareCharts(time1 int64, time2, login string, valid, stale, workerOnline int64) error
func (*RedisClient) WriteShareSolo ¶ added in v1.0.5
func (*RedisClient) WriteWorkerShareStatus ¶
func (r *RedisClient) WriteWorkerShareStatus(login string, id string, valid bool, stale bool, invalid bool)
lets try to fuck without understanding and see if it works
type RewardData ¶
type ShareCharts ¶
type ShareCharts struct {}
type SumRewardData ¶
type TimestampSorter ¶
type TimestampSorter []*LuckCharts
func (TimestampSorter) Len ¶
func (a TimestampSorter) Len() int
func (TimestampSorter) Less ¶
func (a TimestampSorter) Less(i, j int) bool
func (TimestampSorter) Swap ¶
func (a TimestampSorter) Swap(i, j int)
type Worker ¶
type Worker struct { Miner TotalHR int64 `json:"hr2"` PortDiff string `json:"portDiff"` WorkerHostname string `json:"hostname"` ValidPercent float64 `json:"v_per"` StalePercent float64 `json:"s_per"` InvalidPercent float64 `json:"i_per"` WorkerStatus int64 `json:"w_stat"` WorkerStatushas int64 `json:"w_stat_s"` }