dartroom / node-monitor Goto Github PK
View Code? Open in Web Editor NEWA simple program that monitors the state of a local node and reports if it is synced, catching up or has stopped syncing.
A simple program that monitors the state of a local node and reports if it is synced, catching up or has stopped syncing.
Create a loop or cron/job queue that pols the Algorand node every 10s. Each pol checks whether the last-round
field in the response has incremented from the last one.
If the last round field has incremented since the last poll, we store the new value in a persistent location (file or embedded database). In the subsequent poll, we check this stored field again with the newly polled one.
When the last round value has not been incremented, we start the error reporting process. We store a persistent value of the timestamp of the event and store a persistent value that the node is unhealthy.
When in the error reposting process, the healthy route now returns the 503 error. The body now contains not only the last route value and status but also the timestamp of when the event started for debugging purposes. And reports the latest round value of the other nodes in the cluster to compare against.
Cluster node connections. In the configuration file, we pass in an array of all other nodes in the cluster and which one the current node is. When in the error process, we use the other nodes in the cluster to decide when the local node is synced again.
For each poll in the error process, we check if the last round value has changed. When this happens, we can assume the node has started syncing again. If that is the case, we still report back an error in the health route, but now we also include that the node is catching up.
During catchup, we also fetch the last round value from the other cluster nodes each time we poll. We compare the local value to the other nodes, and if it is within a +- 1 range of the other value, we can assume the node is fully caught up again. The health route should now report back a 200, okay, status again.
When starting the monitor, there should be a configuration passed in. This can either be a JSON config file or CLI arguments. We should be able to pass in:
Add an HTTP route to the service that reports status of 200 if the Algorand node is correctly syncing and 503 if the node is out of sync.
The body of the response should contain additional information about the event. For example, the difference between a full stop and the catchup process after a stop.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.