multiprocess: Add bitcoin-gui -ipcconnect option#19461
multiprocess: Add bitcoin-gui -ipcconnect option#19461ryanofsky wants to merge 21 commits intobitcoin:masterfrom
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/19461. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. LLM Linter (✨ experimental)Possible typos and grammar issues:
2026-01-07 |
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
- Add capnp ToBlob, ToArray, Wrap, Serialize, and Unserialize helper functions - Add support for std::chrono::seconds capnp serialization - Add support for util::Result capnp serialization
Expose Chain interface to external processes spawning or connecting to bitcoin-node.
Needed because BlockConnected notifications are a lot slower with the wallet running in separate process.
Make default constructor more generic so it doesn't only work with void types.
Libmultiprocess requires output parameters to be ordered after input parameter, so move warnings parameter last. Problematic order was introduced in 4ec2d18 from bitcoin-core/gui#877
Spawn node subprocess instead of running node code internally
Spawn wallet subprocess instead of running wallet code internally
Add .wallet/.gui suffixes to log files created by bitcoin-gui and bitcoin-wallet processes so they don't clash with bitcoin-node log file.
Add `-ipcconnect` option to `bitcoin-wallet` to allow connecting to a bitcoin
node process over IPC. The `bitcoin-wallet` tool doesn't really do anything with its
connection to the node yet, but it could potentially run or serve RPCs that
require being online.
Example usage:
src/bitcoin-node -regtest -debug -ipcbind=unix
src/bitcoin-wallet -regtest -ipcconnect=unix info
Add `-ipcconnect` option to `bitcoin-gui` to allow connecting gui to an existing node instead of starting a new node process, so it is possible to start and stop the gui independently of the node. This change doesn't add an -ipcbind option to the bitcoin-wallet (which would allow the gui to control wallet processes without going through the node), but this would be a logical extension to add in the future.
|
🐙 This pull request conflicts with the target branch and needs rebase. |
This is based on #29409 + #10102 + #19460. The non-base commits are:
86eb8268426multiprocess: Add bitcoin-gui -ipcconnect optionBuilding on #10102, this adds an
-ipcconnectoption tobitcoin-guithat connects the GUI to an existingbitcoin-nodeprocess already running in the background instead of spawning a newbitcoin-nodeprocess. This allows the GUI to be started and stopped independently of the node. By default with this change,bitcoin-guiwill check if a<datadir>/sockets/node.socksocket exists and try to connect to that. If that doesn't work, it will spawn a new node process and start up the same way it did before this PR.The default
bitcoin-guiconnect option is-ipcconnect=auto, which tries to connect if possible as described above, and spawns a newbitcoin-nodeprocess if not possible. Other supported options are-noipcconnectto never connect to an existing node and always spawn a new one,-ipcconnectto require a connection and fail if it can't be established, and-ipcconnect=unix:<socket>to require a connection and use a custom socket path.With this PR, basic functionality works and gui instances can connect and disconnect from a running node. But there are rough edges: If a gui process doesn't shut down cleanly, the node can see unhandled IpcExceptions, and if node command line options are passed to
bitcoin-guiandbitcoin-guiconnects to an exiting bitcoin-node process instead of spawning a new one, the node options will be silently ignored.These changes require multiprocess support and this PR has no effect unless bitcoin is configured with
--enable-multiprocessas described in doc/multiprocess.mdThis PR is part of the process separation project.