This guide provides step-by-step instructions for deploying a Bitcoin mainnet node on CentOS 7.2, covering installation, configuration, and management.
System Requirements
- Operating System: CentOS 7.2
- Storage: 500GB HDD (minimum)
- RAM: 10GB+ recommended for
dbcache=10240setting
Installation Steps
1. Download Bitcoin Core
Navigate to the official download page and execute:
cd /opt/
wget https://bitcoin.org/bin/bitcoin-core-0.17.0.1/bitcoin-0.17.0.1-x86_64-linux-gnu.tar.gz2. Extract and Configure Symlinks
tar zxf bitcoin-0.17.0.1-x86_64-linux-gnu.tar.gz
ln -fs /opt/bitcoin-0.17.0 /opt/bitcoin
ln -fs /opt/bitcoin/bin/bitcoind /usr/local/bin/bitcoind
ln -fs /opt/bitcoin/bin/bitcoin-cli /usr/local/bin/bitcoin-cliConfiguration
1. Create Data Directory
mkdir -p /data/btc_data
mkdir ~/.bitcoin2. Edit Configuration File
Add these parameters to ~/.bitcoin/bitcoin.conf:
datadir=/data/btc_data
dbcache=10240
txindex=1
rpcuser=btc
rpcpassword=[YOUR_SECURE_PASSWORD]
daemon=1
server=1
rest=1
rpcbind=0.0.0.0:8332
rpcallowip=0.0.0.0/0
deprecatedrpc=accounts👉 Best practices for secure RPC configuration
Node Management
Start the Node
bitcoind -daemonStop the Node
bitcoin-cli stopCheck Sync Status
bitcoin-cli getblockchaininfo
bitcoin-cli getmininginfoRPC API Usage
Basic Query Example
curl -s -X POST --user btc:[PASSWORD] \
-H 'content-type: text/plain;' http://127.0.0.1:8332/ \
--data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmininginfo", "params": [] }'Key Configuration Parameters
| Parameter | Purpose |
|---|---|
txindex=1 | Enables full transaction indexing |
dbcache=10240 | Allocates 10GB RAM for UTXO cache |
rpcallowip | Whitelists IPs for remote access |
👉 Advanced node optimization techniques
FAQ
Q1: How long does initial sync take?
A: Typically 3-7 days depending on hardware and network speed.
Q2: What if I get "Cannot obtain lock" error?
A: Delete the .lock file in your datadir and restart.
Q3: Is 500GB storage sufficient?
A: Yes for now, but plan for annual 50GB+ growth.
Q4: How to verify sync progress?
A: Compare blocks in getblockchaininfo with current block height.
Pro Tips
- SSD Recommended: HDDs may bottleneck during initial sync
- Port Forwarding: Enable port 8333 for better peer connections
- Security: Always use strong RPC passwords and IP whitelisting
For enterprise-grade node deployments, consider professional node hosting solutions.