Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
707810c
Add python backend
Andrew-Pohl Feb 23, 2023
8921563
update ui
Feb 23, 2023
b6aff89
Feedback modal - correct button position
Feb 25, 2023
ac7def7
add missing column, tooltip
Feb 27, 2023
baacf20
update node table
Feb 27, 2023
3bee284
Show Good/Bad instead of */Bad
Feb 27, 2023
49eb87c
Reduce location min width
baotrunguit Feb 28, 2023
d943dae
Merge pull request #3 from fiberblock/main
Andrew-Pohl Feb 28, 2023
2af05c2
fixed false reporting of rpc and bifrost health
Andrew-Pohl Feb 28, 2023
d30190b
update readme
Andrew-Pohl Feb 28, 2023
96cbeaf
update comments
Andrew-Pohl Feb 28, 2023
7caefc8
add leave column, table item per page, update table
Mar 1, 2023
d93beda
update table
Mar 3, 2023
2249486
adjust nodes per page border
Mar 3, 2023
05cbba3
correct no data message
Mar 3, 2023
bb96fde
Merge branch 'main' of https://github.com/liquify-validation/thornode…
baotrunguit Mar 6, 2023
b90621e
Merge pull request #4 from fiberblock/main
Andrew-Pohl Mar 7, 2023
6c06a28
Revert back to * for Good, fixed bug in DB cleanup
Andrew-Pohl Mar 7, 2023
8f8b07c
Update table UI
Mar 10, 2023
1158181
Update table UI
Mar 10, 2023
0e3f957
Update table UI - limit width of number column
Mar 10, 2023
3669097
Update table UI - add a line betwwen last row and the pagination
Mar 10, 2023
9b12cbc
Merge pull request #5 from fiberblock/main
Andrew-Pohl Mar 13, 2023
34740b3
Table updates
Andrew-Pohl Mar 13, 2023
283d6f0
Add isp logos
Andrew-Pohl Mar 13, 2023
fe16cf6
remove background on logos
Andrew-Pohl Mar 13, 2023
b8e82fb
remove At&T background
Andrew-Pohl Mar 13, 2023
5221604
Add zenlayer logo
Andrew-Pohl Mar 21, 2023
bda4681
Add backend function to grab the max effective bond
Andrew-Pohl Apr 11, 2023
3bf3fe8
Add maxEffectiveStake to UI
Andrew-Pohl Apr 11, 2023
8962177
Centre everything and reduce min widths
Andrew-Pohl Apr 11, 2023
8e4e4a0
Fix case sensitive search
Andrew-Pohl Apr 11, 2023
7f941ee
add sort icon
minhthuan55891 Apr 12, 2023
dada027
increase layout min-width
minhthuan55891 Apr 12, 2023
ef20d3e
update sort icon
minhthuan55891 Apr 15, 2023
403bac8
correct sort arrow
minhthuan55891 Apr 15, 2023
4347d03
Merge pull request #6 from fiberblock/main
Andrew-Pohl Apr 17, 2023
9e424be
Add avax
Andrew-Pohl Apr 17, 2023
5502893
add avax logo
Andrew-Pohl Apr 17, 2023
d4794c0
Add avax block calc
Andrew-Pohl Apr 17, 2023
b76addf
sort changes
dannydango Jul 25, 2023
50ba79b
Fix search and rpc/bifrost logic
Andrew-Pohl Jul 25, 2023
37eb56d
Merge branch 'main' into sortChains
Andrew-Pohl Jul 25, 2023
f376011
Merge pull request #7 from liquify-validation/sortChains
Andrew-Pohl Jul 25, 2023
8e9a03a
Icon updates
dannydango Jul 25, 2023
5d7f340
Merge pull request #8 from liquify-validation/sortIcons
Andrew-Pohl Jul 25, 2023
f691fc8
Add bp string
Andrew-Pohl Jul 25, 2023
2258d0c
Double overview fix
dannydango Jul 26, 2023
0ffe442
Merge pull request #9 from liquify-validation/doubleFix
Andrew-Pohl Jul 26, 2023
dd6f7ef
Add historical data and bug fix IP grabbing
Andrew-Pohl Jul 26, 2023
2ac27e8
Graph fix
dannydango Jul 31, 2023
cddc2af
Merge branch 'main' into GraphFix
Andrew-Pohl Jul 31, 2023
4288bc4
Merge pull request #10 from liquify-validation/GraphFix
Andrew-Pohl Jul 31, 2023
e50fedd
Fix graph drawing
Andrew-Pohl Jul 31, 2023
09890df
Bug fixes
Andrew-Pohl Aug 1, 2023
44b407b
Make lines straight, change chart headings
Andrew-Pohl Aug 1, 2023
f501898
Update ISP list
Andrew-Pohl Aug 1, 2023
55011a9
History and Graph fix
dannydango Aug 2, 2023
b1ae895
Merge pull request #11 from liquify-validation/history
Andrew-Pohl Aug 2, 2023
ae67839
Update max effective Icon
Andrew-Pohl Aug 3, 2023
5ba228e
Update vertical-align-top.svg
Andrew-Pohl Aug 3, 2023
9d2b262
Update vertical-align-top.svg
Andrew-Pohl Aug 3, 2023
f5b7ae8
Add API to grab versions and store more country info
Andrew-Pohl Aug 8, 2023
cdc876a
Add swagger docs and fix bug on new node addition causing 5xx errors …
Andrew-Pohl Aug 11, 2023
144a47d
Add some more apis to grab historical churn data
Andrew-Pohl Aug 11, 2023
19b715c
bug fix
Andrew-Pohl Aug 11, 2023
4b2fc38
New graphs feature
dannydango Sep 6, 2023
b18408a
Merge pull request #12 from liquify-validation/graphUpdate
Andrew-Pohl Sep 6, 2023
1142316
Add BSC column
Andrew-Pohl Sep 11, 2023
e8c0a66
Add node address to title of graph
Andrew-Pohl Sep 11, 2023
f2d1868
Pre darkmode
dannydango Sep 15, 2023
1b933bd
dark mode
dannydango Sep 15, 2023
907940a
Merge branch 'main' of https://github.com/liquify-validation/thornode…
dannydango Sep 15, 2023
7c919bd
merge conflict
dannydango Sep 15, 2023
53eb0e2
darkmode fixes
dannydango Sep 18, 2023
a59e494
report final
dannydango Nov 23, 2023
f9b4795
report and package fixes
dannydango Nov 23, 2023
699d7fd
visual tweaks
dannydango Nov 23, 2023
76a0c28
link fix
dannydango Nov 23, 2023
852517b
clean up
dannydango Nov 23, 2023
11374cc
csv export
dannydango Nov 24, 2023
d2cf662
warning feature added
dannydango Jan 2, 2024
ee62a79
Average graph feature & report fix
dannydango Jan 9, 2024
0a52488
chain warning and average reward fix
dannydango Jan 10, 2024
f2c22c0
quick fix
dannydango Jan 10, 2024
bd84444
warning symbol fix
dannydango Jan 12, 2024
5acb572
node address hover fix
dannydango Mar 14, 2024
9238a79
BNB removed
dannydango Sep 25, 2024
1eb2199
Added version switch feature
dannydango Jan 21, 2025
80fca1d
fixed routes duplication issue
dannydango Jan 21, 2025
563bb06
altered version button, added BASE
dannydango Jan 30, 2025
7ee4c6d
corrected links
dannydango Jan 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,62 @@
# Thornode Monitor

