Bitcoin Core 29.99.0
P2P Digital Currency
Classes | Functions | Variables
bitcoin.cpp File Reference
#include <bitcoin-build-config.h>
#include <clientversion.h>
#include <util/fs.h>
#include <util/exec.h>
#include <util/strencodings.h>
#include <util/translation.h>
#include <iostream>
#include <string>
#include <tinyformat.h>
#include <vector>
Include dependency graph for bitcoin.cpp:

Go to the source code of this file.

Classes

struct  CommandLine
 

Functions

CommandLine ParseCommandLine (int argc, char *argv[])
 
static void ExecCommand (const std::vector< const char * > &args, std::string_view wrapper_argv0)
 Execute the specified bitcoind, bitcoin-qt or other command line in args using src, bin and libexec directory paths relative to this executable, where the path to this executable is specified in wrapper_argv0. More...
 
int main (int argc, char *argv[])
 

Variables

const TranslateFn G_TRANSLATION_FUN {nullptr}
 Translate string to current locale using Qt. More...
 
static constexpr auto HELP_USAGE
 
static constexpr auto HELP_FULL
 
static constexpr auto HELP_SHORT
 

Function Documentation

◆ ExecCommand()

static void ExecCommand ( const std::vector< const char * > &  args,
std::string_view  wrapper_argv0 
)
static

Execute the specified bitcoind, bitcoin-qt or other command line in args using src, bin and libexec directory paths relative to this executable, where the path to this executable is specified in wrapper_argv0.

Parameters
argsCommand line arguments to execute, where first argument should be a relative path to a bitcoind, bitcoin-qt or other executable that will be located on the PATH or relative to wrapper_argv0.
wrapper_argv0String containing first command line argument passed to main() to run the current executable. This is used to help determine the path to the current executable and how to look for new executables.
Note
This function doesn't currently print anything but can be debugged from the command line using strace or dtrace like:
strace -e trace=execve -s 10000 build/bin/bitcoin ...
dtrace -n 'proc:::exec-success  /pid == $target/ { trace(curpsinfo->pr_psargs); }' -c ... 

Definition at line 164 of file bitcoin.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 60 of file bitcoin.cpp.

Here is the call graph for this function:

◆ ParseCommandLine()

CommandLine ParseCommandLine ( int  argc,
char *  argv[] 
)

Definition at line 121 of file bitcoin.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ G_TRANSLATION_FUN

const TranslateFn G_TRANSLATION_FUN {nullptr}

Translate string to current locale using Qt.

Definition at line 18 of file bitcoin.cpp.

◆ HELP_FULL

constexpr auto HELP_FULL
staticconstexpr
Initial value:
= R"(
Additional less commonly used commands:
bench [ARGS] Run bench command, equivalent to running 'bench_bitcoin [ARGS]'.
chainstate [ARGS] Run bitcoin kernel chainstate util, equivalent to running 'bitcoin-chainstate [ARGS]'.
test [ARGS] Run unit tests, equivalent to running 'test_bitcoin [ARGS]'.
test-gui [ARGS] Run GUI unit tests, equivalent to running 'test_bitcoin-qt [ARGS]'.
)"

Definition at line 37 of file bitcoin.cpp.

◆ HELP_SHORT

constexpr auto HELP_SHORT
staticconstexpr
Initial value:
= R"(
Run '%s help' to see additional commands (e.g. for testing and debugging).
)"

Definition at line 45 of file bitcoin.cpp.

◆ HELP_USAGE

constexpr auto HELP_USAGE
staticconstexpr
Initial value:
= R"(Usage: %s [OPTIONS] COMMAND...
Options:
-m, --multiprocess Run multiprocess binaries bitcoin-node, bitcoin-gui.
-M, --monolithic Run monolithic binaries bitcoind, bitcoin-qt. (Default behavior)
-v, --version Show version information
-h, --help Show full help message
Commands:
gui [ARGS] Start GUI, equivalent to running 'bitcoin-qt [ARGS]' or 'bitcoin-gui [ARGS]'.
node [ARGS] Start node, equivalent to running 'bitcoind [ARGS]' or 'bitcoin-node [ARGS]'.
rpc [ARGS] Call RPC method, equivalent to running 'bitcoin-cli -named [ARGS]'.
wallet [ARGS] Call wallet command, equivalent to running 'bitcoin-wallet [ARGS]'.
tx [ARGS] Manipulate hex-encoded transactions, equivalent to running 'bitcoin-tx [ARGS]'.
help Show full help message.
)"

Definition at line 20 of file bitcoin.cpp.