SMH-Client is a self-hosted web application for monitoring the data that your Spacemesh nodes and post services expose via their gRPC APIs.
- A node.js server will maintain gRPC streaming calls with all of your configured instances.
- The server continuously collects this data, holding an up-to-date global 'state' object in memory.
- Whenever the state changes, an 'update' websocket event is emitted to all connected clients.
- When the web browser receives the websocket event, it will immediately fetch the latest state from the server, using a good old http request.
- If you have a VPN or ZTNA (Zero Trust Network Access) solution for remote access, you can easily check on your nodes from any location.
- (Work in progress) - You can also set email alerts to trigger whenever a significant event occurs (e.g when a node goes offline, or when a post service starts/finishes proving)
- Create empty folders:
smh-client
andsmh-client/data
- Create file
smh-client/compose.yaml
with the following contents:
services:
smh-client:
container_name: smh-client
build: https://github.com/steve-king/smh-client.git#main
ports:
- '3131:3131'
volumes:
- ./data:/app/data
restart: always
- cd to
smh-client
directory - run:
docker compose up -d
docker compose down
docker compose up -d --build --force-recreate
If you prefer not to use compose, run:
Pre-requisites:
- git
- nodejs (v18 or higher)
- clone repository:
git clone [email protected]:steve-king/smh-client.git
- Change to directory:
cd smh-client
- Initialise submodule:
git submodule update --init --recursive
- Install node packages:
npm install
- Compile and run:
npm run build && npm start
- Or for dev environment:
npm run dev