Add -ipcbind
option to bitcoin-node
to make it listen on a unix socket and accept connections from other processes. The default socket path is <datadir>/node.sock
, but this can be customized.
This option lets potential wallet, gui, index, and mining processes connect to the node and control it. See examples in #19460, #19461, and #30437.
Motivation for this PR, in combination with #30510, is be able to release a bitcoin core node binary that can generate block templates for a separate Stratum v2 mining service, like the one being implemented in https://github.com/Sjors/bitcoin/pull/48, that connects over IPC.
Other things to know about this PR:
-
While the
-ipcbind
option lets other processes to connect to thebitcoin-node
process, the only thing they can actually do after connecting is call methods on theInit
interface which is currently very limited and doesn’t do much. But PRs #30510, #29409, and #10102 expand theInit
interface to expose mining, wallet, and gui functionality respectively. -
This PR is not needed for #10102, which runs GUI, node, and wallet code in different processes, because #10102 does not use unix sockets or allow outside processes to connect to existing processes. #10102 lets parent and child processes communicate over internal socketpairs, not externally accessible sockets.
This PR is part of the process separation project.