Bitcoin Core 22.99.0
P2P Digital Currency
init.h
Go to the documentation of this file.
1// Copyright (c) 2021 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 <memory>
9
10struct NodeContext;
11
12namespace interfaces {
13class Chain;
14class Echo;
15class Ipc;
16class Node;
17class WalletClient;
18
26class Init
27{
28public:
29 virtual ~Init() = default;
30 virtual std::unique_ptr<Node> makeNode();
31 virtual std::unique_ptr<Chain> makeChain();
32 virtual std::unique_ptr<WalletClient> makeWalletClient(Chain& chain);
33 virtual std::unique_ptr<Echo> makeEcho();
34 virtual Ipc* ipc();
35};
36
43std::unique_ptr<Init> MakeNodeInit(NodeContext& node, int argc, char* argv[], int& exit_status);
44
46std::unique_ptr<Init> MakeWalletInit(int argc, char* argv[], int& exit_status);
47
49std::unique_ptr<Init> MakeGuiInit(int argc, char* argv[]);
50} // namespace interfaces
51
52#endif // BITCOIN_INTERFACES_INIT_H
Interface giving clients (wallet processes, maybe other analysis tools in the future) ability to acce...
Definition: chain.h:93
Initial interface created when a process is first started, and used to give and get access to other i...
Definition: init.h:27
virtual std::unique_ptr< Node > makeNode()
Definition: init.cpp:12
virtual std::unique_ptr< Chain > makeChain()
Definition: init.cpp:13
virtual ~Init()=default
virtual Ipc * ipc()
Definition: init.cpp:16
virtual std::unique_ptr< Echo > makeEcho()
Definition: init.cpp:15
virtual std::unique_ptr< WalletClient > makeWalletClient(Chain &chain)
Definition: init.cpp:14
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:43
std::unique_ptr< Init > MakeNodeInit(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.
NodeContext struct containing references to chain state and connection state.
Definition: context.h:39