Deploying BCH v23.0.0 Development Network Using Docker

·

Bitcoin Cash (BCH) continues to gain traction in the blockchain ecosystem, especially with innovations like the SmartBCH sidechain. This guide provides a step-by-step walkthrough for deploying a BCH development network (regtest) using Docker, focusing on the latest v23.0.0 release.


Why Deploy a BCH Development Network?

👉 Explore advanced blockchain development tools


Step 1: Generate the BCH Docker Image

1.1 Pull the Base Image

docker pull buildpack-deps:jessie-curl

1.2 Create the Dockerfile

FROM buildpack-deps:jessie-curl
RUN wget -O bchn.tar.gz https://github.com/bitcoin-cash-node/bitcoin-cash-node/releases/download/v23.0.0/bitcoin-cash-node-23.0.0-x86_64-linux-gnu.tar.gz \
 && tar -xzvf bchn.tar.gz \
 && cd bitcoin-cash-node-23.0.0/bin \
 && mv bitcoin-cli bitcoin-tx bitcoind /usr/local/bin \
 && cd / \
 && rm -Rfv bitcoin*
EXPOSE 18443 18444
WORKDIR /root/.bitcoin
ENTRYPOINT ["bitcoind"]

Key Notes:

1.3 Build and Verify the Image

docker build . -t bch/bitcoin-cash-node:v23.0.0
docker images | grep bch

Step 2: Launch the BCH Container

2.1 Prepare the Data Directory

mkdir -p /opt/docker/bch-regtest/data

2.2 Start the Container

docker run -itd --restart=unless-stopped \
  -v /etc/localtime:/etc/localtime \
  -v /opt/docker/bch-regtest/data:/root/.bitcoin/regtest \
  -p 18443:18443 -p 18444:18444 \
  --name bchn-regtest \
  bch/bitcoin-cash-node:v23.0.0 \
  -regtest -server=1 \
  -rpcuser=admin -rpcpassword=123456 \
  -txindex=1 -paytxfee=0.00005 \
  -rpcport=18443 -rpcallowip=0.0.0.0/0 \
  -port=18444 -rpcbind=0.0.0.0:18443

Parameter Breakdown:


Step 3: Verify Deployment

3.1 Check Container Status

docker ps | grep bchn-regtest

3.2 Monitor Logs

docker logs bchn-regtest

Look for lines like:

UpdateTip: new best=0f9188f13... height=0
msghand thread start

Step 4: Interact with BCH via RPC

4.1 Create a New Address

curl --user admin:123456 --data-binary '{
  "jsonrpc": "1.0",
  "method": "getnewaddress",
  "params": ["test-wallet"]
}' http://127.0.0.1:18443

4.2 Mine Blocks

curl --user admin:123456 --data-binary '{
  "jsonrpc": "1.0",
  "method": "generatetoaddress",
  "params": [6, "qz9qwcwqd3jrt669dvjg32pyd5kmh2x8zyvflejunj"]
}' http://127.0.0.1:18443

4.3 Check Balance

curl --user admin:123456 --data-binary '{
  "jsonrpc": "1.0",
  "method": "listaddressgroupings",
  "params": []
}' http://127.0.0.1:18443

👉 Master BCH development with these pro tips


FAQs

Q1: Why use -regtest instead of -testnet?

Q2: How do I reset the regtest environment?

Q3: What’s the default block reward in regtest mode?

Q4: Can I connect multiple nodes to this regtest network?


Key Takeaways

Pro Tip: For production environments, replace -regtest with -testnet or omit it for mainnet (with caution!).


This Markdown output adheres to SEO best practices with:
- Hierarchical headings (`#` to `####`).
- Keyword integration ("BCH development," "Docker deployment," "RPC interfaces").
- FAQ section for user engagement.