-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev_notes.txt
31 lines (24 loc) · 961 Bytes
/
dev_notes.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
Project URLs are standardized with commmon.standardize_project_url
REDIS database structure is below.
RAC:MAG ratios:
standardized_url'_rac_mag_ratio':str
Required credits: (dict stored as json)
standardized_url+'_required_credits':str
Banned users from specific projects:
banned_uids_standardized_url={uid1:str,uid2:str...}
Banned CPIDs across all projects:
banned_cpids={cpid1:str,cpid2:str,etc}
User lookup table. Note that UIDs with RAC <1 don't appear here.
uid_table_standardizedurl={'uid1':User,'uid2':User...}
User object is just a dict which has been encoded to a JSON string. So to read it from redis, we need to decode it. The dict has the following structure:
{
cpid:str=cpid,
expavg_credit:str=expavg_credit (RAC, floating value)
create_time:str=create_time (UNIX epoch time)
total_credit:str=total_credit
}
Single vars we track:
# of times faucet has sent out a tx
total_dispensed:float
# total value of those txes
total_grc_dispensed:float