Documentation ¶
Index ¶
- type BlockData
- type Config
- type Miner
- type PendingPayment
- type RedisClient
- func (r *RedisClient) AdjustCurrentNShares(diff int64) (bool, error)
- func (r *RedisClient) BgSave() (string, error)
- func (r *RedisClient) Check() (string, error)
- func (r *RedisClient) Client() *redis.Client
- 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) CreateNewNValue(shareDiff int64) (int64, error)
- func (r *RedisClient) FlushStaleStats(window, largeWindow time.Duration) (int64, 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) GetExchangeData(coinsymbol string) (map[string]string, error)
- func (r *RedisClient) GetImmatureBlocks(maxHeight int64) ([]*BlockData, error)
- func (r *RedisClient) GetLastNValue() (int64, error)
- func (r *RedisClient) GetMinerStats(login string, maxPayments int64) (map[string]interface{}, error)
- func (r *RedisClient) GetNetworkDifficulty() (*big.Int, error)
- func (r *RedisClient) GetNetworkDifficultyForCurrentShareDifficulty(sharediff int64) (int64, error)
- func (r *RedisClient) GetNodeStates() ([]map[string]interface{}, error)
- func (r *RedisClient) GetPayees() ([]string, error)
- func (r *RedisClient) GetPendingPayments() []*PendingPayment
- func (r *RedisClient) GetRewards(login string) ([]*RewardData, error)
- func (r *RedisClient) GetRoundShares(height int64, nonce string) (map[string]int64, error)
- func (r *RedisClient) GetThreshold(login string) (int64, error)
- func (r *RedisClient) GetTotalShares() (int64, error)
- func (r *RedisClient) GetWhitelist() ([]string, error)
- 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) RollbackBalance(login string, amount int64) error
- func (r *RedisClient) SetThreshold(login string, threshold int64) (bool, error)
- func (r *RedisClient) StoreExchangeData(ExchangeData []map[string]string)
- func (r *RedisClient) UnlockPayouts() error
- func (r *RedisClient) UpdateBalance(login string, amount int64) error
- func (r *RedisClient) WriteBlock(login, id string, params []string, diff, roundDiff int64, height uint64, ...) (bool, 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) WriteNodeState(id string, height uint64, diff *big.Int) error
- func (r *RedisClient) WriteOrphan(block *BlockData) error
- func (r *RedisClient) WritePayment(login, txHash string, amount int64, txCharges int64) error
- func (r *RedisClient) WritePendingOrphans(blocks []*BlockData) 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, height uint64, ...) (bool, error)
- type RewardData
- type SumRewardData
- 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"` 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:"-"` // contains filtered or unexported fields }
func (*BlockData) RewardInShannon ¶
type PendingPayment ¶
type RedisClient ¶
type RedisClient struct { CoinName string // contains filtered or unexported fields }
func NewRedisClient ¶
func NewRedisClient(cfg *Config, prefix string, pplns int64, CoinName string) *RedisClient
func (*RedisClient) AdjustCurrentNShares ¶
func (r *RedisClient) AdjustCurrentNShares(diff int64) (bool, error)
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) CollectLuckStats ¶
func (r *RedisClient) CollectLuckStats(windows []int) (map[string]interface{}, error)
func (*RedisClient) CollectStats ¶
func (*RedisClient) CollectWorkersStats ¶
func (*RedisClient) CreateNewNValue ¶
func (r *RedisClient) CreateNewNValue(shareDiff int64) (int64, error)
func (*RedisClient) FlushStaleStats ¶
func (r *RedisClient) FlushStaleStats(window, largeWindow time.Duration) (int64, error)
WARNING: Must run it periodically to flush out of window hashrate entries
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) GetExchangeData ¶
func (r *RedisClient) GetExchangeData(coinsymbol string) (map[string]string, error)
func (*RedisClient) GetImmatureBlocks ¶
func (r *RedisClient) GetImmatureBlocks(maxHeight int64) ([]*BlockData, error)
func (*RedisClient) GetLastNValue ¶
func (r *RedisClient) GetLastNValue() (int64, error)
func (*RedisClient) GetMinerStats ¶
func (r *RedisClient) GetMinerStats(login string, maxPayments int64) (map[string]interface{}, error)
func (*RedisClient) GetNetworkDifficulty ¶
func (r *RedisClient) GetNetworkDifficulty() (*big.Int, error)
func (*RedisClient) GetNetworkDifficultyForCurrentShareDifficulty ¶
func (r *RedisClient) GetNetworkDifficultyForCurrentShareDifficulty(sharediff int64) (int64, error)
func (*RedisClient) GetNodeStates ¶
func (r *RedisClient) GetNodeStates() ([]map[string]interface{}, error)
func (*RedisClient) GetPayees ¶
func (r *RedisClient) GetPayees() ([]string, error)
func (*RedisClient) GetPendingPayments ¶
func (r *RedisClient) GetPendingPayments() []*PendingPayment
func (*RedisClient) GetRewards ¶
func (r *RedisClient) GetRewards(login string) ([]*RewardData, error)
func (*RedisClient) GetRoundShares ¶
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) 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) RollbackBalance ¶
func (r *RedisClient) RollbackBalance(login string, amount int64) error
func (*RedisClient) SetThreshold ¶
func (r *RedisClient) SetThreshold(login string, threshold int64) (bool, error)
func (*RedisClient) StoreExchangeData ¶
func (r *RedisClient) StoreExchangeData(ExchangeData []map[string]string)
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) 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) WriteNodeState ¶
func (*RedisClient) WriteOrphan ¶
func (r *RedisClient) WriteOrphan(block *BlockData) error
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) WriteReward ¶
type RewardData ¶
type SumRewardData ¶
Click to show internal directories.
Click to hide internal directories.