This Telegram bot provides real-time monitoring and interaction with the Lightning Network (LN) and Bitcoin blockchain. It offers functionalities such as node information, channel details, recent transactions, forwarding events, and Bitcoin price updates.
- Node Info: Displays detailed node information including CPU usage, memory, disk space, and CPU temperature.
- Channel Info: Provides information about each Lightning channel, including capacity and balances.
- Recent Transactions: Lists recent on-chain and Lightning transactions with timestamps.
- Forwarding Transactions: Shows recent forwarding events with detailed information.
- Bitcoin Info: Displays Bitcoin price and network fee estimates in USD and EUR.
- Python 3.8+
grpcio
andgrpcio-tools
python-telegram-bot
psutil
requests
-
Clone the Repository:
git clone https://github.com/yourusername/yourrepository.git cd yourrepository
-
Install Dependencies:
Ensure you have
pip
installed. Then install the required Python packages:pip install -r requirements.txt
Alternatively, you can manually install the dependencies:
pip install grpcio grpcio-tools python-telegram-bot psutil requests
-
Configure Environment Variables:
Set up the following environment variables:
TELEGRAM_TOKEN
: Your Telegram Bot API token.CHAT_ID
: The chat ID where the bot sends notifications.LND_DIR
: Path to the LND directory.
You can set these in your
.env
file or export them directly in your terminal session:export TELEGRAM_TOKEN="your_telegram_bot_token" export CHAT_ID="your_chat_id" export LND_DIR="/path/to/lnd"
-
Setup gRPC:
Ensure your gRPC setup for the Lightning Network Daemon (LND) is correctly configured. Place the
tls.cert
andadmin.macaroon
files in the specifiedLND_DIR
.
-
Run the Bot:
Start the bot with the following command:
python bot.py
Ensure that you have set up the monitoring threads to handle different aspects like transactions, invoices, channels, and forwarding events.
-
Interact with the Bot:
- /start: Displays the main menu with options to view node info, channel info, recent transactions, forwarding transactions, and Bitcoin info.
- /menu: Shows the main menu again.
Use the buttons provided in the Telegram chat to interact with the bot and get the relevant information.
- On-Chain Transactions: Monitors and notifies about new on-chain transactions.
- Lightning Invoices: Tracks and notifies about new settled Lightning invoices.
- Channels: Monitors channel statuses and notifies about online/offline changes.
- Forwarding Events: Monitors and notifies about new forwarding events.
The bot includes error handling for:
- gRPC errors
- API request failures
- Unexpected exceptions
Logs are generated to help diagnose issues. Review the logs for more detailed error information.
Contributions are welcome! Please submit a pull request or open an issue to report bugs or suggest features.
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or support, please contact:
- Author: Your DavideBTC
- Email: davrago@proton.me
If you found this guide helpful and would like to support the project, consider making a donation. Your contributions help maintain and improve this resource.
You can send Bitcoin directly to the following address:
bc1qy0l39zl7spspzhsuv96c8axnvksypfh8ehvx3e
For faster and lower-fee donations, you can use the Lightning Network:
Thank you for your support!