-
Notifications
You must be signed in to change notification settings - Fork 1
/
db_schema.dbml
198 lines (198 loc) · 4.9 KB
/
db_schema.dbml
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
Project HeliumDewiETL {
database_type: 'PostgreSQL'
Note: '''
# Helium Blockchain Database on DeWi
**This document provides relations between different helium blockchain tables on DeWi database server**
'''
}
Table gateway_inventory as g {
address text [pk]
owner text
location text
last_poc_challenge bigint [ref: > b.height]
last_poc_onion_key_hash text
witnesses jsonb
first_block bigint [ref: > b.height]
last_block bigint [ref: > b.height]
nonce bigint
name text
first_timestamp timestamp
reward_scale double_precision
elevation integer
gain integer
location_hex text
mode text
note: "table 'gateway_inventory' contains information about nodes on Helium Blockchain"
}
Table gateway_status {
address text [pk]
online text [note: 'Provides Offline vs Online status']
block bigint [ref: > b.height]
updated_at timestamp
poc_interval bigint
last_challenge bigint [ref: > b.height]
peer_timestamp timestamp
listen_addrs jsonb
note: "table 'gateway_status' contains status info about nodes"
}
Table gateways {
block bigint [pk]
address text [pk]
owner text [ref: > a.address]
location text
last_poc_challenge bigint [ref: > b.height]
last_poc_onion_key_hash text
witnesses jsonb
nonce bigint
name text
"time" bigint
reward_scale double_precision
elevation integer
gain integer
location_hex text
mode gateway_mode
note: "node full history"
}
Table locations as l {
location text [pk]
long_street text
short_street text
long_city text
short_city text
long_state text
short_state text
long_country text
short_country text
search_city text
city_id text
geometry geometry
note: "table 'locations' contains street level address for asserted node"
}
Table rewards {
block bigint [ref: > b.height]
transaction_hash text [ref: > t.hash]
time bigint
account text [ref: > a.address]
gateway text [ref: > g.address]
amount bigint [note: 'Represented in bones, divide by 100000000 to get HNT']
note: "Rewards for node"
}
Table account_inventory as a {
address text [pk]
balance bigint
nonce bigint
dc_balance bigint
dc_nonce bigint
security_balance bigint
security_nonce bigint
first_block bigint [ref: > b.height]
last_block bigint [ref: > b.height]
staked_balance bigint
note: "table 'account_inventory' contains information about accounts/wallets on Helium Blockchain"
}
Table accounts {
block bigint [pk]
address text [pk]
dc_balance bigint
dc_nonce bigint
security_balance bigint
security_nonce bigint
balance bigint
nonce bigint
staked_balance bigint
note: "account/wallet full history"
}
Table block_signatures {
block bigint [pk]
signer text [pk]
signature text
}
Table blocks as b {
height bigint [pk]
"time" bigint
"timestamp" timestamp
prev_hash text
block_hash text
transaction_count integer
hbbft_round bigint
election_epoch bigint
epoch_start bigint
rescue_signature text
snapshot_hash text
created_at timestamp
}
Table challenge_receipts_parsed {
block bigint [ref: > b.height]
hash text
"time" timestamp
transmitter_name text
transmitter_address text [ref: > g.address]
origin text
witness_owner text [ref: > a.address]
witness_name text
witness_gateway text [ref: > g.address]
witness_is_valid text
witness_invalid_reason text
witness_signal text
witness_snr text
witness_channel text
witness_datarate text
witness_frequency text
witness_location text
witness_timestamp text
note: 'Unpacked POC information'
}
Table dc_burns {
block bigint [ref: > b.height]
transaction_hash text [pk]
actor text [pk]
type burn_type [pk]
amount bigint
oracle_price bigint
"time" bigint
}
Table oracle_inventory {
address text [ref: > a.address]
note: "Oracles addresses"
}
Table oracle_prices {
block bigint [pk]
price bigint [note: 'Divide by 100000000 to get USD value']
note: "Oracle price history"
}
Table packets {
block bigint [pk]
transaction_hash text [pk]
"time" bigint
gateway text [pk]
num_packets bigint
num_dcs bigint
note: "Information about packet transferred thru nodes"
}
Table transaction_actors {
actor text [ref: > g.address]
actor_role transaction_actor_role
transaction_hash text [ref: > t.hash]
block bigint [ref: > b.height]
}
Table transactions as t {
block bigint [ref: > b.height]
hash text [pk]
type transaction_type
fields jsonb [note: 'Json data for all transaction related information']
"time" bigint
}
Ref: gateway_status.address - g.address
Ref: l.location - g.location
Ref: l.location - gateways.location
Ref: gateways.block > b.height
Ref: gateways.address > g.address
Ref: block_signatures.block > b.height
Ref: dc_burns.transaction_hash > t.hash
Ref: dc_burns.actor > a.address
Ref: oracle_prices.block > b.height
Ref: packets.block > b.height
Ref: accounts.block > b.height
Ref: accounts.address > a.address
Ref: packets.transaction_hash > t.hash
Ref: packets.gateway > g.address