There are several moving parts to this dashboard
- Front end:
- This is all the code in this repository, minus the lambda functions folder
- Built using react
- It calls an AWS API Gateway to collect data which it then displays
- Back end:
-
Several parts to the backend
- AWS RDS database to store all the data
- AWS Lambda functions which collect the data and also provides the function for the api call
- AWS API Gateway which invokes one of the lambda functions to return the data to the front end
-
Back end lambda functions are in the 'lambda functions' folder, they consist of
- thormonitor_collect_data2: This function stores data about the nodes, ie bond, slash points status etc... into the DB
- thormonitor_collect_data_rpc_bifrost: This function checks the RPC and Bifrost API of each node and stores in the DB
- thornode_collect_data_global: This function stores info like block time per second and data from coingecko into the DB
- thormonitor: This is the lambda function which is invoked by the API call to return all the data to the front end from the DB
How to build:
- ~ git clone https://github.com/thorchain/thornode-network.git
- ~ cd thornode-network
- ~ npm install
- Upload the 4 functions to lambda and set them up to run every 1 minute except for the thormonitor code.
- Create an AWS API Gateway that invokes thormonitor lambda function
- Create aws-export.js in the src folder and enter the details of your AWS API Gateway
- If your have populated your database with some data, all you need to do is '~ npm run start' and the front end should start pulling and displaying the data