https://github.com/nicolocarcagni/bitcoinnodeinfo
A bot to check your bitcoin node via telegram
https://github.com/nicolocarcagni/bitcoinnodeinfo
bitcoin bitcoin-cli bitcoin-node python telegram-bot telepot
Last synced: about 2 months ago
JSON representation
A bot to check your bitcoin node via telegram
- Host: GitHub
- URL: https://github.com/nicolocarcagni/bitcoinnodeinfo
- Owner: nicolocarcagni
- License: gpl-3.0
- Created: 2023-04-23T10:31:25.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-15T19:58:31.000Z (almost 3 years ago)
- Last Synced: 2023-05-15T21:15:43.830Z (almost 3 years ago)
- Topics: bitcoin, bitcoin-cli, bitcoin-node, python, telegram-bot, telepot
- Language: Python
- Homepage:
- Size: 44.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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```
```bash
pip install -r requirements.txt
```
### Configuration
To use the script, you need to create a Telegram bot in [BotFather](https://t.me/BotFather) and obtain an access token.
```python
TOKEN = 'your_bot_token_here'
USERID = YOURUSERID
```
## Usage
To start the script, simply run the following command:
```bash
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

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](LICENSE) file for details.