docs
Getting Started

Getting Started

Quick Start

GSwarm is a Telegram monitoring service for Gensyn AI that provides real-time notifications about your blockchain activity. Here's how to get started:

1. Install GSwarm

go install github.com/Deep-Commit/gswarm/cmd/gswarm@latest

2. Run the Service

gswarm

The service will guide you through the setup process interactively.

Basic Usage

Interactive Setup (Default)

When run for the first time, the service will prompt for all necessary configuration:

gswarm

You'll be guided through:

  1. Telegram Bot Token: Get this from @BotFather on Telegram
  2. Telegram Chat ID: Your personal chat ID or group chat ID
  3. EOA Address: Your Ethereum address from the Gensyn dashboard

Command Line Options

FlagDescriptionDefaultEnvironment Variable
--telegram-config-pathPath to telegram-config.json filetelegram-config.jsonGSWARM_TELEGRAM_CONFIG_PATH
--update-telegram-configForce update of Telegram config via CLI promptsfalseGSWARM_UPDATE_TELEGRAM_CONFIG

Environment Variables

All flags can be set via environment variables with the GSWARM_ prefix:

export GSWARM_TELEGRAM_CONFIG_PATH=/path/to/config.json
export GSWARM_UPDATE_TELEGRAM_CONFIG=true
gswarm

Telegram Setup

1. Create a Telegram Bot

  1. Start a chat with @BotFather (opens in a new tab) on Telegram
  2. Send /newbot and follow the instructions
  3. Choose a name for your bot (e.g., "GSwarm Monitor")
  4. Choose a username (must end with 'bot', e.g., "gswarm_monitor_bot")
  5. Save the bot token provided by BotFather

2. Get Your Chat ID

  1. Start a chat with your bot by clicking the link or searching for it
  2. Send any message to the bot (e.g., "Hello")
  3. Visit this URL in your browser (replace YOUR_BOT_TOKEN with your actual token):
    https://api.telegram.org/botYOUR_BOT_TOKEN/getUpdates
  4. Find your chat ID in the response (look for "chat":{"id":123456789})

3. Get Your EOA Address

  1. Log into your Gensyn dashboard (opens in a new tab)
  2. Navigate to your account settings or profile section
  3. Copy your Ethereum address (EOA) - this is required for monitoring your blockchain activity

Usage Examples

# Start monitoring service (interactive setup)
gswarm
 
# Use custom config path
gswarm --telegram-config-path /path/to/config.json
 
# Force update Telegram config
gswarm --update-telegram-config
 
# Show version
gswarm version

What GSwarm Monitors

The 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
  • Peer ID Activity: Monitoring of all peer IDs associated with your EOA address
  • Welcome Message: Initial setup confirmation

Sample Notifications

Here's what you'll receive in your Telegram chat:

🚀 G-Swarm Update

📊 Blockchain Data Update

👤 EOA Address: 0x1234567890abcdef...
🔍 Peer IDs Monitored: 4

📈 Total Votes: 1,456 📈
💰 Total Rewards: 0.75 ETH 📈

📋 Per-Peer Breakdown:
🔹 Peer 1: QmZkyXja166VBTMU76xLR17XKAny9kAkFgx4fNpoceQ8LT
   📈 Votes: 22
   💰 Rewards: 3075

🔹 Peer 2: QmYJeqmiqLNC5cosqE76wZSVdBEHL5Mq9zwFUX61d2fAzn
   📈 Votes: 0
   💰 Rewards: 0

⏰ Last Check: 2025-06-20 20:05:23

Configuration Files

GSwarm stores configuration locally in the following structure:

~/.gswarm/
├── telegram-config.json      # Telegram configuration
└── telegram_previous_data.json # Previous blockchain data

telegram-config.json

This file contains your Telegram bot configuration:

{
  "botToken": "your_bot_token_here",
  "chatID": 123456789,
  "eoaAddress": "0x1234567890abcdef..."
}

Troubleshooting

Common Issues

  1. "Bot token invalid"

    • Verify your bot token from @BotFather
    • Use --update-telegram-config to re-enter it
  2. "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
  3. "No notifications received"

    • Check that your bot is active
    • Verify the chat ID is correct
    • Ensure you have blockchain activity to monitor
  4. "EOA address not found"

    • Get your EOA address from the Gensyn dashboard
    • Make sure the address starts with "0x" and is 42 characters long
    • Verify the address is correct
  5. "No peer IDs found"

    • Ensure your EOA address is correct
    • Check that you have active peer IDs on the Gensyn network
    • The service will automatically detect and monitor all your peer IDs

Next Steps

After setting up GSwarm:

  1. Monitor your notifications - Check your Telegram for updates
  2. Customize your setup - See Advanced Usage for more options
  3. Get help - Check the FAQ for common questions
  4. Report issues - Use GitHub issues for bug reports

Support

  • Documentation: Check the Telegram Monitoring guide for detailed setup
  • FAQ: See FAQ for common questions and solutions
  • Issues: Report bugs on GitHub
  • Community: Join discussions on GitHub