A Telegram bot that monitors and announces new deposits on the blockchain using Ghost. The bot sends beautifully formatted messages with transaction details and celebratory GIFs to your specified Telegram channels.
This example demonstrates monitoring deposits for Zeru Finance.
- Fork the GhostGraph from Ghost
- Clone this repository
- Copy
.env.exampleto.env - Configure your environment variables
- Install dependencies and run the bot
- Node.js 16.x or higher
- npm or yarn
- A Telegram account
- Access to Ghost
- Follow this blog article for step-by-step walkthrough
Copy .env.example to .env:
cp .env.example .env-
TELEGRAM_BOT_TOKEN
- Create a new bot using @BotFather on Telegram
- Send
/newbotto BotFather and follow the instructions - Copy the provided token to
TELEGRAM_BOT_TOKEN
-
GHOST_GRAPH_URL
- Fork the GhostGraph from here
- Go to your forked graph
- Click "Deploy" button
- Copy the provided query URL to
GHOST_GRAPH_URL
-
CHANNEL_IDS
- Add your bot to the desired Telegram channels as an admin
- To get a channel's ID, you have several options:
- Use the Web Version:
- Open your channel in web.telegram.org
- The channel ID will be in the URL after the hash (#)
- You'd want to replace
#-with-100 - For example,
#-1234564363will turn into-1001234564363
- Use the Web Version:
- For multiple channels, separate IDs with commas
- Example:
CHANNEL_IDS="-1001234567890,-1009876543210"
Example .env file:
TELEGRAM_BOT_TOKEN=1234567890:ABCdefGHIjklMNOpqrsTUVwxyz
GHOST_GRAPH_URL=https://api.ghostlogs.xyz/gg/pub/uniqueIdHere/ghostgraph
CHANNEL_IDS=<YOUR_CHANNEL_ID>- Install dependencies:
npm install
# or
yarn install- Start the bot:
npm start
# or
yarn startEach deposit notification includes:
- Amount in ETH
- User address (with explorer link)
- Reserve address (with explorer link)
- Transaction hash (with explorer link)
- Timestamp
- Random celebratory GIF
-
Bot not sending messages?
- Verify the bot is an admin in the channel
- Double-check the channel IDs
- Ensure your
TELEGRAM_BOT_TOKENis correct
-
No events being received?
- Verify your GhostGraph is properly forked and deployed
- Check the
GHOST_GRAPH_URLis correct - Ensure the query url endpoint is accessible
If you have any questions or need help, join our Telegram community at https://t.me/ghostlogsxyz
This project is licensed under the MIT License - see the LICENSE-MIT file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
