-
Notifications
You must be signed in to change notification settings - Fork 5
/
store.txt
65 lines (47 loc) · 3.81 KB
/
store.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
hashrate rank : SortedHashrate : sortedset , util/sorted_hashrate.go
two sortedsets, switch every 15 minutes. reserve current set as last set, make a new current set.
key: miner's address, value: diff, accumulated when valid share found(miner.go: processShare->WriteBlock) .
get miners hashrate rank from last set.
share exist : whether a share had been submitted before, util/share.go
two sets(map with empty struct value). switch every 15 minutes. reserve current set as last set, make a new current set.
key: miner's address+share params, stored when valid share found(miner.go: processShare->WriteBlock) .
check existence,when valid share found (miner.go: processShare->WriteBlock)
redis zset store min rxhash of a job
key: "mini" + job hash, Z: (score : high 8 bytes of rxhash as uint64, member: miner address)
add score into zset and delete all bigger score members, when valid share found.(miner.go: processShare->WriteBlock)
compare current share's rxhash and min rxhash in zset , submit current share when it is smaller.(miner.go: processShare)
redis set store jobs(win, lost ,waiting)
key: "waiting" , values: jobHashes that pool waiting for result
key: "win", values: jobHashes that pool winned reward
key: "lost", values: jobHashes that pool failed reward
redis set store submitted shares
key: "submit" +jobHash , values: submitted shares
redis hash store a miner's accumulated diff of a job
HIncrBy(ctx, r.formatKey("job",jobHash), login, diff) (miner.go: processShare->WriteBlock)
redis hash store a pool's accumulated diff of a job
HIncrBy(ctx, r.formatKey("pool", jobHash), "diff", diff) (miner.go: processShare->WriteBlock)
redis zset store pool rewards list from xdaxj (ts -> timestamp)(int64, [real value] * 1e9)
key: "pool" + "rewards", Z:{Score: float64(ts), Member: join(reword, ms, txHash, jobHash, fee, share)}
redis zset store rewards list of a task (ts -> timestamp)(int64, [real value] * 1e9)
key: "rewards" + joHash, Z:{Score: float64(ts), Member: join(reword, ms, miner, txHash)}
redis hash store a pool's total rewards from xdagj(int64, [real value] * 1e9)
key: "pool" + "account", field: "rewards", value: total rewards from xdagj
redis hash store a pool's total payment to miners(int64, [real value] * 1e9)
key: "pool" + "account", field: "payment", value: total payment to miners
redis hash store a pool's total unpaid rewards(int64, [real value] * 1e9)
key: "pool" + "account", field: "unpaid", value: total unpaid
redis hash store a pool's total donate (int64, [real value] * 1e9)
key: "pool" + "account", field: "donate", value: total donate
redis zset store pool donate list of a task (ts -> timestamp)(int64, [real value] * 1e9)
key: "pool" + "donate", Z:{Score: float64(ts), Member: join(reward.Donate, ms, reward.PreHash, reward.DonateBlock)}
redis hash store miners balance (int64, [real value] * 1e9) (miner.go: processShare->WriteBlock)
key: "account" + miner address, field: "reward", value: total reward to miner
key: "account" + miner address, field: "unpaid", value: total unpaid amount
key: "account" + miner address, field: "payment", value: total paid amount
redis zset store rewards list to a miner (ts -> timestamp)(int64, [real value] * 1e9)
key: "rewards" + miner address, Z:{Score: float64(ts), Member: join(reword, ms, jobHash, remark, mode)}
redis zset store payment list to a miner (ts -> timestamp)(int64, [real value] * 1e9)
key: "payment" + miner address, Z:{Score: float64(ts), Member: join(payment, ms, txHash, remark)}
redis zset store balance changing list of a miner (ts -> timestamp)(int64, [real value] * 1e9)
key: "balance" + miner address, Z:{Score: float64(ts), Member: join("payment", payment, ms, txHash, remark)}
key: "balance" + miner address, Z:{Score: float64(ts), Member: join("reward", reward, ms, txHash, remark)}