A Rust application that monitors blockchain network data from various APIs and sends notifications via Telegram when changes are detected.
This project can be used to track changes in JSON arrays, for my case, I'm using it for discovering appearing blockchains.
- Monitors multiple blockchain network data sources (Ethereum List, Geckoterminal, Stargate Chains)
- Detects additions and removals of network entries
- Sends Telegram notifications on changes
- Caches previous state for comparison
- Supports multiple data source types through a generic architecture
- Rust (latest stable version)
- Cargo (comes with Rust)
- Telegram Bot Token and Chat ID (for notifications)
If you don't have Rust installed, follow the instructions at rustup.rs.
git clone <repository-url>
cd market-discoverer
cargo build --releaseCreate a .env file in the project root with your Telegram credentials:
TG_BOT_TOKEN=your_bot_token_here
TG_CHAT_ID=your_chat_id_here
TG_THREAD_ID=your_thread_id_hereGetting Telegram Credentials:
- Bot Token: Create a bot via @BotFather on Telegram
- Chat ID: Use @userinfobot to get your chat ID
- Thread ID: Optional, for thread-specific notifications in groups
Configuration files are located in the config/ directory. Example configurations are provided:
config/ethereum_list.toml- Ethereum chain listconfig/geckoterminal.toml- Geckoterminal networksconfig/stargate_chains.toml- Stargate chains
Each config file follows this format:
name = "Source Name"
data_endpoint_url = "https://api.example.com/endpoint"
cache_file_path = "cache/filename.json"Run the application with a configuration file:
cargo run --release config/ethereum_list.tomlOr use the compiled binary:
./target/release/market-discoverer config/ethereum_list.toml# Monitor Ethereum chain list
cargo run --release config/ethereum_list.toml
# Monitor Geckoterminal networks
cargo run --release config/geckoterminal.toml
# Monitor Stargate chains
cargo run --release config/stargate_chains.tomlSet the log level using the RUST_LOG environment variable:
# Debug logging
RUST_LOG=debug cargo run --release config/ethereum_list.toml
# Info logging (default)
RUST_LOG=info cargo run --release config/ethereum_list.toml
# Error logging only
RUST_LOG=error cargo run --release config/ethereum_list.toml- Initialization: On first run, the application fetches data from the configured API and stores it in the cache file
- Monitoring: On subsequent runs, it compares the current API response with the cached data
- Detection: Identifies added and removed entries
- Notification: Sends Telegram messages for each change detected
- Update: Updates the cache file with the latest data
market-discoverer/
├── src/
│ ├── main.rs # Main entry point
│ ├── lib.rs # Library root
│ ├── config.rs # Configuration parsing
│ ├── fetch.rs # API data fetching
│ ├── process.rs # Core processing logic
│ ├── json.rs # JSON file operations
│ ├── telegram.rs # Telegram notifications
│ └── types/ # Type definitions
│ ├── common.rs # Common traits (Entry, ResponseData)
│ ├── ethereum_list/ # Ethereum List types
│ ├── geckoterminal/ # Geckoterminal types
│ └── stargate_api/ # Stargate API types
├── config/ # Configuration files
├── cache/ # Cached data (gitignored)
└── Cargo.toml # Rust dependencies
To add a new data source:
- Create type definitions in
src/types/<source_name>/ - Implement
ResponseDataandEntrytraits - Create a config file in
config/ - Update the main binary to use the new type
MIT, bruv