A Discord bot for monitoring UOMI Network validators, providing real-time alerts and status updates for validator performance, slashing events, and network participation.
-
Real-time Monitoring
- Track validator entry/exit from the active set
- Monitor performance metrics and commission rates
- Detect slashing events
- Track inactivity thresholds (10%, 25%, 50%)
-
Notification System
- Customizable alerts for followed validators
- Performance threshold notifications
- Slashing event alerts
- Active set changes notifications
-
User Commands
!follow <address>
- Follow a validator for notifications!unfollow <address>
- Stop following a validator!following
- List all validators you're following!status <address>
- Get detailed validator status!help
- Display all available commands
- Node.js (v16 or higher)
- npm or yarn
- Discord Bot Token
- Access to a UOMI Network node
-
Clone the repository:
git clone https://github.com/yourusername/uomi-validator-bot.git cd uomi-validator-bot
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory with the following variables:DISCORD_TOKEN=your_discord_bot_token DISCORD_CHANNEL_ID=your_channel_id SUBSTRATE_WS_URL=your_node_websocket_url CHAIN_SS58_PREFIX=87 COOLDOWN_DAYS=14
The bot can be configured through environment variables:
DISCORD_TOKEN
: Your Discord bot tokenDISCORD_CHANNEL_ID
: Channel ID for notificationsSUBSTRATE_WS_URL
: WebSocket URL for your UOMI node (default: ws://localhost:9944)CHAIN_SS58_PREFIX
: UOMI Network SS58 prefix (default: 87)COOLDOWN_DAYS
: Notification cooldown period in days (default: 14)
-
Start the bot:
npm start
-
The bot will automatically:
- Connect to Discord
- Connect to the UOMI Network
- Load saved validator and follower data
- Begin monitoring validators
-
Validator Status
- Active/Inactive status
- Commission rates
- Era points and performance
- Identity information
- Slashing history
-
Alert Thresholds
- Inactivity alerts at 10%, 25%, and 50%
- Slashing event notifications
- Active set entry/exit alerts
The bot maintains two JSON files for data persistence:
validators.json
: Stores validator information and notification historyfollowers.json
: Stores user-validator following relationships
The bot includes comprehensive error handling for:
- Network connectivity issues
- Invalid addresses
- API failures
- Discord API rate limits
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
For support, please join our Discord server or open an issue in this repository.