This tool lets you easily monitor your Kaspa Node.
NOTE: Kaspa Node Monitor is still in beta, it may contain bugs.
Kaspa Node Monitor displays information such as:
- Block count
- Header count
- Peers count
- DAA Score
- Blue score
- Node version
- Node sync status
- Node network
- Network difficulty
- Hardware information (this can be disabled), such as:
- Hostname
- Location
- CPU Model
- CPU Thread Count
- RAM (Free & Total)
- System load
Kaspa Node Monitor features a CLI Tool called KasNodeMon, this tool lets you easily set up a new instance of the node monitor, as well as change configuration and update existing ones. It also has an ability to diagnose the most common issues with the node monitor.
You need to have NodeJS installed on your system.
After NodeJS is installed on your system, you may follow these steps.
-
Run the
init
command$ npx kasnodemon@latest init
-
Answer all the questions prompted by the program, and wait for the process to finish
-
Success! Kaspa Node Monitor is set up. To run it, visit the server directory, and run
npm start
. Quick, wasn't it?
Below you will find the instructions to set up Kaspa Node Monitor with your Kaspa Node. These instructions are for Linux, some steps may be different on other operating systems, for example nano
is a linux package.
You need to have NodeJS and Git installed on your system. NOTE: These instructions are for the beta version, the setup process on the final release may change.
-
Clone this GitHub Repository
$ git clone https://github.com/imalfect/KaspaNodeMonitor
-
Go to the cloned directory
$ cd KaspaNodeMonitor
-
Install all the required packages
$ npm install
-
Configure Kaspa Node Monitor
-
Configure the backend
-
Go to the backend directory
$ cd server
-
Copy the example .env file
$ cp .env.example .env
-
Edit and save the .env file to your preferences with your favorite editor (More about the .env file later in the README)
$ nano .env
-
Go back to the main directory and follow the next steps
$ cd ..
-
-
Configure the frontend
-
Go to the frontend directory
$ cd client
-
Copy the example config.json file
$ cp config.json.example config.json
-
Edit and save the config.json file to your preferences with your favorite editor (More about the config.json file later in the README)
$ nano config.json
-
Build the frontend, and go back to the main directory and follow the next steps.
$ npm run build && cd ..
-
-
-
Once you're all finished with the configuration, and you've built the frontend you're ready to go! If you set the
SERVE_FRONTEND
parameter in the backend.env
tofalse
, you'll have to copy thedist
folder from theclient
directory and serve it to the user. If you set it to true, it will be served automatically with the backend on the same port. -
Run the backend
$ npm start
Congratulations! You have successfully set up Kaspa Node Monitor, and it is now running on the port that you've set, If you want the domain monitor to run under a domain, you'll have to configure it in your reverse proxy and/or DNS records.
.env and config.json are configuration files for Kaspa Node Monitor, the .env file is used for the backend, and the config.json is used for the frontend. Both of them are explained below.
The .env file is used for the backend and can be found in the backend
directory.
Parameter | Description |
---|---|
ALLOW_SERVER_INFORMATION | This setting allows the server to send information about itself to the client. If you're running the node monitor on a different machine that the node is running on, you'll be able to set the information manually in the future |
LOCATION | The location of the server the node runs on (preferably the country) |
LOG_LEVEL | This setting allows you to set the log level for the backend, the default one is info , if you want to see the debug information, you can set it to debug |
PORT | The port that the server will run on |
HOST | The host ip that the node monitor should run on (hint: use 127.0.0.1 for local installation and 0.0.0.0 for public) |
SERVE_FRONTEND | If you want to serve the frontend with the server, set this to true |
SERVER_INFORMATION_HOSTNAME | Manually set hostname of the server, leave blank to use the host one. |
SERVER_INFORMATION_CPU_MODEL | Manually set CPU Model Information of the server, leave blank to use the host one. |
SERVER_INFORMATION_CPU_THREADS | Manually set CPU Thread Count Information of the server, leave blank to use the host one. |
The config.json file is used for the frontend and can be found in the client
directory
Parameter | Description |
---|---|
welcomeText | This text will be displayed on the frontend under the Kaspa Node Monitor header |
wsApiURL | Put the WebSocket API URL here (eg. ws://127.0.0.1:3000/ws), it's basically your backend url with /ws added to it |
theme | This setting is used to specify the theme that the frontend will use, more on themes in the themes.md file, which can be found in the client directory |
IMPORTANT: When using with Docker, your Hardware information for RAM and Load will be what Docker has access to. It will not represent the state of the host.
NOTE: Temporary. When released, this will be using a published image.
It is expected you run this in the server that's running kaspad
.
Frontend will be accessible via port 80
.
Backend will be accessible via 8124
To use with Docker, run the command:
cd <root of folder>
docker compose up -d
To use with Docker for development, run the command:
cd <root of folder>
docker compose -f docker-compose-dev.yaml up -d
If this is the first time you run docker-compose up
, it will take about 5mins to install dependencies. You should have node_modules
in both client
and server
folders.
After it's done installing, you can access the monitor at localhost:2989
.
Changes to server/.env
:
- If you're running the
server
container on the same host as kaspad, you can use the NODE_URL:NODE_URL=host.docker.internal:16110
Changes to client/config.json
:
- Use this for
wsApiURL
:"wsApiURL": "ws://127.0.0.1:8124/ws"
- The
8124
here matches the port indocker-compose.yaml
- The
- Directory can be specified with the
-d
flag, otherwise the current one is used - Checks for the most common errors in a node monitor installation
- Directory can be specified with the
-d
flag, otherwise the current one is used - Checks for available updates for the kaspa node monitor instance
- Directory can be specified with the
-d
flag, otherwise the current one is used - Updates the kaspa node monitor instance, configs remain unchanged, changes made to the code will be overwritten.
- This command lets you easily check the status of any kaspa node from the command line, simply execute the command and the most important information about the node will appear.
- Type (
client
/server
) - This command lets you change the configuration of the kaspa node monitor instance with ease
Pull requests are welcome on our GitHub. For major changes, please open an issue first to discuss what you would like to change.
Kaspa Node Monitor is created by iMalFect
Kaspa Node Monitor is licensed under ISC