Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
bitcoin-network-tools
Advanced tools
A Python wrapper for https://bitnodes.io/api/.
This library provides tools for analyzing and monitoring Bitcoin network nodes. It supports both authenticated and unauthenticated requests, allowing flexibility based on your usage needs.
pip install bitcoin-network-tools
Clone the repository and install:
git clone https://github.com/your-repo/bitcoin-network-tools.git
cd bitcoin-network-tools
pip install .
This library supports both authenticated and unauthenticated requests. To authenticate, set BITNODES_PUBLIC_KEY
and BITNODES_PRIVATE_KEY
as environment variables or pass them directly during initialization.
from bitcoin_network_tools.bitnodes_api import BitnodesAPI
# Unauthenticated
bn = BitnodesAPI()
# Authenticated
bn = BitnodesAPI(public_api_key="your_public_key", private_key_path="path_to_private_key")
Keys can also be configured after initialization:
In [3]: bn.set_public_api_key("examplekey")
Out[3]: True
In [4]: bn.set_private_key_path("private_key.txt")
Out[4]: True
Note: The private key is used ephemerally and never stored.
API keys are available at https://bitnodes.io/api/. Snapshot data is retained on Bitnodes servers for up to 60 days.
Retrieves a list of snapshots from the server, showing details such as timestamp, total nodes, and block height.
In [3]: bn.get_snapshots(limit=5)
Out[3]:
{'count': 8612,
'next': 'https://bitnodes.io/api/v1/snapshots/?limit=5&page=2',
'previous': None,
'results': [{'url': 'https://bitnodes.io/api/v1/snapshots/1735849765/',
'timestamp': 1735849765,
'total_nodes': 20833,
'latest_height': 877541},
{'url': 'https://bitnodes.io/api/v1/snapshots/1735849164/',
'timestamp': 1735849164,
'total_nodes': 20816,
'latest_height': 877541},
{'url': 'https://bitnodes.io/api/v1/snapshots/1735848574/',
'timestamp': 1735848574,
'total_nodes': 20265,
'latest_height': 877541},
{'url': 'https://bitnodes.io/api/v1/snapshots/1735847963/',
'timestamp': 1735847963,
'total_nodes': 20293,
'latest_height': 877541},
{'url': 'https://bitnodes.io/api/v1/snapshots/1735847372/',
'timestamp': 1735847372,
'total_nodes': 20298,
'latest_height': 877538}]}
Get the status of a specific node:
In [4]: bn.get_node_status(address="31.47.202.112", port=8333)
Out[4]:
{'address': '31.47.202.112',
'status': 'UP',
'data': [70016,
'/Satoshi:27.1.0/',
1734410285,
3081,
877256,
'btc.dohmen.net',
'Gothenburg',
'SE',
57.7065,
11.967,
'Europe/Stockholm',
'AS34385',
'Tripnet AB'],
'mbps': '38.850493'}
Tests can be run with BITNODES_PUBLIC_KEY and BITNODES_PRIVATE_KEY environment variables set and
pytest
Contributions are welcome! Here's how you can contribute:
Apache v2.0
FAQs
A wrapper for the Bitnodes API.
We found that bitcoin-network-tools demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.