Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/devtools/security-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def check_ELF_FORTIFY(binary) -> bool:

# bitcoin-util and elements-util do not currently contain any fortified functions
# (the utility binaries are intentionally kept minimal)
if any('bitcoin-util utility version' in s for s in binary.strings):
if any('elements-util utility version' in s for s in binary.strings):
return True

chk_funcs = set()
Expand Down
10 changes: 5 additions & 5 deletions contrib/signet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ getcoins.py

A script to call a faucet to get Signet coins.

Syntax: `getcoins.py [-h|--help] [-c|--cmd=<bitcoin-cli path>] [-f|--faucet=<faucet URL>] [-a|--addr=<signet bech32 address>] [-p|--password=<faucet password>] [--] [<bitcoin-cli args>]`
Syntax: `getcoins.py [-h|--help] [-c|--cmd=<elements-cli path>] [-f|--faucet=<faucet URL>] [-a|--addr=<signet bech32 address>] [-p|--password=<faucet password>] [--] [<elements-cli args>]`

* `--cmd` lets you customize the bitcoin-cli path. By default it will look for it in the PATH
* `--cmd` lets you customize the elements-cli path. By default it will look for it in the PATH
* `--faucet` lets you specify which faucet to use; the faucet is assumed to be compatible with https://github.com/kallewoof/bitcoin-faucet
* `--addr` lets you specify a Signet address; by default, the address must be a bech32 address. This and `--cmd` above complement each other (i.e. you do not need `bitcoin-cli` if you use `--addr`)
* `--addr` lets you specify a Signet address; by default, the address must be a bech32 address. This and `--cmd` above complement each other (i.e. you do not need `elements-cli` if you use `--addr`)
* `--password` lets you specify a faucet password; this is handy if you are in a classroom and set up your own faucet for your students; (above faucet does not limit by IP when password is enabled)

If using the default network, invoking the script with no arguments should be sufficient under normal
Expand All @@ -24,15 +24,15 @@ miner
You will first need to pick a difficulty target. Since signet chains are primarily protected by a signature rather than proof of work, there is no need to spend as much energy as possible mining, however you may wish to choose to spend more time than the absolute minimum. The calibrate subcommand can be used to pick a target appropriate for your hardware, eg:

MINER="./contrib/signet/miner"
GRIND="./build/bin/bitcoin-util grind"
GRIND="./build/bin/elements-util grind"
$MINER calibrate --grind-cmd="$GRIND"
nbits=1e00f403 for 25s average mining time

It defaults to estimating an nbits value resulting in 25s average time to find a block, but the --seconds parameter can be used to pick a different target, or the --nbits parameter can be used to estimate how long it will take for a given difficulty.

To mine the first block in your custom chain, you can run:

CLI="./build/bin/bitcoin-cli -conf=mysignet.conf"
CLI="./build/bin/elements-cli -conf=mysignet.conf"
ADDR=$($CLI -signet getnewaddress)
NBITS=1e00f403
$MINER --cli="$CLI" generate --grind-cmd="$GRIND" --address="$ADDR" --nbits=$NBITS
Expand Down
6 changes: 3 additions & 3 deletions contrib/signet/getcoins.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ def print_image(img, threshold=128):
line.append(chr(ch))
print(''.join(line))

parser = argparse.ArgumentParser(description='Script to get coins from a faucet.', epilog='You may need to start with double-dash (--) when providing bitcoin-cli arguments.')
parser.add_argument('-c', '--cmd', dest='cmd', default='bitcoin-cli', help='bitcoin-cli command to use')
parser = argparse.ArgumentParser(description='Script to get coins from a faucet.', epilog='You may need to start with double-dash (--) when providing elements-cli arguments.')
parser.add_argument('-c', '--cmd', dest='cmd', default='elements-cli', help='elements-cli command to use')
parser.add_argument('-f', '--faucet', dest='faucet', default=DEFAULT_GLOBAL_FAUCET, help='URL of the faucet')
parser.add_argument('-g', '--captcha', dest='captcha', default=DEFAULT_GLOBAL_CAPTCHA, help='URL of the faucet captcha, or empty if no captcha is needed')
parser.add_argument('-a', '--addr', dest='addr', default='', help='Bitcoin address to which the faucet should send')
parser.add_argument('-p', '--password', dest='password', default='', help='Faucet password, if any')
parser.add_argument('-n', '--amount', dest='amount', default='0.001', help='Amount to request (0.001-0.1, default is 0.001)')
parser.add_argument('-i', '--imagemagick', dest='imagemagick', default=CONVERT, help='Path to imagemagick convert utility')
parser.add_argument('bitcoin_cli_args', nargs='*', help='Arguments to pass on to bitcoin-cli (default: -signet)')
parser.add_argument('bitcoin_cli_args', nargs='*', help='Arguments to pass on to elements-cli (default: -signet)')

