Bitcoin Core  27.99.0
P2P Digital Currency
init.h
Go to the documentation of this file.
1 // Copyright (c) 2021-2022 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_INTERFACES_INIT_H
6 #define BITCOIN_INTERFACES_INIT_H
7 
8 #include <interfaces/chain.h>
9 #include <interfaces/echo.h>
10 #include <interfaces/node.h>
11 #include <interfaces/wallet.h>
12 
13 #include <memory>
14 
15 namespace node {
16 struct NodeContext;
17 } // namespace node
18 
19 namespace interfaces {
20 class Ipc;
21 
29 class Init
30 {
31 public:
32  virtual ~Init() = default;
33  virtual std::unique_ptr<Node> makeNode() { return nullptr; }
34  virtual std::unique_ptr<Chain> makeChain() { return nullptr; }
35  virtual std::unique_ptr<WalletLoader> makeWalletLoader(Chain& chain) { return nullptr; }
36  virtual std::unique_ptr<Echo> makeEcho() { return nullptr; }
37  virtual Ipc* ipc() { return nullptr; }
38 };
39 
46 std::unique_ptr<Init> MakeNodeInit(node::NodeContext& node, int argc, char* argv[], int& exit_status);
47 
49 std::unique_ptr<Init> MakeWalletInit(int argc, char* argv[], int& exit_status);
50 
52 std::unique_ptr<Init> MakeGuiInit(int argc, char* argv[]);
53 } // namespace interfaces
54 
55 #endif // BITCOIN_INTERFACES_INIT_H
int exit_status
Interface giving clients (wallet processes, maybe other analysis tools in the future) ability to acce...
Definition: chain.h:124
Initial interface created when a process is first started, and used to give and get access to other i...
Definition: init.h:30
virtual std::unique_ptr< Echo > makeEcho()
Definition: init.h:36
virtual std::unique_ptr< WalletLoader > makeWalletLoader(Chain &chain)
Definition: init.h:35
virtual ~Init()=default
virtual std::unique_ptr< Node > makeNode()
Definition: init.h:33
virtual Ipc * ipc()
Definition: init.h:37
virtual std::unique_ptr< Chain > makeChain()
Definition: init.h:34
Interface providing access to interprocess-communication (IPC) functionality.
Definition: ipc.h:45
std::unique_ptr< Init > MakeGuiInit(int argc, char *argv[])
Return implementation of Init interface for the gui process.
Definition: bitcoin-gui.cpp:44
std::unique_ptr< Init > MakeNodeInit(node::NodeContext &node, int argc, char *argv[], int &exit_status)
Return implementation of Init interface for the node process.
std::unique_ptr< Init > MakeWalletInit(int argc, char *argv[], int &exit_status)
Return implementation of Init interface for the wallet process.
Definition: init.h:25
NodeContext struct containing references to chain state and connection state.
Definition: context.h:53