The Monitor dashboard is used to collate information on active, standby and old nodes on the rune network it collates information
from multiple sources and displays them on a single dashboard. This repo consists of both the front end (js react app)
and the backend module (a python api server).

1) Front end:
- This is all the code in this repository, minus the lambda functions folder and python backend folder
- Built using react
- It pulls data from the backend api

2) Back end:
- Several parts to the backend
1) mySQL database to store all the data
2) python app responsible to collect data and provide an api access point to the front end


- The database is fairly simple and consists of 2 tables with the following structure


- thornode_monitor_global - holds network information
- primary_key - int
- maxHeight - int (current blockheight used to pull other data)
- retiring - boolean (indicates if a vault is retiring)
- coingecko - string (json string containing price/trading info pulled from coingecko api)
- lastChurn - int (block of last churn)
- secondsPerBlock - float
- churnInterval - int
- BadValidatorRedline - int


- thornode_monitor - holds information on each node in the network
- node_address - string (primary key)
- active_block_height - int (block at which the node became active)
- bond_provider - string (json string containing information on bonds and providers)
- bond -int (amount bonded)
- current_award - int (amount awarded this epoch)
- slash_points - int (slash points this epoch)
- forced_to_leave - boolean
- requested_to_leave - boolean
- jail - string (json string containing information on any past jailing)
- observe_chains - string (json string containing block heights for downstream chains)
- preflight_status - string
- status - string
- status_since - int
- version - string
- ip_address - string
- location - string
- isp - string
- rpc - string (json string of response from health rpc calls)
- bifrost - string (bifrost p2pid)