args = parser.parse_args()

Expand Down
22 changes: 11 additions & 11 deletions src/bitcoin-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static void SetupCliArgs(ArgsManager& argsman)
argsman.AddArg("-generate",
strprintf("Generate blocks, equivalent to RPC getnewaddress followed by RPC generatetoaddress. Optional positional integer "
"arguments are number of blocks to generate (default: %s) and maximum iterations to try (default: %s), equivalent to "
"RPC generatetoaddress nblocks and maxtries arguments. Example: bitcoin-cli -generate 4 1000",
"RPC generatetoaddress nblocks and maxtries arguments. Example: elements-cli -generate 4 1000",
DEFAULT_NBLOCKS, DEFAULT_MAX_TRIES),
ArgsManager::ALLOW_ANY, OptionsCategory::CLI_COMMANDS);
argsman.AddArg("-addrinfo", "Get the number of addresses known to the node, per network and total, after filtering for quality and recency. The total number of addresses known to the node may be higher.", ArgsManager::ALLOW_ANY, OptionsCategory::CLI_COMMANDS);
Expand Down Expand Up @@ -502,15 +502,15 @@ class NetinfoRequestHandler : public BaseRequestHandler
if (ParseUInt8(args.at(0), &n)) {
m_details_level = std::min(n, NETINFO_MAX_LEVEL);
} else {
throw std::runtime_error(strprintf("invalid -netinfo level argument: %s\nFor more information, run: bitcoin-cli -netinfo help", args.at(0)));
throw std::runtime_error(strprintf("invalid -netinfo level argument: %s\nFor more information, run: elements-cli -netinfo help", args.at(0)));
}
if (args.size() > 1) {
if (std::string_view s{args.at(1)}; n && (s == "o" || s == "outonly")) {
m_outbound_only_selected = true;
} else if (n) {
throw std::runtime_error(strprintf("invalid -netinfo outonly argument: %s\nFor more information, run: bitcoin-cli -netinfo help", s));
throw std::runtime_error(strprintf("invalid -netinfo outonly argument: %s\nFor more information, run: elements-cli -netinfo help", s));
} else {
throw std::runtime_error(strprintf("invalid -netinfo outonly argument: %s\nThe outonly argument is only valid for a level greater than 0 (the first argument). For more information, run: bitcoin-cli -netinfo help", s));
throw std::runtime_error(strprintf("invalid -netinfo outonly argument: %s\nThe outonly argument is only valid for a level greater than 0 (the first argument). For more information, run: elements-cli -netinfo help", s));
}
}
}
Expand Down Expand Up @@ -748,17 +748,17 @@ class NetinfoRequestHandler : public BaseRequestHandler
"* The local addresses table lists each local address broadcast by the node, the port, and the score.\n\n"
"Examples:\n\n"
"Peer counts table of reachable networks and list of local addresses\n"
"> bitcoin-cli -netinfo\n\n"
"> elements-cli -netinfo\n\n"
"The same, preceded by a peers listing without address and version columns\n"
"> bitcoin-cli -netinfo 1\n\n"
"> elements-cli -netinfo 1\n\n"
"Full dashboard\n"
+ strprintf("> bitcoin-cli -netinfo %d\n\n", NETINFO_MAX_LEVEL) +
+ strprintf("> elements-cli -netinfo %d\n\n", NETINFO_MAX_LEVEL) +
"Full dashboard, but with outbound peers only\n"
+ strprintf("> bitcoin-cli -netinfo %d outonly\n\n", NETINFO_MAX_LEVEL) +
+ strprintf("> elements-cli -netinfo %d outonly\n\n", NETINFO_MAX_LEVEL) +
"Full live dashboard, adjust --interval or --no-title as needed (Linux)\n"
+ strprintf("> watch --interval 1 --no-title bitcoin-cli -netinfo %d\n\n", NETINFO_MAX_LEVEL) +
+ strprintf("> watch --interval 1 --no-title elements-cli -netinfo %d\n\n", NETINFO_MAX_LEVEL) +
"See this help\n"
"> bitcoin-cli -netinfo help\n"};
"> elements-cli -netinfo help\n"};
};

