This is a simple Python script that monitors the status of a Bitcoin node and provides information about its blockchain synchronization. The script can be integrated with a Telegram bot to allow users to quickly check the status of their node using a mobile device.
Check the status of a Bitcoin node (online/offline). Display the number of headers and blocks in the Bitcoin blockchain. Display the synchronization status of the Bitcoin blockchain. Display the disk usage of the node. Display the system uptime of the node.
- Python 3.6 or later.
- A running Bitcoin node.
- The bitcoin-cli tool installed and available in the system's PATH.
- Python modules in
requirements.txt
pip install -r requirements.txt
To use the script, you need to create a Telegram bot in BotFather and obtain an access token.
TOKEN = 'your_bot_token_here'
USERID = YOURUSERID
To start the script, simply run the following command:
python bot.py
The bot recognizes the following commands:
/start
Displays the status of the Bitcoin node and blockchain synchronization.
/sync
Displays the synchronization status of the Bitcoin blockchain.
/uptime
Displays the system uptime of the node.
/disk
Displays the disk usage of the node.
/ping
Pings the script and receives a response.
If you want a list of command like this 👆, use /setcommands
in Bot Father and send the following list:
start - ▶️ Start the bot
status - 🔄 Sync status
uptime - ⏰ Node uptime
disk - 💾 Disk usage
This script is licensed under the MIT License. See the LICENSE file for details.