multiprocess: Add bitcoin-node process spawning support

Add bitcoin-node startup code to let it spawn and be spawned by other
processes
This commit is contained in:
Russell Yanofsky
2017-12-05 15:57:12 -05:00
parent 10afdf0280
commit ddf7ecc8df
7 changed files with 105 additions and 6 deletions

View File

@@ -31,6 +31,20 @@ public:
virtual std::unique_ptr<WalletClient> makeWalletClient(Chain& chain);
virtual Ipc* ipc();
};
//! Return implementation of Init interface for the node process. If the argv
//! indicates that this is a child process spawned to handle requests from a
//! parent process, this blocks and handles requests, then returns null and a
//! status code to exit with. If this returns non-null, the caller can start up
//! normally and use the Init object to spawn and connect to other processes
//! while it is running.
std::unique_ptr<Init> MakeNodeInit(NodeContext& node, int argc, char* argv[], int& exit_status);
//! Return implementation of Init interface for the wallet process.
std::unique_ptr<Init> MakeWalletInit(int argc, char* argv[], int& exit_status);
//! Return implementation of Init interface for the gui process.
std::unique_ptr<Init> MakeGuiInit(int argc, char* argv[]);
} // namespace interfaces
#endif // BITCOIN_INTERFACES_INIT_H