/** Process RPC generatetoaddress request. */
Expand Down Expand Up @@ -926,7 +926,7 @@ static UniValue CallRPC(BaseRequestHandler* rh, const std::string& strMethod, co
}
throw CConnectionFailed(strprintf("Could not connect to the server %s:%d%s\n\n"
"Make sure the daemon server is running and that you are connecting to the correct RPC port.\n"
"Use \"bitcoin-cli -help\" for more info.",
"Use \"elements-cli -help\" for more info.",
host, port, responseErrorMessage));
} else if (response.status == HTTP_UNAUTHORIZED) {
if (failedToGetAuthCookie) {
Expand Down
8 changes: 4 additions & 4 deletions src/bitcoin-util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ static int AppInitUtil(ArgsManager& args, int argc, char* argv[])

if (HelpRequested(args) || args.GetBoolArg("-version", false)) {
// First part of help message is specific to this utility
std::string strUsage = CLIENT_NAME " bitcoin-util utility version " + FormatFullVersion() + "\n";
std::string strUsage = CLIENT_NAME " elements-util utility version " + FormatFullVersion() + "\n";

if (args.GetBoolArg("-version", false)) {
strUsage += FormatParagraph(LicenseInfo());
} else {
strUsage += "\n"
"The bitcoin-util tool provides bitcoin related functionality that does not rely on the ability to access a running node. Available [commands] are listed below.\n"
"The elements-util tool provides elements related functionality that does not rely on the ability to access a running node. Available [commands] are listed below.\n"
"\n"
"Usage: bitcoin-util [options] [command]\n"
"or: bitcoin-util [options] grind <hex-block-header>\n";
"Usage: elements-util [options] [command]\n"
"or: elements-util [options] grind <hex-block-header>\n";
strUsage += "\n" + args.GetHelpMessage();
}

Expand Down
20 changes: 10 additions & 10 deletions test/functional/test_framework/test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def parse_args(self, test_file):
parser.add_argument("--pdbonfailure", dest="pdbonfailure", default=False, action="store_true",
help="Attach a python debugger if test fails")
parser.add_argument("--usecli", dest="usecli", default=False, action="store_true",
help="use bitcoin-cli instead of RPC for all commands")
help="use elements-cli instead of RPC for all commands")
parser.add_argument("--perf", dest="perf", default=False, action="store_true",
help="profile running nodes with perf for the duration of the test")
parser.add_argument("--valgrind", dest="valgrind", default=False, action="store_true",
Expand Down Expand Up @@ -987,19 +987,19 @@ def skip_if_no_bdb(self):
raise SkipTest("BDB has not been compiled.")

def skip_if_no_wallet_tool(self):
"""Skip the running test if bitcoin-wallet has not been compiled."""
"""Skip the running test if elements-wallet has not been compiled."""
if not self.is_wallet_tool_compiled():
raise SkipTest("bitcoin-wallet has not been compiled")
raise SkipTest("elements-wallet has not been compiled")

def skip_if_no_bitcoin_util(self):
"""Skip the running test if bitcoin-util has not been compiled."""
"""Skip the running test if elements-util has not been compiled."""
if not self.is_bitcoin_util_compiled():
raise SkipTest("bitcoin-util has not been compiled")
raise SkipTest("elements-util has not been compiled")

def skip_if_no_cli(self):
"""Skip the running test if bitcoin-cli has not been compiled."""
"""Skip the running test if elements-cli has not been compiled."""
if not self.is_cli_compiled():
raise SkipTest("bitcoin-cli has not been compiled.")
raise SkipTest("elements-cli has not been compiled.")

def skip_if_no_previous_releases(self):
"""Skip the running test if previous releases are not available."""
Expand All @@ -1020,7 +1020,7 @@ def skip_if_no_external_signer(self):
raise SkipTest("external signer support has not been compiled.")

def is_cli_compiled(self):
"""Checks whether bitcoin-cli was compiled."""
"""Checks whether elements-cli was compiled."""
return self.config["components"].getboolean("ENABLE_CLI")

def is_external_signer_compiled(self):
Expand All @@ -1040,11 +1040,11 @@ def is_specified_wallet_compiled(self):
return self.is_bdb_compiled()

def is_wallet_tool_compiled(self):
"""Checks whether bitcoin-wallet was compiled."""
"""Checks whether elements-wallet was compiled."""
return self.config["components"].getboolean("ENABLE_WALLET_TOOL")

def is_bitcoin_util_compiled(self):
"""Checks whether bitcoin-util was compiled."""
"""Checks whether elements-util was compiled."""
return self.config["components"].getboolean("ENABLE_BITCOIN_UTIL")

def is_zmq_compiled(self):
Expand Down
4 changes: 2 additions & 2 deletions test/util/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ def bctest(testDir, testObj, buildenv):
"""
# Get the exec names and arguments
execprog = os.path.join(buildenv["BUILDDIR"], "bin", testObj["exec"] + buildenv["EXEEXT"])
if testObj["exec"] == "./bitcoin-util":
if testObj["exec"] == "./elements-util":
execprog = os.getenv("BITCOINUTIL", default=execprog)
elif testObj["exec"] == "./bitcoin-tx":
elif testObj["exec"] == "./elements-tx":
execprog = os.getenv("BITCOINTX", default=execprog)

execargs = testObj['args']
Expand Down
Loading