Bitcoin Core 28.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/mining.h>
11#include <interfaces/node.h>
12#include <interfaces/wallet.h>
13
14#include <memory>
15
16namespace node {
17struct NodeContext;
18} // namespace node
19
20namespace interfaces {
21class Ipc;
22
30class Init
31{
32public:
33 virtual ~Init() = default;
34 virtual std::unique_ptr<Node> makeNode() { return nullptr; }
35 virtual std::unique_ptr<Chain> makeChain() { return nullptr; }
36 virtual std::unique_ptr<Mining> makeMining() { return nullptr; }
37 virtual std::unique_ptr<WalletLoader> makeWalletLoader(Chain& chain) { return nullptr; }
38 virtual std::unique_ptr<Echo> makeEcho() { return nullptr; }
39 virtual Ipc* ipc() { return nullptr; }
40 virtual bool canListenIpc() { return false; }
41};
42
49std::unique_ptr<Init> MakeNodeInit(node::NodeContext& node, int argc, char* argv[], int& exit_status);
50
52std::unique_ptr<Init> MakeWalletInit(int argc, char* argv[], int& exit_status);
53
55std::unique_ptr<Init> MakeGuiInit(int argc, char* argv[]);
56} // namespace interfaces
57
58#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:129
Initial interface created when a process is first started, and used to give and get access to other i...
Definition: init.h:31
virtual std::unique_ptr< Echo > makeEcho()
Definition: init.h:38
virtual Ipc * ipc()
Definition: init.h:39
virtual std::unique_ptr< Chain > makeChain()
Definition: init.h:35
virtual bool canListenIpc()
Definition: init.h:40
virtual ~Init()=default
virtual std::unique_ptr< Node > makeNode()
Definition: init.h:34
virtual std::unique_ptr< Mining > makeMining()
Definition: init.h:36
virtual std::unique_ptr< WalletLoader > makeWalletLoader(Chain &chain)
Definition: init.h:37
Interface providing access to interprocess-communication (IPC) functionality.
Definition: ipc.h:50
std::unique_ptr< Init > MakeGuiInit(int argc, char *argv[])
Return implementation of Init interface for the gui process.
Definition: bitcoin-gui.cpp:49
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: messages.h:20
NodeContext struct containing references to chain state and connection state.
Definition: context.h:56