- The python app runs off a main loop which pulls data every 20 seconds and updates the DB, it listens to api calls to
/api/grabData and returns the data in json.


# Old deployment via AWS lambda (no longer maintained in this fork)

There are several moving parts to this dashboard

1) Front end:
Expand Down
93 changes: 93 additions & 0 deletions backend python/backPort.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import requests
import json
import time
import math
import datetime
from common import getDB, commitQuery, grabQuery



def backPort(churn):
"""
backPort fills in historical database for the churn height passed in

:param churn: height to grab data for
"""

entries = len(grabQuery("SELECT * FROM noderunner.thornode_monitor_historic where churnHeight='{field}'".format(
field=churn)))

if(entries != 0):
return

status = 0
while status != 200:
print("trying " + str(churn))
response_API = requests.get('https://thornode-v1.ninerealms.com/thorchain/nodes?height=' + str(churn))
status = response_API.status_code

data = json.loads(response_API.text)
# sanitise data remove any empty elements
nodes = [x for x in data if '' != x['node_address']]

# Loop over new nodes and grab IP addr
for node in nodes:
if node['ip_address'] != "":
ipData = grabQuery("SELECT * FROM noderunner.thornode_monitor_historic where ip_address='{field}'".format(
field=node['ip_address']))

response_code = 0
if(len(ipData) == 0):
while response_code != 200:
response = requests.get("http://ip-api.com/json/" + node['ip_address'])
response_code = response.status_code
if response_code == 429:
print("rate limited wait 60seconds")
time.sleep(60)
elif response_code == 200:
ip_data = json.loads(response.text)
if (ip_data['status'] != "fail"):
node['ip_data'] = ip_data
else:
node['ip_data'] = {}
node['ip_data']['city'] = ""
node['ip_data']['isp'] = ""
else:
node['ip_data'] = {}
node['ip_data']['city'] = ipData[0]['location']
node['ip_data']['isp'] = ipData[0]['isp']

else:
node['ip_data'] = {}
node['ip_data']['city'] = ""
node['ip_data']['isp'] = ""

query = "INSERT INTO noderunner.thornode_monitor_historic (node_address, ip_address, location, isp, " \
"active_block_height, bond_providers, bond, current_award, slash_points,forced_to_leave, " \
"requested_to_leave, bond_address, preflight_status, status, " \
"status_since, version, churnHeight) VALUES ('{node_address}', '{ip_address}','{city}','{isp}'," \
"'{active_block_height}','{bond_providers}','{bond}','{current_award}','{slash_points}'," \
"'{forced_to_leave}','{requested_to_leave}','{bond_address}'," \
"'{preflight_status}','{status}','{status_since}'," \
"'{version}','{churnHeight}')".format(node_address=node['node_address'], ip_address=node['ip_address'],
city=node['ip_data']['city'], isp=node['ip_data']['isp'],
active_block_height=node['active_block_height'],
bond_providers=json.dumps(node['bond_providers']), bond=int(node['total_bond']),
current_award=int(node['current_award']), slash_points=node['slash_points'],
forced_to_leave=int(node['forced_to_leave']),
requested_to_leave=int(node['requested_to_leave']), bond_address='',
preflight_status=json.dumps(node['preflight_status']), status=node['status'],
status_since=node['status_since'], version=node['version'], churnHeight=churn)

commitQuery(query)

def main():
response_API = requests.get('https://midgard.ninerealms.com/v2/churns')
data = json.loads(response_API.text)

for key in data:
backPort(int(key['height']) - 1)


if __name__ == "__main__":
main()
Loading