mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge bitcoin/bitcoin#19160: multiprocess: Add basic spawn and IPC support
84934bf70emultiprocess: Add echoipc RPC method and test (Russell Yanofsky)7d76cf667emultiprocess: Add comments and documentation (Russell Yanofsky)ddf7ecc8dfmultiprocess: Add bitcoin-node process spawning support (Russell Yanofsky)10afdf0280multiprocess: Add Ipc interface implementation (Russell Yanofsky)745c9cebd5multiprocess: Add Ipc and Init interface definitions (Russell Yanofsky)5d62d7f6cdUpdate libmultiprocess library (Russell Yanofsky) Pull request description: This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). --- This PR adds basic process spawning and IPC method call support to `bitcoin-node` executables built with `--enable-multiprocess`[*]. These changes are used in https://github.com/bitcoin/bitcoin/pull/10102 to let node, gui, and wallet functionality run in different processes, and extended in https://github.com/bitcoin/bitcoin/pull/19460 and https://github.com/bitcoin/bitcoin/pull/19461 after that to allow gui and wallet processes to be started and stopped independently and connect to the node over a socket. These changes can also be used to implement new functionality outside the `bitcoin-node` process like external indexes or pluggable transports (https://github.com/bitcoin/bitcoin/pull/18988). The `Ipc::spawnProcess` and `Ipc::serveProcess` methods added here are entry points for spawning a child process and serving a parent process, and being able to make bidirectional, multithreaded method calls between the processes. A simple example of this is implemented in commit "Add echoipc RPC method and test." Changes in this PR aside from the echo test were originally part of #10102, but have been split and moved here for easier review, and so they can be used for other applications like external plugins. Additional notes about this PR can be found at https://bitcoincore.reviews/19160 [*] Note: the `--enable-multiprocess` feature is still experimental, and not enabled by default, and not yet supported on windows. More information can be found in [doc/multiprocess.md](https://github.com/bitcoin/bitcoin/blob/master/doc/multiprocess.md) ACKs for top commit: fjahr: re-ACK84934bf70eariard: ACK84934bf. Changes since last ACK fixes the silent merge conflict about `EnsureAnyNodeContext()`. Rebuilt and checked again debug command `echoipc`. Tree-SHA512: 52a948b5e18a26d7d7a09b83003eaae9b1ed2981978c36c959fe9a55abf70ae6a627c4ff913a3428be17400a3dace30c58b5057fa75c319662c3be98f19810c6
This commit is contained in:
@@ -61,6 +61,9 @@ class RpcMiscTest(BitcoinTestFramework):
|
||||
node.logging(include=['qt'])
|
||||
assert_equal(node.logging()['qt'], True)
|
||||
|
||||
self.log.info("test echoipc (testing spawned process in multiprocess build)")
|
||||
assert_equal(node.echoipc("hello"), "hello")
|
||||
|
||||
self.log.info("test getindexinfo")
|
||||
# Without any indices running the RPC returns an empty object
|
||||
assert_equal(node.getindexinfo(), {})
|
||||
|
||||
Reference in New Issue
Block a user