-
Notifications
You must be signed in to change notification settings - Fork 38.7k
multiprocess: Add bitcoin-wallet -ipcconnect option #19460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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/19460. ReviewsSee the guideline for information on the review process. 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. |
|
🚧 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. |
8c6e331 to
0b53075
Compare
0b53075 to
152880a
Compare
- 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
152880a to
5124e76
Compare
This is based on #29409 + #10102. The non-base commits are:
5124e765ad6multiprocess: Add bitcoin-wallet -ipcconnect optionBuilding on #10102, this adds an
-ipcconnectoption tobitcoin-walletand an-ipcbindoption tobitcoin-node(both enabled by default in multiprocess builds) so bitcoin node will listen on a<datadir>/sockets/node.sockunix socket, andbitcoin-walletwill connect to it.The idea is that
bitcoin-walletcan be extended in the future to have some online functionality. For example, there could be abitcoin-wallet synccommand that will update balances and sync latest transactions to an unloaded wallet, or abitcoin-wallet servesubcommand that loads a wallet and serves RPC requests, or abitcoin-wallet shellsubcommand that allows running RPC methods interactively like the GUI console, or just general support forbitcoin-wallet <rpc method> <rpc params>invocations suggested #13926 (comment).This PR is small and doesn't do much. The only visible change is that
bitcoin-walletnow checks whether a node socket exists on startup and prints "Connected to IPC address" if it can connect it it.The default
bitcoin-walletconnect option is-ipcconnect=auto, which connects if possible as described above, and proceeds offline if not possible. Other supported options are-noipcconnectto disable ipc,-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.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.