Blockchaininfo is your gateway to understanding the heartbeat of the Bitcoin network. Built in Rust for speed and reliability, this application connects seamlessly to your Bitcoin node via RPC, offering real-time, detailed insights into the blockchain, mempool, and overall network health.
In a world where decentralization and security are paramount, Blockchaininfo is designed to monitor and showcase the state of Bitcoin's decentralization, providing actionable insights to ensure the network remains robust and resistant to centralized control. It serves as a vital tool for tracking the health and integrity of the blockchain, offering a comprehensive view of node version distribution, network security metrics, and mempool activity.
- Real-Time Data: Stay up-to-date with live blockchain and mempool metrics, ensuring you always have the latest pulse of the network.
- Decentralization Monitoring: Analyze node version distribution to assess the diversity and resilience of the network.
- User-Friendly Dashboard: A live terminal interface delivers formatted, color-coded output, making complex data intuitive and actionable.
- Rust-Powered Efficiency: Leverage Rust’s performance and reliability for seamless and responsive interaction with your Bitcoin node.
Whether you're a developer, node operator, or Bitcoin enthusiast, Blockchaininfo empowers you with the tools to monitor, analyze, and protect the decentralized future of Bitcoin. 🚀
.
├── benches/
│ └── benchmark.rs # For bench testing.
├── cargo.toml
└── src/
├── config.rs # Configuration loading and validation.
├── display/
│ ├── display_blockchain_info.rs # Displays blockchain data.
│ ├── display_mempool_info.rs # Displays mempool data.
│ ├── display_network_info.rs # Displays network data.
│ ├── display_consensus_security_info.rs # Displays consensus security data.
├── display.rs # Aggregates display modules.
├── lib.rs # For testing.
├── main.rs # Application entry point.
├── models/ # Data and error handling modules.
│ ├── block_info.rs # Block data model.
│ ├── blockchain_info.rs # Blockchain data model and implementations.
│ ├── mempool_info.rs # Mempool data model and implementations.
│ ├── network_info.rs # Network data model.
│ ├── network_totals.rs # Network data model (bytes reveived & sent).
│ ├── peer_info.rs # Peers data model.
│ ├── consensus_security.rs # Consensus security data model.
│ └── errors.rs # Error handling.
├── models.rs # Aggregates Data and Error modules.
├── rpc/ # RPC modules for interacting with the Bitcoin node.
│ ├── block.rs # Block data fetching.
│ ├── blockchain.rs # Blockchain data fetching.
│ ├── mempool.rs # Mempool data fetching.
│ ├── network.rs # Network data fetching.
│ ├── network_peers.rs # Peers data model.
│ ├── network_totals.rs # Network data fetching (bytes reveived & sent).
│ ├── mempool_distro.rs # Fetches the sampled tx IDs for distribution metrics.
│ └── chain_tips.rs # Fetches chain tips for consensus monitoring.
├── rpc.rs # Aggregates RPC modules.
└── utils.rs # Utility functions (e.g., data formatting).
The application requires Bitcoin Core RPC credentials to function properly. These credentials can be provided in one of the following ways:
-
config.toml
File (Default)
Create aconfig.toml
file in the root directory with the following structure:[bitcoin_rpc] username = "your_username" password = "your_password" address = "http://127.0.0.1:8332"
Replace the values with your actual Bitcoin Core RPC credentials.
-
Environment Variables (Alternative)
Ifconfig.toml
is not provided, the application will look for the following environment variables:RPC_USER
: Your Bitcoin Core RPC usernameRPC_PASSWORD
: Your Bitcoin Core RPC passwordRPC_ADDRESS
: The Bitcoin Core RPC server address (e.g.,http://127.0.0.1:8332
,https://your-node.local
)
-
macOS Keychain (Preferred for macOS)
On macOS, you can securely store the RPC password in the system Keychain. This is the most secure and recommended method. To set it up:-
Use the following command to add the password to your Keychain:
security add-generic-password -a bitcoin -s rpc-password -w "your_password"
-
The program will automatically retrieve the password using the Keychain during runtime. Ensure the username (
RPC_USER
) and address (RPC_ADDRESS
) are provided either in theconfig.toml
file or as environment variables.
-
-
Rust (Stable)
- Install Rust via rustup.rs.
-
Clone the repository:
git clone https://github.com/TH3BAT/Blockchaininfo.git cd Blockchaininfo
-
Build the project:
cargo build --release
-
Ensure your Bitcoin node is running with RPC enabled.
-
Run the application:
./target/release/blockchaininfo
The program includes robust error handling:
- Configuration Errors: Ensures
config.toml
or environment variables contains valid credentials and address. - RPC Communication Errors: Handles failures in connecting to the Bitcoin node.
- Data Parsing Errors: Identifies and reports issues with parsing the JSON response.
We welcome contributions! To get involved:
- Fork the repository.
- Create a feature branch.
- Open a pull request with a clear description.
This project is licensed under the MIT License. See the LICENSE file for details.