Bajoel32/web3-on-chain-threat-alert
GitHub: Bajoel32/web3-on-chain-threat-alert
基于 n8n 的 Web3 链上实时监控系统,通过 Etherscan API 自动追踪巨鲸交易与潜在安全威胁并推送 Telegram 通知。
Stars: 0 | Forks: 0
# 🚨 Web3 链上威胁与巨鲸警报监控器
一个使用 **n8n**、**Node.js** 和 **Etherscan API** 构建的自动化、实时 Web3 事件响应与巨鲸追踪系统。
此工作流可持续监控目标智能合约或 EVM 钱包地址的高价值交易及潜在安全威胁,并向 Telegram 直接发送即时通知。
## 🛠️ 系统架构
```
┌─────────────────┐ ┌───────────────────────┐ ┌────────────────────────┐
│ Every 2 Minutes │ ──► │ Fetch Etherscan Txlist│ ──► │ Filter & Format Alerts │
└─────────────────┘ └───────────────────────┘ └───────────┬────────────┘
│
┌─────────────────┐ ┌───────────────────────┐ │
│ Telegram Alert │ ◄── │ Dedupe By Tx Hash │ ◄───────────────┘
└─────────────────┘ └───────────────────────┘
Workflow Pipeline Breakdown:
1. Schedule Trigger (Every 2 Minutes): Polls the network at 2-minute intervals.
2. HTTP Request (Fetch Etherscan Txlist): Retrieves the latest transaction list for a targeted contract/wallet via Etherscan API.
3. Code Node (Filter & Format Alerts): Executes custom JavaScript logic to inspect:
* Whale Movements: Transactions with values > 50 ETH.
* Security Threats: Interactions with known blacklisted addresses or abnormally high gas limits (> 1,000,000 gas).
4. Deduplication (Dedupe By Tx Hash): Prevents duplicate alerts by maintaining an execution history of txHash (up to 10,000 items).
5. Telegram Alert (Telegram Alert): Delivers clean, Markdown-formatted notifications with direct Etherscan transaction links.
⚡ Setup & Installation
PrerequisitesAn
* An active n8n instance (Cloud or Self-Hosted).
* An Etherscan API Key (Free tier from Etherscan).
* A Telegram Bot Token and your Telegram Chat ID (via @BotFather & @userinfobot).
Step-by-Step GuideDownload Workflow:
1. Download the workflow.json file from this repository.
2. Import to n8n:
* Open your n8n canvas.
* Click the top-right menu (...) -->
Import from File.
* Select workflow.json.Configure
3. Credentials:Etherscan:
* Set up your httpQueryAuth credential with your Etherscan API key (apikey).
* Telegram: Set up your telegramApi credential with your Bot Token and enter your chatId.
4. Activate: Toggle the workflow status to Active.
```
标签:MITM代理, 数据可视化