Braidpool uses Inter-Process Communication (IPC) to connect with Bitcoin Core using UNIX domain sockets for efficient, low-latency communication compared to traditional ZMQ or RPC methods.
- Bitcoin Core with IPC support enabled
- Unix-domain socket support (Linux/macOS)
- Cap'n Proto development libraries
- libmultiprocess library
- cpuminer for downstream connection (if no external ASIC).
First to connect with Braidpool you need to build your Bitcoin node with IPC enabled build configurations. Check out bitcoin multiprocess doc to get the information about building with IPC.
For a quick reference these are the steps you can follow:
- Install and configure libmultiprocess and Cap'n Proto as dependencies to your system.
- Build bitcoin node as:
cd <BITCOIN_SOURCE_DIRECTORY> cmake -B build -DENABLE_IPC=ON cmake --build build - This will create a
buildfolder and inside this there is abinfolder. In this you will find all the executables, includingbitcoin-node,bitcoind,bitcoin-clietc.
Note: The above steps will only work if you have already installed libmultiprocess and Cap'n Proto dependencies locally on your system.
To run the bitcoin-node process with an explicit UNIX socket name and location:
cd build/bin
./bitcoin-node -ipcbind=unix:/tmp/bitcoin-ipc.sock -printtoconsole
here /tmp is the path and bitcoin-ipc.sock is the name of the Unix socket and you can change this according to your usage.
A Braidpool node can be built using different configurations related to IPC. Check braidpool/node/src/cli.rs to find all available CLI options.
cd braidpool/node
# With minimal options
cargo run -- \
--network cpunet
# With additional options
cargo run -- \
--ipc-socket /tmp/bitcoin-cpunet.sock \
--network cpunet \
--bind 127.0.0.1:6680 \
--datadir ~/.braidpool/You can find all available command-line arguments in node/src/cli.rs.
--ipc-socket <PATH>: Specifies the path to the UNIX domain socket file (should be the same as bitcoin node).--network <NETWORK>: Sets the network. Valid options aremainnet,testnet4,signet, andcpunet. The default ismainnet.
-
If you don't have a physical miner, you can do tests with CPUMiner.
-
Firstly installation of
cpuminerfor connecting a downstream to the stratum service (can be done by any external ASIC device or cpu based). -
Run the
node/src/mock_miner.shscript for the installation in the cwd for cpuminerd setup. -
Execute the
minerdprocess via console/terminal by./minerd -a sha256d -o stratum+tcp://localhost:3333 -q -D -P. -
Password and downstream device name are optional paramateres can be sent if required for more information check the source repository
https://github.com/pooler/cpuminer. -
Run the
braidpool-binaryas stated above viacargo runfor the logs to be seen in the console.
