A simple monitoring application for an EVM (Ethereum Virtual Machine) blockchain node. This application monitors the node's block number and checks the time passed since the last block. It also gathers system metrics such as free disk space, free memory, and CPU usage. The monitoring data is saved to a JSON file, and an Express server is set up to serve the monitoring data at the /monitoring
endpoint.
- Node.js (version 12 or higher)
- npm
-
Clone the repository:
git clone https://github.com/yourusername/evm-node-monitor.git
-
Navigate to the project directory:
cd evm-node-monitor
-
Install the required dependencies:
npm install
-
Set the EVM_NODE_URL environment variable with the URL of your EVM node:
EVM_NODE_URL=https://your-node-url
Start the monitoring application:
npm start
The monitoring application will start an Express server on the specified port (default is 3000) and perform monitoring every 10 seconds.
Access the monitoring data at the /monitoring endpoint:
http://localhost:3000/monitoring
##Testing Run the tests using the following command:
npm test
This will run the tests using Jest and Supertest to ensure the /monitoring endpoint returns the correct monitoring data and status.
This project is licensed under the MIT License.