A working example project that uses OpenClaw to send multi-chain on-chain alerts (Solana + Ethereum/EVM) to your chat (WhatsApp, Telegram, Discord, etc.).
- Watches Solana:
- Address watch: If you set
WATCH_ADDRESS, every transaction touching that account triggers an alert with signature and Solscan link. - Slot watch: If you don’t set an address, the sentry watches slot height and alerts when it jumps by more than a threshold (e.g. reorg or catch-up).
- Address watch: If you set
- Watches Ethereum (EVM) (optional): Set
RPC_URL_ETHto enable.- Address watch: If you set
WATCH_ADDRESS_ETH, every incoming/outgoing tx for that address is alerted (with Etherscan/block explorer link). - Block watch: If you don’t set an address, the sentry watches block number and alerts on large jumps (reorg/catch-up).
- Works with any EVM chain (Ethereum mainnet, Base, Arbitrum, etc.) by setting the right RPC and explorer URLs.
- Address watch: If you set
- Sends alerts via:
- OpenClaw (
openclaw message send) so messages appear in your configured channel (Telegram, WhatsApp, Discord, etc.). - Optional webhook (e.g. Discord/Slack) for testing without OpenClaw.
- OpenClaw (
- Node.js 18+
- OpenClaw (optional): Install OpenClaw, run the gateway, and pair at least one channel (e.g. Telegram). Then set
OPENCLAW_ALERT_TARGETto the recipient where you want alerts (e.g. your Telegram chat id).
cd openclaw/on-chain-sentry
cp .env.example .env
# Edit .env: set OPENCLAW_ALERT_TARGET and/or ALERT_WEBHOOK_URL
npm install
npm start
# Or after building: npm run build && node dist/index.jsYou should see:
[sentry] On-Chain Sentry started
[sentry] OpenClaw target: set
[sentry] Solana RPC: https://api.devnet.solana.com
[sentry] Ethereum RPC: https://eth.llamarpc.com # only if RPC_URL_ETH is set (or set ETH_CHAIN_NAME for Base/Arbitrum/etc.)
[sentry] Watching address: <your WATCH_ADDRESS>
If OpenClaw or webhook is set, a startup ping is sent. New activity (or slot jumps) will trigger alerts in that channel.
| Variable | Description |
|---|---|
| Solana | |
RPC_URL |
Solana RPC URL. Default: https://api.devnet.solana.com. Use a mainnet RPC (e.g. Helius) for production. |
WATCH_ADDRESS |
Optional. Solana public key to watch; every tx touching it is alerted. |
SLOT_JUMP_THRESHOLD |
Alert when Solana slot advances by more than this (default: 20). |
SOLSCAN_CLUSTER |
Optional. Makes Solscan links match your cluster: devnet, testnet, or omit for mainnet. |
| Ethereum (EVM) | Set RPC_URL_ETH to enable. |
RPC_URL_ETH |
Ethereum/EVM RPC URL (e.g. https://eth.llamarpc.com, https://mainnet.base.org). Omit to disable Ethereum. |
ETH_CHAIN_NAME |
Optional. Label used in logs/alerts (e.g. Base, Arbitrum, Ethereum). |
WATCH_ADDRESS_ETH |
Optional. Ethereum address (0x...) to watch; every in/out tx is alerted. |
ETH_EXPLORER_TX |
Block explorer tx URL (default: https://etherscan.io/tx). Use https://basescan.org/tx for Base, etc. |
ETH_EXPLORER_BLOCK |
Block explorer block URL (default: https://etherscan.io/block). |
ETH_BLOCK_JUMP_THRESHOLD |
Alert when Ethereum block number jumps by more than this (default: 20). |
| Alerts | |
OPENCLAW_ALERT_TARGET |
OpenClaw recipient (e.g. Telegram chat id). Required for delivery to OpenClaw channels. |
ALERT_WEBHOOK_URL |
Optional. Discord or Slack webhook URL for testing without OpenClaw. |
POLL_INTERVAL_MS |
Poll interval in ms for all chains (default: 15000). |
NOTIFY_TIMEOUT_MS |
Optional. Timeout (ms) for OpenClaw CLI + webhook requests (default: 15000). |
- Install and run OpenClaw (see docs.clawd.bot).
- Pair a channel (e.g. Telegram):
openclaw channels loginand complete pairing. - Get your target: For Telegram, the target is typically your chat id (e.g. from a bot or the OpenClaw UI). Set it as
OPENCLAW_ALERT_TARGETin.env. - Start the sentry:
npm start. Alerts are sent viaopenclaw message send --target $OPENCLAW_ALERT_TARGET --message "...".
Copy or link the skill so the OpenClaw agent can answer questions about the sentry:
# If your OpenClaw workspace is ~/clawd:
mkdir -p ~/clawd/skills/on-chain-sentry
cp -r openclaw/on-chain-sentry/skills/on-chain-sentry/* ~/clawd/skills/on-chain-sentry/Then you can ask the agent: “What is the on-chain sentry?” or “How do I add a watched address?”
# With nohup
nohup npm start > sentry.log 2>&1 &
# Or use a process manager (pm2, systemd, etc.)on-chain-sentry/
├── src/
│ ├── index.ts # Entry: loads config, starts Solana + optional Ethereum watchers
│ ├── watcher.ts # Solana: address or slot watch
│ ├── watcher-ethereum.ts # Ethereum/EVM: address or block watch
│ └── notify.ts # Sends alerts via OpenClaw CLI or webhook
├── skills/on-chain-sentry/
│ └── SKILL.md # OpenClaw skill for “what is sentry / how to configure”
├── .env.example
├── package.json
└── README.md
Run tests and build: npm run build && node dist/index.js (no tsx required). Use npm run watch for development with auto-reload.
- Alerts not arriving: Ensure
OPENCLAW_ALERT_TARGETis set and the OpenClaw gateway is running (openclaw gateway). For webhook testing, useALERT_WEBHOOK_URLwith a Discord or Slack webhook. - RPC rate limits: Increase
POLL_INTERVAL_MS(e.g. 30000) or use a paid RPC provider for production.
MIT.