MongoTron API Server: β
Running on http://localhost:8080
MongoDB: β
Connected to nileVM.lan:27017
Tron Node: β
Connected to nileVM.lan:50051 (Nile Testnet)
Active Subscriptions: β
3 subscriptions, 3,538+ events captured
# Check if server is running
curl http://localhost:8080/api/v1/subscriptions | jq '.subscriptions[] | select(.status=="active") | {id: .subscriptionId, events: .eventsCount}'
# Expected output: List of active subscriptions with event countscd /home/user0/Github/mongotron
source .venv/bin/activate
python event_monitor.pyWhat you'll see:
- Real-time blockchain events
- Human-readable Tron addresses (not hex!)
- Transaction details (TX hash, block, timestamp)
- Events logged to timestamped file
Example Output:
================================================================================
π TRANSACTION EVENT #1 - TriggerSmartContract
================================================================================
π TX ID: 28afe626e98ad2e3c2eb750da1999f585d398feccb21c87ff63c26970006016b
π¦ Block: 61090425
β° Time: 2025-10-05 23:31:33
β
Success: True
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π ADDRESSES:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
From (hex): 4185e86b92fe197f8e78fb2ea78c10122ed41118e1
From: TNBFJQqkebEQau7HsdxPzYJbB2XUrZK3Ue
To (hex): 41eca9bc828a3005b9a3b909f2cc5c2a54794de05f
To: TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Get last 5 events
curl http://localhost:8080/api/v1/events?limit=5 | jq '.events[] | {block: .blockNumber, from: .data.from, to: .data.to}'
# Count total events
curl http://localhost:8080/api/v1/events | jq '.total'# Real-time log monitoring
tail -f /tmp/api-server.log
# Last 50 lines
tail -50 /tmp/api-server.log
# Search for errors
grep -i error /tmp/api-server.logpkill -f "bin/api-server"cd /home/user0/Github/mongotron
pkill -f "bin/api-server" && sleep 2
nohup ./bin/api-server > /tmp/api-server.log 2>&1 &cd /home/user0/Github/mongotron
go build -o bin/api-server cmd/api-server/main.gocurl -X POST http://localhost:8080/api/v1/subscriptions \
-H "Content-Type: application/json" \
-d '{
"address": "TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf",
"filters": {"onlySuccess": true},
"startBlock": -1
}' | jq .# Edit event_monitor.py line ~454
# Change: address = "TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf"
# To: address = "YOUR_TRON_ADDRESS_HERE"
# Then run:
source .venv/bin/activate
python event_monitor.py# This feature requires API enhancement
# Currently, you can filter in MongoDB directly:
mongosh "mongodb://mongotron:MongoTron2025@nileVM.lan:27017/mongotron" --eval '
db.events.find({
blockNumber: { $gte: 61090000, $lte: 61100000 }
}).limit(10).pretty()
'- Main Config:
configs/.env - YAML Config:
configs/mongotron.yaml - Python Requirements:
requirements.txt
# From configs/.env
MONGOTRON_PORT=8080
TRON_NODE_HOST=nileVM.lan
TRON_NODE_PORT=50051
MONGODB_URI=mongodb://mongotron:MongoTron2025@nileVM.lan:27017/mongotronUSDT on Nile Testnet:
- Address:
TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf - Type: TRC20 Token
- Network: Tron Nile Testnet
- Explorer: https://nile.tronscan.org/#/contract/TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf
# Check if port 8080 is in use
lsof -i :8080
# Check configuration
cat configs/.env | grep -E "TRON_NODE|MONGODB"
# View recent logs
tail -100 /tmp/api-server.log# Check active subscriptions
curl http://localhost:8080/api/v1/subscriptions | jq '.subscriptions[] | select(.status=="active")'
# Verify block processing
curl http://localhost:8080/api/v1/subscriptions | jq '.subscriptions[0].currentBlock'
# Check MongoDB connection
mongosh "mongodb://mongotron:MongoTron2025@nileVM.lan:27017/mongotron" --eval "db.events.count()"# Check Python environment
source .venv/bin/activate
python --version
# Install dependencies
pip install -r requirements.txt
# Test connection
curl http://localhost:8080/api/v1/subscriptions- β STARTUP_GUIDE.md - Complete startup procedures
- β SERVER_STATUS.md - Current system status
- β ADDRESS_CONVERSION_SUCCESS.md - Human-readable address feature
- β BUGFIX_DOUBLE_DELETION.md - Recent bug fixes
- β EVENT_LOGGING_GUIDE.md - Event logging details
# View all documentation
ls -1 *.md
# Read startup guide
cat STARTUP_GUIDE.md
# Read server status
cat SERVER_STATUS.md-
Open Terminal 1 - Start the monitor:
cd /home/user0/Github/mongotron source .venv/bin/activate python event_monitor.py
-
Open Terminal 2 - Trigger a transaction (optional):
# Visit Nile testnet faucet to get test USDT # Send USDT to any address # Your monitor will capture the transaction!
-
Watch Terminal 1 - See the event appear in real-time with:
- Transaction hash
- Block number
- Human-readable addresses
- Timestamp
-
Check the Log File:
ls -lh events_*.log tail events_*.log
cd /home/user0/Github/mongotron
source .venv/bin/activate
nohup python event_monitor.py > /tmp/monitor.log 2>&1 &
# View output
tail -f /tmp/monitor.logcurl http://localhost:8080/api/v1/subscriptions | \
jq '.subscriptions[] | select(.status=="active") | {id, events: .eventsCount, block: .currentBlock}'curl http://localhost:8080/api/v1/events?limit=100 > events_backup.json
cat events_backup.json | jq '.events | length'Your MongoTron system is fully operational:
β
API Server running on port 8080
β
Connected to MongoDB (nileVM.lan)
β
Connected to Tron Nile testnet (nileVM.lan)
β
3 active subscriptions monitoring USDT
β
3,538+ events already captured
β
Event monitor ready to use
β
Human-readable address conversion working
Just run: python event_monitor.py to see live events!
Created: October 6, 2025
Status: β
Everything is working!