Skip to content
This repository was archived by the owner on Aug 4, 2025. It is now read-only.

Commit be7e0a1

Browse files
committed
first commit
0 parents  commit be7e0a1

32 files changed

+407
-0
lines changed

.env.example

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# SERVER PORT
2+
# This exposes the web frontend and the API, make sure you adapt your firewall settings accordingly if needed
3+
# If you need/want SSL and or authentication, this can easily be done via Caddy:
4+
# https://caddyserver.com/docs/quick-starts/reverse-proxy
5+
SERVER_PORT=3008
6+
7+
# LOG FILE
8+
# Absolute path to your Iagon Node logfile. Should end with info.log
9+
LOGFILE=/home/username/iagon-node-logs/info.log
10+
11+
# NODE BINARY
12+
# Absolute path to your executable node binary
13+
NODE_BIN=/home/username/iagon-node/./iag-cli-linux

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Mad Orkestra ([email protected])
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# IAG Node Monitor
2+
Web Frontend to monitor the status and base metrics of your Iagon Storage Node CLI.
3+
4+
Iagon is a decentralized Web3 cloud storage provider on Cardano: https://iagon.com/
5+
6+
![Image Screenshot](screenshots/GF8PrhNWQAECPc4.jpg )
7+
8+
9+
## Requirements
10+
- Iagon Storage Node CLI
11+
https://github.com/Iagonorg/mainnet-node-CLI
12+
13+
- NodeJS v18+
14+
https://nodejs.org
15+
16+
# Installation
17+
- Download the latest release from https://github.com/MadOrkestra/iagon-node-monitor/releases
18+
19+
- Unzip on the machine where your Iagon Node CLI is running
20+
- Enter the directory and run `npm install`
21+
22+
- Add a free server port and paths to the Node CLI binary and the info.log to the .env.example file and rename it to .env
23+
24+
- Run `node server.js` in the monitor directory to start the the monitoring server
25+
26+
## Optional - Run persistent with PM2
27+
To start the monitor on startup/after reboot, here is how to do this with PM2 (https://pm2.keymetrics.io/):
28+
- run `npm install pm2 -g` to install PM2
29+
- run `pm2 startup` and follow the instructions to start PM2 on boot
30+
- run `pm2 start server.js` in the monitor directory to start it
31+
- run `pm2 save` to save your configuration
32+
33+
## Optional - SSL / Authentication
34+
If you want to install the frontend as standalone Web App or need SSL / Authentication, Caddy is probably the easiest way: https://caddyserver.com/docs/quick-starts/reverse-proxy
35+
36+
37+
# How to use
38+
39+
Open a webbrowser at http://[*IP of your Node*]:[*Server Port*] - that's it. If you run it with SSL (see above), you can install it as standalone web app. The interface is pretty straight forward and shows Node status, Bandwidth data, Read/Write speeds, errors over time and the Node logfile.
40+
41+
- Shortcuts
42+
- `L` to open the logfile view
43+
- `Escape` to close it
44+
- Logs are pulled automatically from the logfile every 5 minutes
45+
- Status is checked every 60 seconds
46+
47+
48+
# Notes / Known Issues
49+
- Depending on the size of your logfile this might take a while to startup. For performance reasons pings and ping requests are not shown in the logview.
50+
51+
- If you are running your Node on a public server, make sure to adapt your firewall settings accordingly or add authentication
52+
53+
- Not all errors displayed in the monitor need your attention, some are only of interest to Iagon. Check the logview for details.
54+
55+
- The charts get cluttered if your Node has been running for a while. Updating soon.
56+
57+
- This has a bunch of workarounds to get the infomation out of the Node and output it correctly, so it will most likely break after a Node update if Iagon decides to make changes to their logs.
58+
59+
- Tested on Ubuntu 22.04.3 LTS and MacOS Ventura. Other Linux distros will most likely work, but if you are running your Node on Windows, you'll have to figure it out on your own (please drop me a DM how it goes)
60+
61+
# What else?
62+
63+
I created this out of personal necessity and will keep updating it as long as I run my own Node. If you like it, feel free to send some ADA or IAG to my wallet at $madorkestra (https://handle.me/madorkestra) to keep me motivated.
64+
65+
Enjoy!

lib/helper.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import path from "path";
2+
import { readdir, stat } from "fs/promises";
3+
import { exec } from "child_process";
4+
5+
const dirSize = async (directory) => {
6+
const files = await readdir(directory);
7+
const stats = files.map((file) => stat(path.join(directory, file)));
8+
9+
return (await Promise.all(stats)).reduce(
10+
(accumulator, { size }) => accumulator + size,
11+
0
12+
);
13+
};
14+
15+
function execShellCommand(cmd) {
16+
return new Promise((resolve, reject) => {
17+
exec(cmd, (error, stdout, stderr) => {
18+
if (error) {
19+
console.warn(error);
20+
}
21+
resolve(stdout ? stdout : stderr);
22+
});
23+
});
24+
}
25+
26+
export { dirSize, execShellCommand };

package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "iagon-node-monitor",
3+
"version": "0.3.0",
4+
"description": "",
5+
"main": "index.js",
6+
"type": "module",
7+
"keywords": [],
8+
"author": "Mad Orkestra ([email protected])",
9+
"license": "MIT",
10+
"dependencies": {
11+
"compression": "^1.7.4",
12+
"cors": "^2.8.5",
13+
"dotenv": "^16.4.1",
14+
"express": "^4.18.2"
15+
}
16+
}

public/_app/env.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const env={"PUBLIC_API":"/api"}

public/_app/immutable/assets/0.dmjwYnvx.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/_app/immutable/assets/2.TFHM3M9J.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/_app/immutable/assets/_layout.dmjwYnvx.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/_app/immutable/assets/_page.TFHM3M9J.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)