forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
multiprocess: Allow bitcoin-mine to spawn bitcoin-node
Allow bitcoin-mine executable to spawn a new bitcoin-node process and start the node, instead of only being able to connect to an existing bitcoin-node process.
- Loading branch information
Showing
11 changed files
with
160 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (c) 2024 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#ifndef BITCOIN_BITCOIND_H | ||
#define BITCOIN_BITCOIND_H | ||
|
||
namespace node { | ||
struct NodeContext; | ||
} // namespace node | ||
|
||
bool ParseArgs(node::NodeContext& node, int argc, char* argv[]); | ||
bool AppInit(node::NodeContext& node); | ||
int NodeMain(node::NodeContext& node, int argc, char* argv[]); | ||
|
||
#endif // BITCOIN_BITCOIND_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) 2024 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#include <bitcoind.h> | ||
#include <interfaces/init.h> | ||
#include <node/context.h> | ||
|
||
#include <functional> | ||
#include <string> | ||
|
||
using node::NodeContext; | ||
|
||
const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr; | ||
|
||
MAIN_FUNCTION | ||
{ | ||
#ifdef WIN32 | ||
common::WinCmdLineArgs winArgs; | ||
std::tie(argc, argv) = winArgs.get(); | ||
#endif | ||
|
||
NodeContext node; | ||
int exit_status; | ||
std::unique_ptr<interfaces::Init> init = interfaces::MakeNodeInit(node, argc, argv, exit_status); | ||
if (!init) { | ||
return exit_status; | ||
} | ||
|
||
return NodeMain(node, argc, argv); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.