Skip to content

A bot to check your bitcoin node via telegram

License

Notifications You must be signed in to change notification settings

nicolocarcagni/BitcoinNodeInfo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BitcoinNodeInfo

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.

Features

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.

Prerequisites

  • 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

Configuration

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

Usage

To start the script, simply run the following command:

python bot.py

Commands

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.

Optional: Add commands list in BotFather

IMG_EE7FDAF6F4E5-1

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

License

This script is licensed under the MIT License. See the LICENSE file for details.