Skip to content
Open
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/completions/bash/bitcoin-cli.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ _bitcoin_rpc() {
local rpcargs=()
for i in ${COMP_LINE}; do
case "$i" in
-conf=*|-datadir=*|-regtest|-rpc*|-testnet|-testnet4)
-conf=*|-datadir=*|-regtest|-rpc*|-testnet4)
rpcargs=( "${rpcargs[@]}" "$i" )
;;
esac
Expand Down
14 changes: 7 additions & 7 deletions doc/external-signer.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ A future extension could add an optional return field `reachable`, in case `<cmd

Usage:
```
$ <cmd> --fingerprint=<fingerprint> (--testnet) signtransaction <psbt>
$ <cmd> --fingerprint=<fingerprint> (--testnet4) signtransaction <psbt>
base64_encode_signed_psbt
```

Expand All @@ -110,21 +110,21 @@ The `psbt` SHOULD include bip32 derivations. The command SHOULD fail if none of

The command SHOULD fail if the user cancels.

The command MAY complain if `--testnet` is set, but any of the BIP32 derivation paths contain a coin type other than `1h` (and vice versa).
The command MAY complain if `--testnet4` is set, but any of the BIP32 derivation paths contain a coin type other than `1h` (and vice versa).

### `getdescriptors` (optional)

Usage:

```
$ <cmd> --fingerprint=<fingerprint> (--testnet) getdescriptors <account>
$ <cmd> --fingerprint=<fingerprint> (--testnet4) getdescriptors <account>
<xpub>
```

Returns descriptors supported by the device. Example:

```
$ <cmd> --fingerprint=00000000 --testnet getdescriptors
$ <cmd> --fingerprint=00000000 --testnet4 getdescriptors
{
"receive": [
"pkh([00000000/44h/0h/0h]xpub6C.../0/*)#fn95jwmg",
Expand All @@ -143,13 +143,13 @@ $ <cmd> --fingerprint=00000000 --testnet getdescriptors

Usage:
```
<cmd> --fingerprint=<fingerprint> (--testnet) displayaddress --desc descriptor
<cmd> --fingerprint=<fingerprint> (--testnet4) displayaddress --desc descriptor
```

Example, display the first native SegWit receive address on Testnet:

```
<cmd> --fingerprint=00000000 --testnet displayaddress --desc "wpkh([00000000/84h/1h/0h]tpubDDUZ..../0/0)"
<cmd> --fingerprint=00000000 --testnet4 displayaddress --desc "wpkh([00000000/84h/1h/0h]tpubDDUZ..../0/0)"
```

The command MUST be able to figure out the address type from the descriptor.
Expand All @@ -161,7 +161,7 @@ If <descriptor> contains a master key fingerprint, the command MUST fail if it d

If <descriptor> contains an xpub, the command MUST fail if it does not match the xpub known by the device.

The command MAY complain if `--testnet` is set, but the BIP32 coin type is not `1h` (and vice versa).
The command MAY complain if `--testnet4` is set, but the BIP32 coin type is not `1h` (and vice versa).

## How Bitcoin Core uses the Signer API

Expand Down
2 changes: 1 addition & 1 deletion doc/release-notes/release-notes-0.3.14.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.3.14/
Changes:
* Key pool feature for safer wallet backup
Gavin Andresen:
* TEST network mode with switch -testnet
* TEST network mode with switch -testnet4
* Option to use SSL for JSON-RPC connections on unix/osx
* validateaddress RPC command
eurekafag:
Expand Down
2 changes: 1 addition & 1 deletion doc/release-notes/release-notes-0.7.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Bug fixes

* Clicking on a bitcoin: URI on Windows should now launch Bitcoin-Qt properly.

* When running -testnet, use RPC port 18332 by default.
* When running -testnet4, use RPC port 18332 by default.

* Better detection and handling of corrupt wallet.dat and blkindex.dat files.
Previous versions would crash with a DB_RUNRECOVERY exception, this
Expand Down
5 changes: 1 addition & 4 deletions src/bitcoin-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ static void SetupCliArgs(ArgsManager& argsman)
SetupHelpOptions(argsman);

const auto defaultBaseParams = CreateBaseChainParams(ChainType::MAIN);
const auto testnetBaseParams = CreateBaseChainParams(ChainType::TESTNET);
const auto testnet4BaseParams = CreateBaseChainParams(ChainType::TESTNET4);
const auto signetBaseParams = CreateBaseChainParams(ChainType::SIGNET);
const auto regtestBaseParams = CreateBaseChainParams(ChainType::REGTEST);
Expand All @@ -100,7 +99,7 @@ static void SetupCliArgs(ArgsManager& argsman)
argsman.AddArg("-rpcconnect=<ip>", strprintf("Send commands to node running on <ip> (default: %s)", DEFAULT_RPCCONNECT), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-rpccookiefile=<loc>", "Location of the auth cookie. Relative paths will be prefixed by a net-specific datadir location. (default: data dir)", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-rpcpassword=<pw>", "Password for JSON-RPC connections", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-rpcport=<port>", strprintf("Connect to JSON-RPC on <port> (default: %u, testnet: %u, testnet4: %u, signet: %u, regtest: %u)", defaultBaseParams->RPCPort(), testnetBaseParams->RPCPort(), testnet4BaseParams->RPCPort(), signetBaseParams->RPCPort(), regtestBaseParams->RPCPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::OPTIONS);
argsman.AddArg("-rpcport=<port>", strprintf("Connect to JSON-RPC on <port> (default: %u, testnet4: %u, signet: %u, regtest: %u)", defaultBaseParams->RPCPort(), testnet4BaseParams->RPCPort(), signetBaseParams->RPCPort(), regtestBaseParams->RPCPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::OPTIONS);
argsman.AddArg("-rpcuser=<user>", "Username for JSON-RPC connections", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-rpcwait", "Wait for RPC server to start", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-rpcwaittimeout=<n>", strprintf("Timeout in seconds to wait for the RPC server to start, or 0 for no timeout. (default: %d)", DEFAULT_WAIT_CLIENT_TIMEOUT), ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_NEGATION, OptionsCategory::OPTIONS);
Expand Down Expand Up @@ -429,8 +428,6 @@ class NetinfoRequestHandler : public BaseRequestHandler
switch (gArgs.GetChainType()) {
case ChainType::TESTNET4:
return " testnet4";
case ChainType::TESTNET:
return " testnet";
case ChainType::SIGNET:
return " signet";
case ChainType::REGTEST:
Expand Down
2 changes: 0 additions & 2 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ std::unique_ptr<const CChainParams> CreateChainParams(const ArgsManager& args, c
switch (chain) {
case ChainType::MAIN:
return CChainParams::Main();
case ChainType::TESTNET:
return CChainParams::TestNet();
case ChainType::TESTNET4:
return CChainParams::TestNet4();
case ChainType::SIGNET: {
Expand Down
3 changes: 0 additions & 3 deletions src/chainparamsbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ void SetupChainParamsBaseOptions(ArgsManager& argsman)
argsman.AddArg("-regtest", "Enter regression test mode, which uses a special chain in which blocks can be solved instantly. "
"This is intended for regression testing tools and app development. Equivalent to -chain=regtest.", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-testactivationheight=name@height.", "Set the activation height of 'name' (segwit, bip34, dersig, cltv, csv). (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-testnet", "Use the testnet3 chain. Equivalent to -chain=test. Support for testnet3 is deprecated and will be removed in an upcoming release. Consider moving to testnet4 now by using -testnet4.", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-testnet4", "Use the testnet4 chain. Equivalent to -chain=testnet4.", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-vbparams=deployment:start:end[:min_activation_height]", "Use given start/end times and min_activation_height for specified version bits deployment (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-signet", "Use the signet chain. Equivalent to -chain=signet. Note that the network is defined by the -signetchallenge parameter", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
Expand All @@ -42,8 +41,6 @@ std::unique_ptr<CBaseChainParams> CreateBaseChainParams(const ChainType chain)
switch (chain) {
case ChainType::MAIN:
return std::make_unique<CBaseChainParams>("", 8332);
case ChainType::TESTNET:
return std::make_unique<CBaseChainParams>("testnet3", 18332);
case ChainType::TESTNET4:
return std::make_unique<CBaseChainParams>("testnet4", 48332);
case ChainType::SIGNET:
Expand Down
7 changes: 2 additions & 5 deletions src/common/args.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ std::list<SectionInfo> ArgsManager::GetUnrecognizedSections() const
static const std::set<std::string> available_sections{
ChainTypeToString(ChainType::REGTEST),
ChainTypeToString(ChainType::SIGNET),
ChainTypeToString(ChainType::TESTNET),
ChainTypeToString(ChainType::TESTNET4),
ChainTypeToString(ChainType::MAIN),
};
Expand Down Expand Up @@ -799,12 +798,11 @@ std::variant<ChainType, std::string> ArgsManager::GetChainArg() const

const bool fRegTest = get_net("-regtest");
const bool fSigNet = get_net("-signet");
const bool fTestNet = get_net("-testnet");
const bool fTestNet4 = get_net("-testnet4");
const auto chain_arg = GetArg("-chain");

if ((int)chain_arg.has_value() + (int)fRegTest + (int)fSigNet + (int)fTestNet + (int)fTestNet4 > 1) {
throw std::runtime_error("Invalid combination of -regtest, -signet, -testnet, -testnet4 and -chain. Can use at most one.");
if ((int)chain_arg.has_value() + (int)fRegTest + (int)fSigNet + (int)fTestNet4 > 1) {
throw std::runtime_error("Invalid combination of -regtest, -signet, -testnet4 and -chain. Can use at most one.");
}
if (chain_arg) {
if (auto parsed = ChainTypeFromString(*chain_arg)) return *parsed;
Expand All @@ -813,7 +811,6 @@ std::variant<ChainType, std::string> ArgsManager::GetChainArg() const
}
if (fRegTest) return ChainType::REGTEST;
if (fSigNet) return ChainType::SIGNET;
if (fTestNet) return ChainType::TESTNET;
if (fTestNet4) return ChainType::TESTNET4;
return ChainType::MAIN;
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/args.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ class ArgsManager
fs::path GetDataDir(bool net_specific) const;

/**
* Return -regtest/-signet/-testnet/-testnet4/-chain= setting as a ChainType enum if a
* Return -regtest/-signet/-testnet4/-chain= setting as a ChainType enum if a
* recognized chain type was set, or as a string if an unrecognized chain
* name was set. Raise an exception if an invalid combination of flags was
* provided.
Expand Down
Loading