Introduction
For the Hacktober week 2 I choose to work on an issue from Shardeum on their Validator Dashboard. Shardeum is a highly scalable, EVM-compatible blockchain that aims to offer low-cost, decentralized, and secure services. Its architecture is built on the principle of dynamic state sharding, where the network automatically expands by adding more validator nodes as the demand for resources increases, allowing Shardeum to maintain high throughput and decentralization.
What is the Shardeum Validator Dashboard?
The Shardeum Validator Dashboard is a tool that allows node operators to monitor and manage their validator nodes. These validator nodes play a key role in maintaining the network's consensus and processing transactions securely. The dashboard provides an interface for operators to check the health of their nodes, configure settings, and ensure they are functioning correctly in the Shardeum network.
The Issue
The Validator Dashboard relies on a number of environment variables for configuration, such as port numbers, IP addresses, and node settings. However, there was no comprehensive validation in place to ensure that these environment variables were correctly set before launching the dashboard. This lack of validation led to silent failures or misconfigurations, which could cause the node to malfunction or behave unexpectedly. For example:
- Invalid port numbers or IP addresses could prevent the node from communicating properly.
- A weak dashboard password could expose the node to security risks.
- Missing or incorrectly configured node parameters like
minNodes
ornodesPerConsensusGroup
could lead to improper operation of the consensus mechanism.
The Solution
I created a reusable script check-variables.sh
that contains functions for validating each type of environment variable. This script can be sourced by other scripts (like entrypoint.sh
and installer.sh
), making the validation process centralized and easier to maintain.
I hope it have a great impact in the Shardeum. I had a great time hacking in their repository. And their team was really nice providing help and information.
Top comments (0)