Releases: SimplyStaking/panic_polkadot
v2.4.0
Released on 23rd July 2021
- (UI) Dockerfile now uses node:14.
- (UI) Fixed some security vulnerabilities.
Update Instructions
To update an instance of PANIC to this version, run these commands inside the project directory:
git fetch # Fetch these changes
git checkout v2.4.0 # Switch to this version
# At this stage, you should stop the alerter and the UI
pipenv sync # Update dependenciesThe next step is to make sure that you are running version 1.29.1 of the Polkadot API Server, this is important as otherwise PANIC won't be able to retrieve data.
When you have done all of the above follow one of the guides below depending on whether you were running PANIC from source, or using docker-compose.
Running from Source
Restart the UI
Start by navigating into the the UI directory and install the packages defined in package.json:
cd src/web/ui
npm ci --only=production # use sudo in linux if necessaryRe-build the UI, re-direct to the PANIC Polkadot directory, and start the UI
npm run-script build # use sudo in linux if necessary
cd ../../../
bash run_ui_server.shRestart the Alerter
The final step is to restart the alerter. If the alerter was running as a Linux service, the service should now be restarted:
sudo systemctl restart panic_alerterOtherwise, if you are not using Linux services perform this command in the project directory:
pipenv sync
pipenv run python run_alerter.py # use sudo in linux if necessary
# If multiple versions of Python are installed, the python executable may be `python3.6`, `python3.7`, etc.Run using Docker-Compose
Update and Run the UI Container
The first step is to obtain the updated UI docker image. This can either be done by re-building it manually or downloading it from Docker Hub.
Option 1: Building the Docker Image
Run the following command in the project directory to build the image:
docker-compose build uiOption 2: Downloading the Pre-Built Docker Image from Docker Hub
The pre-built Docker image can simply be downloaded by running the following command:
docker pull simplyvc/panic_polkadot_ui:2.4.0Run the UI docker image using this command:
docker-compose up -d uiUpdate and Run the Alerter Container
Start by obtaining the updated alerter docker image. This can either be done by re-building it manually or by downloading it from Docker Hub
Option 1: Building The Docker Image
Run the following command to build the image:
docker-compose build alerterOption 2: Downloading the Pre-Built Docker Image from Docker Hub
The pre-built Docker image can simply be downloaded by running the following command:
docker pull simplyvc/panic_polkadot:2.4.0Now that the Docker image is on your machine, you can run it as follow:
docker-compose up -d alerterv2.3.0
Released on 14th May 2021
- (alerter) Updated dependencies.
- (alerter) Fixed issue with persistent connections when retrieving data from the API Server.
- (UI) Fixed some security vulnerabilities for fixable dependencies.
Update Instructions
To update an instance of PANIC to this version, run these commands inside the project directory:
git fetch # Fetch these changes
git checkout v2.3.0 # Switch to this version
### At this stage, you should stop the alerter and the UI
pipenv sync # Update dependenciesThe next step is to make sure that you are running version 1.28.1 of the Polkadot API Server, this is important as otherwise PANIC won't be able to retrieve data.
When you have done all of the above follow one of the guides below depending on whether you were running PANIC from source, or using docker-compose.
Running from Source
Restart the UI
Start by navigating into the the UI directory and install the packages defined in package.json:
cd src/web/ui
npm ci --only=production # use sudo in linux if necessaryRe-build the UI, re-direct to the PANIC Polkadot directory, and start the UI
npm run-script build # use sudo in linux if necessary
cd ../../../
bash run_ui_server.shRestart the Alerter
The final step is to restart the alerter. If the alerter was running as a Linux service, the service should now be restarted:
sudo systemctl restart panic_alerterOtherwise, if you are not using Linux services perform this command in the project directory:
pipenv sync
pipenv run python run_alerter.py # use sudo in linux if necessary
# If multiple versions of Python are installed, the python executable may be `python3.6`, `python3.7`, etc.Run using Docker-Compose
Update and Run the UI Container
The first step is to obtain the updated UI docker image. This can either be done by re-building it manually or downloading it from Docker Hub.
Option 1: Building the Docker Image
Run the following command in the project directory to build the image:
docker-compose build uiOption 2: Downloading the Pre-Built Docker Image from Docker Hub
The pre-built Docker image can simply be downloaded by running the following command:
docker pull simplyvc/panic_polkadot_ui:2.3.0Run the UI docker image using this command:
docker-compose up -d uiUpdate and Run the Alerter Container
Start by obtaining the updated alerter docker image. This can either be done by re-building it manually or by downloading it from Docker Hub
Option 1: Building The Docker Image
Run the following command to build the image:
docker-compose build alerterOption 2: Downloading the Pre-Built Docker Image from Docker Hub
The pre-built Docker image can simply be downloaded by running the following command:
docker pull simplyvc/panic_polkadot:2.3.0Now that the Docker image is on your machine, you can run it as follow:
docker-compose up -d alerterv2.2.0
Released on 13th April 2021
- Fixed failing unit tests.
- Fixed UI dependencies.
- Now using react-toastify notifications.
Update Instructions
To update an instance of PANIC to this version, run these commands inside the project directory:
git fetch # Fetch these changes
git checkout v2.2.0 # Switch to this version
# At this stage, you should stop the alerter and the UI
pipenv sync # Update dependenciesThe next step is to make sure that you are running version 1.27.1 of the Polkadot API Server, this is important as otherwise PANIC won't be able to retrieve data.
When you have done all of the above follow one of the guides below depending on whether you were running PANIC from source, or using docker-compose.
Running from Source
Restart the UI
Start by navigating into the the UI directory and install the packages defined in package.json:
cd src/web/ui
npm ci --only=production # use sudo in linux if necessaryRe-build the UI, re-direct to the PANIC Polkadot directory, and start the UI
npm run-script build # use sudo in linux if necessary
cd ../../../
bash run_ui_server.shRestart the Alerter
The final step is to restart the alerter. If the alerter was running as a Linux service, the service should now be restarted:
sudo systemctl restart panic_alerterOtherwise, if you are not using Linux services perform this command in the project directory:
pipenv sync
pipenv run python run_alerter.py # use sudo in linux if necessary
# If multiple versions of Python are installed, the python executable may be `python3.6`, `python3.7`, etc.Run using Docker-Compose
Update and Run the UI Container
The first step is to obtain the updated UI docker image. This can either be done by re-building it manually or downloading it from Docker Hub.
Option 1: Building the Docker Image
Run the following command in the project directory to build the image:
docker-compose build uiOption 2: Downloading the Pre-Built Docker Image from Docker Hub
The pre-built Docker image can simply be downloaded by running the following command:
docker pull simplyvc/panic_polkadot_ui:2.2.0Run the UI docker image using this command:
docker-compose up -d uiUpdate and Run the Alerter Container
Start by obtaining the updated alerter docker image. This can either be done by re-building it manually or by downloading it from Docker Hub
Option 1: Building The Docker Image
Run the following command to build the image:
docker-compose build alerterOption 2: Downloading the Pre-Built Docker Image from Docker Hub
The pre-built Docker image can simply be downloaded by running the following command:
docker pull simplyvc/panic_polkadot:2.2.0Now that the Docker image is on your machine, you can run it as follow:
docker-compose up -d alerterv2.1.3
Released on 29th January 2021
Alerter:
- Fixed number of blocks authored, session index and era index parsing. Now the parsing takes in consideration values in hex.
UI:
- Updated third party libraries
PANIC is now compatible with version 1.26.1 of the Polkadot API Server.
Update Instructions
To update an instance of PANIC to this version, run these commands inside the project directory:
git fetch # Fetch these changes
git checkout v2.1.3 # Switch to this version
# At this stage, you should stop the alerter and the UI
pipenv sync # Update dependenciesThe next step is to make sure that you are running version 1.26.1 of the Polkadot API Server, this is important as otherwise PANIC won't be able to retrieve data.
When you have done all of the above follow one of the guides below depending on whether you were running PANIC from source, or using docker-compose.
Running from Source
Restart the UI
Start by navigating into the the UI directory and install the packages defined in package.json:
cd src/web/ui
npm ci --only=production # use sudo in linux if necessaryRe-build the UI, re-direct to the PANIC Polkadot directory, and start the UI
npm run-script build # use sudo in linux if necessary
cd ../../../
bash run_ui_server.shRestart the Alerter
The final step is to restart the alerter. If the alerter was running as a Linux service, the service should now be restarted:
sudo systemctl restart panic_alerterOtherwise, if you are not using Linux services perform this command in the project directory:
pipenv sync
pipenv run python run_alerter.py # use sudo in linux if necessary
# If multiple versions of Python are installed, the python executable may be `python3.6`, `python3.7`, etc.Run using Docker-Compose
Update and Run the UI Container
The first step is to obtain the updated UI docker image. This can either be done by re-building it manually or downloading it from Docker Hub.
Option 1: Building the Docker Image
Run the following command in the project directory to build the image:
docker-compose build uiOption 2: Downloading the Pre-Built Docker Image from Docker Hub
The pre-built Docker image can simply be downloaded by running the following command:
docker pull simplyvc/panic_polkadot_ui:2.1.3Run the UI docker image using this command:
docker-compose up -d uiUpdate and Run the Alerter Container
Start by obtaining the updated alerter docker image. This can either be done by re-building it manually or by downloading it from Docker Hub
Option 1: Building The Docker Image
Run the following command to build the image:
docker-compose build alerterOption 2: Downloading the Pre-Built Docker Image from Docker Hub
The pre-built Docker image can simply be downloaded by running the following command:
docker pull simplyvc/panic_polkadot:2.1.3Now that the Docker image is on your machine, you can run it as follow:
docker-compose up -d alerterv2.1.2
Released on 3rd September 2020
Bug Fixes
- (CLI Setup) The cli setup now writes the
chain_namekey for each node configuration inside theuser_config_nodes.inifile as expected.
Update Instructions
To update an instance of PANIC to this version, run these commands inside the project directory:
git fetch # Fetch these changes
git checkout v2.1.2 # Switch to this version
# At this stage, you should stop the alerter and the UI
pipenv sync # Update dependenciesIf you have been using the CLI setup process to setup PANIC and a KeyError: chain_name error was being raised when running PANIC, we suggest re-setting the nodes part of the CLI setup process (Other parts can be skipped). This can be done by running the following:
pipenv run python run_alerter_setup.py # use sudo in linux if necessary
# If multiple versions of Python are installed, the python executable may be `python3.6`, `python3.7`, etc.To make sure that the configs are valid, please run the following:
pipenv run python run_util_validate_configs.py # use sudo in linux if necessary
# If multiple versions of Python are installed, the python executable may be `python3.6`, `python3.7`, etc.The next step is to follow one of the guides below depending on whether you were running PANIC from source, or using docker-compose.
Running from Source
Restart the UI
Start by navigating into the the UI directory and install the packages defined in package.json:
cd src/web/ui
npm ci --only=production # use sudo in linux if necessaryRe-build the UI, re-direct to the PANIC Polkadot directory, and start the UI
npm run-script build # use sudo in linux if necessary
cd ../../../
bash run_ui_server.shRestart the Alerter
The final step is to restart the alerter. If the alerter was running as a Linux service, the service should now be restarted:
sudo systemctl restart panic_alerterOtherwise, if you are not using Linux services perform this command in the project directory:
pipenv sync
pipenv run python run_alerter.py # use sudo in linux if necessary
# If multiple versions of Python are installed, the python executable may be `python3.6`, `python3.7`, etc.Run using Docker-Compose
Update and Run the UI Container
The first step is to obtain the updated UI docker image. This can either be done by re-building it manually or downloading it from Docker Hub.
Option 1: Building the Docker Image
Run the following command in the project directory to build the image:
docker-compose build uiOption 2: Downloading the Pre-Built Docker Image from Docker Hub
The pre-built Docker image can simply be downloaded by running the following command:
docker pull simplyvc/panic_polkadot_ui:2.1.2Run the UI docker image using this command:
docker-compose up -d uiUpdate and Run the Alerter Container
Start by obtaining the updated alerter docker image. This can either be done by re-building it manually or by downloading it from Docker Hub
Option 1: Building The Docker Image
Run the following command to build the image:
docker-compose build alerterOption 2: Downloading the Pre-Built Docker Image from Docker Hub
The pre-built Docker image can simply be downloaded by running the following command:
docker pull simplyvc/panic_polkadot:2.1.2Now that the Docker image is on your machine, you can run it as follow:
docker-compose up -d alerterv2.1.1
Released on 31th August 2020
Improvements
- (UI Setup) When the user inputs the password during the UI setup process, the password is not displayed on the terminal. Note that for this setup script to execute as expected, the UI setup process must be executed inside a proper terminal.
- (UI Server) The UI server now requires authentication to get data from any endpoint.
Bug Fixes
- (UI Nodes and Repos pages) The remove button in the Added Nodes/Repos table no longer fails to remove a node from the list if there are more than 9 nodes.
Update Instructions
To update an instance of PANIC to this version, run these commands inside the project directory:
git fetch # Fetch these changes
git checkout v2.1.1 # Switch to this version
# At this stage, you should stop the alerter and the UI
pipenv sync # Update dependenciesThe next step is to follow one of the guides below depending on whether you were running PANIC from source, or using docker-compose.
Running from Source
Restart the UI
Start by navigating into the the UI directory and install the packages defined in package.json:
cd src/web/ui
npm ci --only=production # use sudo in linux if necessaryRe-build the UI, re-direct to the PANIC Polkadot directory, and start the UI
npm run-script build # use sudo in linux if necessary
cd ../../../
bash run_ui_server.shRestart the Alerter
The final step is to restart the alerter. If the alerter was running as a Linux service, the service should now be restarted:
sudo systemctl restart panic_alerterOtherwise, if you are not using Linux services perform this command in the project directory:
pipenv sync
pipenv run python run_alerter.py # use sudo in linux if necessary
# If multiple versions of Python are installed, the python executable may be `python3.6`, `python3.7`, etc.Run using Docker-Compose
Update and Run the UI Container
The first step is to obtain the updated UI docker image. This can either be done by re-building it manually or downloading it from Docker Hub.
Option 1: Building the Docker Image
Run the following command in the project directory to build the image:
docker-compose build uiOption 2: Downloading the Pre-Built Docker Image from Docker Hub
The pre-built Docker image can simply be downloaded by running the following command:
docker pull simplyvc/panic_polkadot_ui:2.1.1Run the UI docker image using this command:
docker-compose up -d uiUpdate and Run the Alerter Container
Start by obtaining the updated alerter docker image. This can either be done by re-building it manually or by downloading it from Docker Hub
Option 1: Building The Docker Image
Run the following command to build the image:
docker-compose build alerterOption 2: Downloading the Pre-Built Docker Image from Docker Hub
The pre-built Docker image can simply be downloaded by running the following command:
docker pull simplyvc/panic_polkadot:2.1.1Now that the Docker image is on your machine, you can run it as follow:
docker-compose up -d alerterv2.1.0
Released on 10th July 2020
Improvements
- (UI)
- (Authentication) Session based authentication is now used to secure access to the UI. The user must define a username and password by running the
run_ui_setup.pyscript. - (Dashboard) The data cards now have a fixed height and are placed on the dashboard using
react-bootstrap's grid system. This avoids having messy data cards, and adds more structure to the layout of the dashboard. - (HTTPS) The UI back-end server is now an HTTPS server. The user must put his own SSL certificate signed by a certificate authority in the
panic_polkadot/src/web/ui/certificatesfolder for maximum security. For convenience, a dummy certificate and key are provided. Note, the UI server does not start without these files.
- (Authentication) Session based authentication is now used to secure access to the UI. The user must define a username and password by running the
- (alerter)
- Whenever a validator node monitor loses connection with the API server for 15 seconds, a critical alert is sent to the operator, informing them that the monitor cannot retrieve validator data for monitoring.
- The alerter now calculates
blocks authoredalerts over an era, not session. By default, the alerter will now raise ano blocks authored so farorlast block authored block was 3 hrs agoif 3 hours passed and no blocks have been authored in the current era or since the last block authored in the current era respectively. Note, the user can set themax_time_alert_between_blocks_authoredin theinternal_config_main.iniconfig to any value less than the era duration.
- (setup) The CLI setup no longer forces nodes and repos to be accessible for them to be added to the configs.
Bug Fixes
- (UI Dashboard) The columns of the
Monitors Statustable were fixed to a minimum of200pxin width. This allows for better visualisation on mobile devices. - (UI Settings Pages) The
Save Configbutton in theNodesandSettingspages no longer disappears when the respective configs are empty. - (alerter)
- A monitor no longer fails if a function from the Polkadot API Server fails.
- A node that is removed from the API server is no longer declared as down. Now, the user is specifically informed about this scenario via a critical/warning alert if the node is a validator/full-node respectively. The user is then informed via an info alert whenever the operator adds the node back to the API server.
- PANIC no longer crashes if one of the nodes/repos is inaccessible during start-up. In this version, the monitor belonging to the inaccessible node/repo only does not start.
- (UI twilio) Fixed Twilio error not being reported when making a test call with an incorrectly formatted AccountSID or Auth Token.
Other
- (Security Vulnerability) Updated
package-lock.jsonto resolve theDenial of Servicevulnerability issue inreact-scripts. - Better file/folder layout and decomposition of components.
- The
run_setup.pyfile was renamed torun_alerter_setup.py, as a new setup script namedrun_ui_setup.pywas added for the UI. - A new config file was added for the UI named
user_config_ui.ini, and can be located in thepanic_polkadot/configfolder. - The
run_util_validate_configs.pynow also validates theuser_config_ui.iniconfig. - Added util
run_util_change_ui_auth_pass.pyto change the UI authentication password.
Update Instructions
To update an instance of PANIC to this version, run these commands inside the project directory:
git fetch # Fetch these changes
git checkout v2.1.0 # Switch to this version
# At this stage, you should stop the alerter and the UI
pipenv sync # Update dependenciesThe next step is to update your API server to the latest version. This can be done by following this. Note that this is a crucial step for PANIC to work as expected.
The next step is to follow one of the guides below depending on whether you were running PANIC from source, or using docker-compose.
Running from Source
Setup and Run the UI
Please start by setting up the UI using this guide. This is an important step to set up the new security requirements of the UI.
At this point make sure that you confirm that all the configs are valid. This can be done by running the following command in the project directory:
pipenv run python run_util_validate_configs.py # Validate configsContinue by navigating into the the UI directory and install the packages defined in package.json:
cd src/web/ui
npm ci --only=production # use sudo in linux if necessaryRe-build the UI, re-direct to the PANIC Polkadot directory, and start the UI
npm run-script build # use sudo in linux if necessary
cd ../../../
bash run_ui_server.shRestart the Alerter
Before running the alerter, first you need to clear Redis. This step will make sure that Redis keys won't clash due to the update. To do this please type the following command inside the project directory:
pipenv run python run_util_reset_redis.py # Update dependencies
# If multiple versions of Python are installed, the python executable may be `python3.6`, `python3.7`,The final step is to restart the alerter. If the alerter was running as a Linux service, the service should now be restarted:
sudo systemctl restart panic_alerterOtherwise, if you are not using Linux services perform this command in the project directory:
pipenv sync
pipenv run python run_alerter.py # use sudo in linux if necessary
# If multiple versions of Python are installed, the python executable may be `python3.6`, `python3.7`, etc.Run using Docker-Compose
Setup and Run the UI Container
Please start by setting up the UI using this guide. This is an important step to set up new the security requirements of the UI.
At this point make sure that you confirm that all the configs are valid. This can be done by running the following command in the project directory:
pipenv run python run_util_validate_configs.py # Validate configsThe next step is to obtain the updated UI docker image. This can either be done by re-building it manually or downloading it from Docker Hub.
Option 1: Building the Docker Image
Run the following command in the project directory to build the image:
docker-compose build uiOption 2: Downloading the Pre-Built Docker Image from Docker Hub
The pre-built Docker image can simply be downloaded by running the following command:
docker pull simplyvc/panic_polkadot_ui:2.0.0Run the UI docker image using this command:
docker-compose up -d uiUpdate and Run the Alerter Container
Start by obtaining the updated alerter docker image. This can either be done by re-building it manually or by downloading it from Docker Hub
Option 1: Building The Docker Image
Run the following command to build the image:
docker-compose build alerterOption 2: Downloading the Pre-Built Docker Image from Docker Hub
The pre-built Docker image can simply be downloaded by running the following command:
docker pull simplyvc/panic_polkadot:2.1.0The next step is to re-create the Redis container. This step will make sure that Redis keys won't clash due to the update. To do this please type the following command inside the project directory:
docker-compose kill redis
docker-compose rm redisFinally, you can run the alerter docker image as follows:
docker-compose up -d alerterv2.0.1
Released on 15th May 2020
This new version of PANIC fixes some UI related minor bugs.
Update Instructions
If you haven't updated to v2.0.0, it is very important to follow those update instructions first.
To update an instance of PANIC to this version, run these commands inside the project directory:
git fetch # Fetch these changes
git checkout v2.0.1 # Switch to this version
# At this stage, you should stop the alerter and the UI
pipenv sync # Update dependenciesFollow one of the guides below depending whether you were running PANIC from source, or using docker-compose.
Running from Source
First navigate into the the UI directory and install the packages defined in package.json:
cd src/web/ui
npm install # use sudo in linux if necessaryRe-build the UI, re-direct to the PANIC Polkadot directory, and start the UI
npm run-script build # use sudo in linux if necessary
cd ../../../
bash run_ui_server.shThe next step is to make sure that the inputs in the To and Phone numbers to dial fields in the E-mail Alerts and Twilio Alerts forms respectively are formatted as required by the Main page.
To make sure that the above step is correct, click on Save Config. The Main page should perform the validation itself.
For PANIC to detect changes in the configs (if any), the next step is to restart the alerter. If the alerter was running as a Linux service, the service should now be restarted:
sudo systemctl restart panic_alerterOtherwise, perform this command in the project directory:
pipenv sync
pipenv run python run_alerter.py # use sudo in linux if necessary
# If multiple versions of Python are installed, the python executable may be `python3.6`, `python3.7`, etc.Run using Docker-Compose
First, either re-build the docker image for the UI, or download it from Docker Hub.
Option 1: Building The Docker Image
Run the following command in the project directory to build the image:
docker-compose build uiOption 2: Downloading the Pre-Built Docker Image from Docker Hub
The pre-built Docker image can simply be downloaded by running the following command:
docker pull simplyvc/panic_polkadot_ui:1.0.1Run the UI docker image using this command:
docker-compose up -d uiThe next step is to make sure that the inputs in the To and Phone numbers to dial fields in the E-mail Alerts and Twilio Alerts forms respectively are formatted as required by the Main page.
To make sure that the above step is correct, click on Save Config. The Main page should perform the validation itself.
For PANIC to detect changes in the configs (if any), the next step is to restart the alerter container using this command:
docker-compose restart alerterBug Fixes
- (UI buttons) After they are clicked, the buttons will now have the same colour as the navigation bar rather than their colour getting stuck.
- (UI Main page) The
ToandPhone numbers to dialfields in theEmail alertsandTwilio alertsforms respectively were incorrectly set up to use comma separators instead of colon separators, which clashes with PANIC. Now, these fields can take multiple inputs separated with a colon.
v2.0.0
Released on 12th May 2020
First things first, this new version of PANIC is now compatible with the latest changes in the Polkadot API, and is packed with new features.
Users can now install our brand new Web UI to view the status of the nodes, alerter and view alerts in real-time. The Web UI can also be used for much simpler setting up and reconfiguration of PANIC, including switching on/off specific alerts.
But this is not all. Redis keys are now much more efficient and organized using hash-based functions, and we also included Mongo's status in Telegram.
As a way to facilitate the life of users running PANIC using docker, we also improved PANIC's docker installation using docker-compose.
Update Instructions
To update an instance of PANIC to this version, run these commands inside the project directory:
git fetch # Fetch these changes
git checkout v2.0.0 # Switch to this version
# At this stage, you should stop PANIC
pipenv sync # Update dependenciesGiven the recent overhaul of how PANIC uses Redis, we highly recommend clearing up Redis by running the run_util_reset_redis.py script using this command:
pipenv run python run_util_reset_redis.py # Reset redis. Replace 'python' with 'python3' if the latter was installedAlerter
PANIC can now be started up!
If the alerter was running as a Linux service, the service should now be restarted:
sudo systemctl restart panic_alerterFor all users running PANIC using Docker, we now have a new installation and running procedure using Docker-Compose.
Therefore, start by stopping the Mongo, Redis and alerter containers using this command:
docker kill <MONGO_CONTAINER_ID> <REDIS_CONTAINER_ID> <ALERTER_CONTAINER_ID>Now, proceed as follows:
- First install Docker-Compose if it is currently not installed on your system.
- Follow the instructions in this guide to re-build and re-run the images.
User Interface
To make use of the brand new PANIC Web UI:
- Running from source: Follow the instructions here
- Running using Docker and Docker-Compose: Follow the instructions here
Breaking Changes
- (redis) Nodes, blockchains, GitHub repositories, and monitor keys have been changed as a result of improvements in the use of Redis keys
Polkadot API Compatibility Changes
- (data wrapper) PANIC is now using different endpoints from the Polkadot API server due to changes in the polkadot-js/api
- To get the set of elected validators for the next session, PANIC is now using the
/api/derive/staking/validatorsendpoint instead of the/api/query/staking/currentElectedendpoint. - To get the bonded balance of a validator, PANIC is now using the
/api/query/staking/erasStakersendpoint instead of the/api/query/staking/stakersendpoint.
- To get the set of elected validators for the next session, PANIC is now using the
- (parsing) Some monitors are now expecting different JSON structures from the Polkadot API server due to updates in the polkadot-js/api.
- For ongoing referendums, the blockchain monitor expects the
/api/query/democracy/referendumInfoOfendpoint to return a JSON with the following structure:{ 'Ongoing': { 'proposalHash': '0x345jtg8ergfg8df89h9we9t9sd9g9gsd9g9sdfg', 'end': 124143848, 'threshold': 'Supermajorityapproval', 'delay': 11549, 'tally': { 'ayes': '4544545 KSM', 'nayes': '3454 KSM', 'turnout': '4545454454 KSM' } } }
- For ongoing referendums, the blockchain monitor expects the
Features
- (alerts) Added ability to switch on/off specific alerts via the alerts internal config (
internal_config_alerts.ini) - (web) Added the full implementation of the Web UI for PANIC. The operator can use this UI in the following ways:
- Use the
Dashboardpage to view the status of the nodes, chains and monitors. - Use the
Alerts→Logspage to view incoming alerts. The operator can also view historical alerts by navigating through this page. - Use the
Settings→ (Main,Nodes,Repos) pages to create theuser_config_main.ini,user_config_nodes.ini,user_config_repos.inifiles respectively. This facilitates the setting up process of PANIC. - Use the
Alerts→Preferencespage to switch on/off specific alerts. The operator can also switch off alerts of a particular severity.
- Use the
- (redis) Added hash-based
hset/hgetfunctions (and variations) to the Redis API - (telegram) Added Mongo's status in the Telegram
/statusoutput. - (docker) Dockerised the Web UI
- (docker) Added the functionality of using docker-compose to run the Web UI, Alerter, Mongo and Redis.
- Each component is able to restart automatically if it runs into an erroneous state and crashes.
Improvements
- (twilio) Added official support for TwiML. Configurable from the internal config to either a URL or raw TwiML instructions
- (redis) Centralised and streamlined Redis key usage in a new
store_keys.Keysclass - (redis) Keys for nodes from a blockchain and the blockchain itself are now grouped using hashes (
hset/hget) - (redis) Reduced code duplication in Redis API by defining a
_safefunction with common error-handling and default return value functionality - (timing) PANIC now saves date & time values in the store as UTC timestamps instead of datetime
Bug Fixes
- (setup) Repository names are now forced to be unique during setup. This is necessary to prevent key clashes in Redis
Other
- Renamed
internal_config.initointernal_config_main.ini - Moved RedisApi and MongoApi to
store/folder to match PANIC's design - Updated the documentation to be compatible with the latest changes.
v1.1.0
Released on 21st February 2020
This release of PANIC for Polkadot gives the operator more flexibility in how they want to use the tool. Although PANIC is happy to keep an eye on multiple nodes, the operator can now run PANIC with as little as one node.
The Polkadot API server that PANIC uses to extract data from nodes has been moved into its own repository and will thus have to be installed from there from now on. As a result of this, the config files and log files will now be expected to be in the project directories of the two separate tools. This is elaborated-on below.
As for new features, this version introduces MongoDB as a possible alerting channel. In future versions, the alerts stored in MongoDB will be used to present logs in a dashboard UI!
Update Instructions
Before updating PANIC to the new version, we strongly recommend that you clone and set up the Polkadot API server if you have not already done this.
Additionally, you should make backups of the logs/ and config/ folders under both api/ and alerter/. The API config folder can be moved to the now separate Polkadot API Server directory.
To update an instance of PANIC to this version:
git fetch # Fetch these changes
git checkout v1.1.0 # Switch to this version
# At this stage, you should stop PANIC
mv alerter/config/*.ini config/ # copy alerter configs to new location
mv alerter/logs/alerts/*.log logs/alerts/ # copy alerts logs to new location
mv alerter/logs/general/*.log logs/general/ # copy general logs to new location
# You might have to update permissions so that PANIC
# is able to create log files in the new logs folders
pipenv sync # Update dependencies
pipenv run python run_util_update_to_v1.1.0.py # Migrate config filesThe run_util_update_to_v1.1.0.py script updates the config files (now expected to be under config/) so that they become compatible with the v1.1.0 config files.
PANIC can now be started up!
- If the alerter was running as a Linux service, the service should now be restarted:
sudo systemctl restart panic_alerter- If the alerter was running on Docker, the docker image should now be started:
docker run -v <CONFIG_DIR>:/opt/panic_polkadot/config:ro \
-v <LOGS_DIR>:/opt/panic_polkadot/logs:rw \
-d simplyvc/panic_polkadot:1.1.0Features
- (channels) Added new MongoDB channel to be used by the dashboard UI (coming soon!)
Improvements
- (design) Code structure now closer to the design
- (config) Periodic alive reminder config variables now use
par_prefix to not get mixed up with other variables - (telegram) Node monitor block height is now not shown in Telegram if archive monitoring is disabled for the respective chain
- (monitoring) Validators can now be used as a data source for node indirect monitoring and blockchain monitoring by setting the variable
use_as_data_sourcetotruefor the validator in theconfig/user_config_nodes.iniconfig file. As a result, validator node monitors can use the validator they are monitoring as an indirect data source, however this is a last resort. - (monitoring) Validators can now be used as a data source for archive monitoring by setting the variables
use_as_data_sourceandis_archive_nodetotruefor the validator in theconfig/user_config_nodes.iniconfig file. As a result, the validator node monitors can use the validator they are monitoring as an archive data source, however this is a last resort.
Bug Fix
- (testing)
run_tests_with_coverage.shscript now includes--devcommand - (monitoring) If no data sources for a chain are given by the operator, the user is informed that no blockchain monitor will start for that chain, rather than the blockchain monitor not starting at all.
- (monitoring) If no archive data sources for a chain are given by the operator, the user is informed that archive monitoring is disabled for that chain, rather than not being informed at all.
- (monitoring) The node monitor can now perform direct monitoring without indirect monitoring for validators by giving no data sources.
Breaking Changes
- Separated Polkadot API Server into its own repository
- Alerter config files need to be moved manually from
alerter/config/<files>toconfig/<files>of this project. - API server config files need to be moved manually from
api/config/<files>toconfig/<files>of the API server. - Any service files or custom runners for the API server need to be pointed to the new instance of the API server.
- The provided PANIC runner (
run_alerter.py) has not changed location and is still in the project directory.
- Alerter config files need to be moved manually from
- Changed the name of some variables in the
user_config_nodesconfig file for clarity. These are:include_in_node_monitor→monitor_nodeinclude_in_blockchain_monitor→use_as_data_sourceinclude_in_github_monitor→monitor_repo
Additional note on the above:
- The new keys have a slightly different meaning.
monitor_nodestores whether a node should be monitored by a node monitoruse_as_data_sourcestores whether a node should be used as a data source for indirect monitoring, and archive monitoring if it is an archive nodemonitor_repostores whether the GitHub repo should be monitored using a GitHub monitor.
- If the
run_util_update_configs_to_v1.1.0.pyis run to update the configs, the key values formonitor_nodeanduse_as_data_sourceare set astrue, whilst for themonitor_repothe value is set to the old value of theinclude_in_github_monitorkey.