Polkalert is an application that runs locally with validator's Substrate node and provides monitoring and alerting when relevant events happen. Alerts can be sent via email or webhooks. Polkalert also provides a convenient GUI for staking info and settings.
Polkalert is able to send you notifications about:
It can also watch your validator account for:
Application stores blocks and their meta-data locally in a DB for better performance and analysis of network events.
Tech stack:
cd path/to/project
npm i -g yarn
yarn
command to install project dependenciesyarn setup
command to setup environment variables and default settings.https://docs.docker.com/compose/install/
You can run the project via Terminal using the following commands:
yarn start:client
: Runs the client, default on localhost:8080
yarn start:server
: Runs only the server, default on localhost:4000
yarn start:db
: Runs only the db, default on localhost:5432
You need all of the three parts: client, server and db running to run Polkalert. Alternatively, you can use shortcut command.
yarn start
: Which runs the whole project. The client, db and the server parts will run on the ports mentioned above by default or on ports you configured via the setup script. Note that you will not have full control over each process if you run the app this way.Navigate your browser to localhost:8080
where Polkalert client runs by default. If everything has started, you should be able to follow instructions in the UI to connect to your validator node and setup Polkalert
If you get errors upon starting client or server try running yarn setup
again. Make sure the ports you are using to run Polkalert are not occupied. If that doesn't work, run yarn reset
* WARNING - this will reset all your settings to defaults.
Besides the start
script, there are other ones which can be used to work with the project. They are supposed to be run in Terminal, while being navigated to the root directory of the project. The available scripts are:
yarn
: Installs all the dependencies, needs to be run before using the project
yarn install:client
: Installs only the client dependencies
yarn install:server
: Installs only the server dependencies
yarn setup
: Setup project environment variables and default settings
yarn stop:db
: Stops db and resets docker interfaces if it doesn't stop automatically
yarn reset
: Resets the database, server and settings to it's default state
yarn reset:db
: Resets the database to it's default state
yarn reset:server
: Resets the server to it's default state
yarn dev:server
: Runs server with automatic rebuild and restart on file changes
yarn build
: Builds the whole project for production
yarn build:client
: Builds only the client for production
yarn build:server
: Builds only the server for production
yarn add:client [packageName]
: Shortcut for yarn add
in the client folder, all flags are forwarded
yarn add:server [packageName]
: Shortcut for yarn add
in the server folder, all flags are forwarded
yarn remove:client [packageName]
: Removes and uninstalls a dependency from the client
yarn remove:server [packageName]
: Removes and uninstalls a dependency from the server
yarn storybook
: Runs Storybook (visual documentation of the client)
yarn bump
: Updates project version. Do this before pushing
yarn lint
: Runs code checks on the whole project
yarn lint:client
: Runs code checks only on the client
DEV-IMPORTANT! Make sure to:
Editor: Format On Save
setting in VSCode turned on to keep the code consistent.yarn lint
before commiting your code. If the code won't pass the checks, it won't be able to be built.yarn bump
README.md
files located in subfolders (if provided) for further info.