Telegram Monitoring
GSwarm includes a powerful Telegram monitoring service that provides real-time notifications about your blockchain activity, including votes, rewards, and balance changes.
Features
- 🔔 Real-time Notifications: Get instant updates on blockchain activity
- 📊 Vote Tracking: Monitor your voting activity and changes
- 💰 Reward Monitoring: Track reward accumulation and changes
- 💎 Balance Updates: Monitor your wallet balance changes
- 📈 Change Detection: Only notified when values actually change
- 🛡️ Secure Configuration: Local config file storage
Prerequisites
Before setting up Telegram monitoring, you'll need:
- EOA Address: Get your Ethereum address from your Gensyn dashboard (opens in a new tab)
- Telegram Account: A Telegram account to receive notifications
Setup Instructions
1. Get Your EOA Address
- Log into your Gensyn dashboard (opens in a new tab)
- Navigate to your account settings or profile section
- Copy your Ethereum address (EOA) - this is required for monitoring your blockchain activity
2. Create a Telegram Bot
- Start a chat with @BotFather (opens in a new tab) on Telegram
- Send
/newbot
and follow the instructions - Choose a name for your bot (e.g., "GSwarm Monitor")
- Choose a username (must end with 'bot', e.g., "gswarm_monitor_bot")
- Save the bot token provided by BotFather
3. Get Your Chat ID
- Start a chat with your bot by clicking the link or searching for it
- Send any message to the bot (e.g., "Hello")
- Visit this URL in your browser (replace
YOUR_BOT_TOKEN
with your actual token):https://api.telegram.org/botYOUR_BOT_TOKEN/getUpdates
- Find your chat ID in the response (look for
"chat":{"id":123456789}
)
4. Run the Telegram Service
# Basic usage (will prompt for bot token, chat ID, and EOA address)
gswarm --telegram
# With custom config path
gswarm --telegram --telegram-config-path /path/to/telegram-config.json
# Force update configuration
gswarm --telegram --update-telegram-config
Telegram Command Options
Flag | Description | Default | Environment Variable |
---|---|---|---|
--telegram | Start Telegram monitoring service | false | GSWARM_TELEGRAM |
--telegram-config-path | Path to telegram-config.json | telegram-config.json | GSWARM_TELEGRAM_CONFIG_PATH |
--update-telegram-config | Force update of Telegram config | false | GSWARM_UPDATE_TELEGRAM_CONFIG |
Configuration Files
The Telegram service creates and manages these files:
telegram-config.json
: Stores your bot token, chat ID, and EOA addresstelegram_previous_data.json
: Tracks previous blockchain data for change detection
Example Usage
# First time setup (interactive)
gswarm --telegram
# Run with existing config
gswarm --telegram
# Update configuration
gswarm --telegram --update-telegram-config
# Custom config path
gswarm --telegram --telegram-config-path /path/to/telegram-config.json
What You'll Receive
The Telegram service monitors and notifies you about:
- Vote Changes: When your vote count increases or decreases
- Reward Changes: When your accumulated rewards change
- Balance Changes: When your wallet balance changes
- Welcome Message: Initial setup confirmation
Sample Notifications
Vote Update
🎯 Vote Update
Previous: 1,234 votes
Current: 1,456 votes
Change: +222 votes (+18.0%)
Reward Update
💰 Reward Update
Previous: 0.5 ETH
Current: 0.75 ETH
Change: +0.25 ETH (+50.0%)
Balance Update
💎 Balance Update
Previous: 2.1 ETH
Current: 2.3 ETH
Change: +0.2 ETH (+9.5%)
Troubleshooting Telegram
"Bot token invalid"
- Verify your bot token from @BotFather
- Use
--update-telegram-config
to re-enter it
"Chat ID not found"
- Make sure you've sent a message to your bot
- Check the getUpdates URL response
- Use
--update-telegram-config
to re-enter it
"EOA address not found"
- Get your Ethereum address from your Gensyn dashboard (opens in a new tab)
- Use
--update-telegram-config
to re-enter it
"No notifications received"
- Check that your bot is active
- Verify the chat ID is correct
- Ensure you have blockchain activity to monitor
- Confirm your EOA address is correct
How Telegram Monitoring Works
The Telegram monitoring service:
- Monitors blockchain data via Alchemy API using your EOA address
- Tracks changes in votes, rewards, and balance
- Sends formatted notifications via Telegram Bot API
- Implements change detection to avoid spam notifications
- Stores configuration securely in local files
Security Considerations
- Bot tokens and EOA addresses are stored locally in
telegram-config.json
- No sensitive data is transmitted beyond your bot token, chat ID, and EOA address
- Configuration files should be kept secure and not shared publicly
- The service only reads blockchain data and doesn't modify any settings
Integration with Main Supervisor
You can run Telegram monitoring alongside the main supervisor:
# Run both supervisor and Telegram monitoring
gswarm --telegram --org-id YOUR_ORG_ID --hf-token YOUR_TOKEN
# Run only Telegram monitoring (if supervisor is already running)
gswarm --telegram
Advanced Configuration
Custom Notification Intervals
The service checks for updates every 30 seconds by default. You can modify this by editing the source code if needed.
Multiple Chat Support
Currently, the service supports one chat ID per configuration. For multiple recipients, you can:
- Add multiple users to a Telegram group
- Use the group chat ID instead of individual chat IDs
- Create multiple bot instances if needed
Notification Filtering
The service only sends notifications when values actually change. This prevents spam and ensures you only get meaningful updates.
Next Steps
Now that you have Telegram monitoring set up:
- Test the notifications by running the service
- Monitor your blockchain activity in real-time
- Configure additional notification preferences if needed
- Explore Advanced Usage for more complex setups