Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle chain from menu (using Settings) #414

Closed
wants to merge 1 commit into from

Conversation

Sjors
Copy link
Member

@Sjors Sjors commented Aug 31, 2021

Implements #78

It's currently not easy for GUI users to switch to a test chain like signet. E.g on macOS this requires using the command line, since Spotlight doesn't let you add an argument like -signet.

This PR makes it easier by adding a menu option to restart with a different chain. It does this by adding a .chain_gui file. Unfortunately we can't use settings.json, because this file is network specific. This file is ignored by bitcoind. It does this by adding chain to the mainnet QSettings.

Schermafbeelding 2021-09-01 om 13 01 37

(it's now under Settings, not File)

@Sjors Sjors requested a review from ryanofsky August 31, 2021 19:34
@ryanofsky
Copy link
Contributor

ryanofsky commented Aug 31, 2021

I think you could just use QSettings for this, the same way the GUI datadir preference and all other other GUI-only settings are stored in QSettings. Even bitcoin/bitcoin#15936 which consolidates bitcoin-qt and bitcoind settings in settings.json still stores GUI-only settings in QSettings.

@ryanofsky
Copy link
Contributor

I guess thinking more generally, for example if we did want to add a changenetwork RPC that would save a different network preference and restart, I'd probably do that by adding support for reading the -chain setting from the top level settings.json file, and then having bitcoind and bitcoin-qt both use this value at startup to choose the network and locate network-specific data and network-specific settings file from there. This would maybe be a little more complicated to implement than the QSettings or .chain_gui approaches, but probably not too bad.

I guess my preference would be to take this general approach and store the network preference in the chain field of the the top level settings.json. Or if that is too much work to implement, store it in QSettings. Or if that is not worth the effort either, keep this new .chain_gui file.

No matter which location is chosen, it could in theory be migrated somewhere else later, but migrating would be at least a little messy and could create edge cases when downgrading, so it is good to put a little effort into choosing the best location now.

@Sjors
Copy link
Member Author

Sjors commented Sep 1, 2021

If we're keeping some QSettings around anyway, I might as well use that. With bitcoind it's trivial to just specify the network as a parameter.

@Sjors Sjors force-pushed the 2021/08/toggle_network branch from 13bbc6d to 0391893 Compare September 1, 2021 11:01
@Sjors Sjors changed the title Toggle chain from menu (adds .chain_gui) Toggle chain from menu (using Settings) Sep 1, 2021
@Sjors Sjors marked this pull request as ready for review September 1, 2021 11:04
@Sjors
Copy link
Member Author

Sjors commented Sep 1, 2021

I switched to using QSettings. Similar to settings.json these are also network dependent. The GUI does this by changing its name during the bootstrap process, right after deciding which chain its on (step 7).

This PR uses the same trick in reverse: it changes the application name back to mainnet right before updating the chain setting, and then quits.

Copy link
Contributor

@shaavan shaavan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK

This PR adds the functionality to select a network chain directly from the GUI, making it easier to toggle between the chains. This is achieved by adding a context menu option to set the -chain suboption to the selected chain type and closing the GUI. So that when next time GUI will start, the value of -chain suboption will by default be set to the last selected network by the user. This value, as I observed, can always be overridden while opening the bitcoin GUI through the command line.

Tested the PR on Ubuntu 20.04. The PR works as described by OP. I am adding the screenshot of the added context menu options.

Screenshot from 2021-09-01 19-42-53

This PR also has a byproduct benefit that is not discussed till now. For a person like me who mainly works on a signet network, I do not have to explicitly create an alias or select the signet chain each time I want to open GUI. So that’s great!

I have a few suggestions I want to put forward that might further improve the PR:

  • Before line 459:
QMessageBox::StandardButton btnRetVal = QMessageBox::question(this, tr("Confirm chain"),

Add translator’s comment for text in the StandardButton.

  • Add mnemonic shortcuts for the added context menu options.
  • It would be great if the GUI could automatically start after toggling the chain instead of simply closing the app.

@Sjors
Copy link
Member Author

Sjors commented Sep 1, 2021

@ShaMan239 thanks for the review! I added a translator hint and keyboard shortcuts (I can't test those on macOS, new screenshot is welcome). Unfortunately afaik Bitcoin Core can't restart itself. This is a problem with some settings changes too.

@Sjors Sjors force-pushed the 2021/08/toggle_network branch from 0391893 to 79af0d6 Compare September 1, 2021 16:14
Copy link
Contributor

@shaavan shaavan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Translator’s comments look good.
Regarding the mnemonics shortcuts, there are some collisions between them.

Screenshot from 2021-09-01 23-11-52

Load PSBT from &clipboard <-> Switch &chain

&Backup wallet <-> &Bitcoin

Unfortunately, afaik Bitcoin Core can't restart itself.

Well, that’s a bummer. I was just wondering if this feature could be added and would that even be worth adding.

@Sjors
Copy link
Member Author

Sjors commented Sep 2, 2021

Maybe I misunderstand how these shortcuts work... Wouldn't "c" take you to the chain submenu and then "b" to Bitcoin inside that menu? Or all the shortcuts global?

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach ACK, makes sense to have this separate from other options.

@hebasto hebasto added Feature UX All about "how to get things done" labels Sep 3, 2021
Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK 79af0d6.

Also added the check on the current chain to better indicate why the current is disabled.
image

with the following

+            const bool is_current = gArgs.GetChainName() == chain.first.toStdString();
             QAction* action = m_chain_selection_menu->addAction(chain.second);
-
-            if (gArgs.GetChainName() == chain.first.toStdString()) {
-              action->setEnabled(false);
-            }
+            action->setCheckable(true);
+            action->setChecked(is_current);
+            action->setEnabled(!is_current);

@promag
Copy link
Contributor

promag commented Sep 3, 2021

Now I can't pick a different chain from the command line, for instance src/qt/bitcoin-qt -regtest gives Error: Invalid combination of -regtest, -signet, -testnet and -chain. Can use at most one..

@Sjors Sjors force-pushed the 2021/08/toggle_network branch from 79af0d6 to 246d065 Compare September 4, 2021 13:11
@Sjors
Copy link
Member Author

Sjors commented Sep 4, 2021

@promag thanks, addressed comments and added the checkmark. Though on my machine I can't see the checkmark (QT 6.1.2 via homebrew).

Once you use the GUI to select a chain, there's no way back :-) Actually you can still use -chain=regtest. The error message is a bit confusing, it's just that you have to use either -chain= or use one of -regtest, -signet, -testnet, -main

The chain is a special case with so many weird rules, I'd rather not mess with:

gui/src/util/settings.cpp

Lines 129 to 143 in f4e12fd

// Weird behavior preserved for backwards compatibility: Take first
// assigned value instead of last. In general, later settings take
// precedence over early settings, but for backwards compatibility in
// the config file the precedence is reversed for all settings except
// chain name settings.
const bool reverse_precedence =
(source == Source::CONFIG_FILE_NETWORK_SECTION || source == Source::CONFIG_FILE_DEFAULT_SECTION) &&
!get_chain_name;
// Weird behavior preserved for backwards compatibility: Negated
// -regtest and -testnet arguments which you would expect to override
// values set in the configuration file are currently accepted but
// silently ignored. It would be better to apply these just like other
// negated values, or at least warn they are ignored.
const bool skip_negated_command_line = get_chain_name;

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK 246d065.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK.

  1. Still having this error on Linux:

Now I can't pick a different chain from the command line, for instance src/qt/bitcoin-qt -regtest gives Error: Invalid combination of -regtest, -signet, -testnet and -chain. Can use at most one..

UPDATE:

Once you use the GUI to select a chain, there's no way back :-)

Maybe always add the chain value to settings at the first run the new code, and notify users about new behavior?

END OF UPDATE

  1. It seems possible to move all new code from BitcoinGUI::createActions() to BitcoinGUI::createMenuBar() and use the local variable chain_selection_action instead of the data member m_chain_selection_action.

  2. Why not add translator comments to all of the added tr() arguments?

connect(action, &QAction::triggered, [this, chain] {
//: Switch to the mainnet, testnet, signet or regtest chain.
QMessageBox::StandardButton btnRetVal = QMessageBox::question(this, tr("Switch chain"),
tr("Client restart required to switch chain.") + "<br><br>" + tr("Client will be shut down. Do you want to proceed?"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Translators will much appreciate if both strings belong to the same context:

Suggested change
tr("Client restart required to switch chain.") + "<br><br>" + tr("Client will be shut down. Do you want to proceed?"),
tr("Client restart required to switch chain.\n\nClient will be shut down. Do you want to proceed?"),

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}

connect(action, &QAction::triggered, [this, chain] {
//: Switch to the mainnet, testnet, signet or regtest chain.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hebasto: "Why not add translator comments to all of the added tr() arguments?"

Noting down some guidance for translator comments here and for the future:

Translator comments should attempt to provide a translator with the appropriate context to aid them with translating a certain string.

Proper context is:

  • Where is this string shown?
    • e.g; Shown in the Create Wallet dialog, Shown in file menu options ...
  • What action is associated with this string?
    • If the string is associated with a button, what is the outcome of pressing the button

Optional context is:

  • Explain what the string is meant to convey
    • This is an explanatory text shown after X that aims to inform the user that ...
  • Provide alternatives to complicated/technical words
    • Some words may not have a direct one-to-one translation in certain languages. It is nice to provide a replacement for such a word. For example, some languages may not have a 1-1 translation for the word subnet, an appropriate replacement for this word can be IP address.

This context makes the job of translators easier and allows for more effective translations.

Copy link
Contributor

@shaavan shaavan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes since my last review:

  • The checkmark is added along with the options to emphasize which chain is currently selected. I think it makes sense to add a checkmark, so I agree with this change
    Adding screenshots of the visual change before and after updating PR.
Before Update After Update
Screenshot from 2021-09-01 23-11-52 pr1

Maybe I misunderstand how these shortcuts work... Wouldn't "c" take you to the chain submenu and then "b" to Bitcoin inside that menu? Or all the shortcuts global?

I just checked if the shortcuts are global. They are not, and so I have updated my comment accordingly.
But there is still the collision of mnemonics between Load PSBT from &clipboard and Switch &chain as they are part of the same menu. So I would recommend updating the mnemonics shortcut to &S

diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 39a58f4d1..5aedbbf43 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -441,7 +441,7 @@ void BitcoinGUI::createActions()
     }
 #endif // ENABLE_WALLET
 
-    m_chain_selection_action = new QAction(tr("Switch &chain"), this);
+    m_chain_selection_action = new QAction(tr("&Switch chain"), this);
     m_chain_selection_action->setStatusTip(tr("Restart application using a different (test) network"));
     m_chain_selection_menu = new QMenu(this);

@Sjors
Copy link
Member Author

Sjors commented Sep 16, 2021

Maybe always add the chain value to settings at the first run the new code, and notify users about new behavior?

Done, and added a release note.

I moved the menu stuff to BitcoinGUI::createMenuBar()

Why not add translator comments to all of the added tr() arguments?

Done (I think).

I switched the shortcut to Switch &chain

@Sjors Sjors force-pushed the 2021/08/toggle_network branch 2 times, most recently from b1447d8 to bc72b19 Compare September 16, 2021 10:59
Copy link
Contributor

@shaavan shaavan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK bc72b19
Tested on Ubuntu 20.04 (Using Qt version 5.12.8)

Updates since my last review:

  • Release notes are added to inform users about the change in behavior in the way of using chain variables.
  • GUI will open on the mainnet when the user specifies no specific chain, either through Command-Line or GUI.
  • The scope of the chain_selction_menu variable has been changed from global to local.
    btnRetVal renamed to btn_ret_val according to the naming convention.
  • The mnemonic shortcut of the switch chain option has been changed from &c to &S, removing shortcut collision.

I tested the updated PR on Ubuntu 20.04. The PR works perfectly. Also, I followed the release notes word by word while testing. They are correct too. The collision between mnemonic shortcuts has been resolved, and the new mnemonic shortcut is working perfectly.

I am adding the screenshot of the latest commit.

PR

Thanks for this amazing work, @Sjors!

@Sjors
Copy link
Member Author

Sjors commented Sep 16, 2021

@kallewoof @ajtowns you might enjoy this PR

@kallewoof
Copy link
Contributor

Another approach could be to always launch in mainnet, and keep that open, but allow the application to launch another instance of itself with e.g. -testnet. But launching apps from within an app might be a bit scary too.

That sounds like it could potentially be a really confusing eventual .5 TB loss of disk space for users who think "regtest" means "regtest" and not "regtest with a slice of main net syncing in the background"..

The "document" approach seems sensible, i.e. where you "open" instances (main/test/sig/reg/custom) from within the application. Could be potentially really useful if you are doing multiple regtests and like doing things in the GUI.

@dlarchikov
Copy link

@Sjors thx for PR. Please add support of custom private rpc for regtest.

@RandyMcMillan
Copy link
Contributor

RandyMcMillan commented Feb 8, 2022

Receiving this alert on MacOS

Screen Shot 2022-02-08 at 12 44 02 AM

Process:               Bitcoin-Qt [46840]
Path:                  /Users/USER/*/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt
Identifier:            org.bitcoinfoundation.Bitcoin-Qt
Version:               22.99.0 (22.99.0)
Code Type:             X86-64 (Native)
Parent Process:        bash [79038]
Responsible:           Terminal [425]
User ID:               501

Date/Time:             2022-02-08 00:52:00.534 -0500
OS Version:            Mac OS X 10.15.7 (19H1615)
Report Version:        12
Anonymous UUID:        50406######################9E77F6

Sleep/Wake UUID:       E9EA##########################199E

Time Awake Since Boot: 96000 seconds
Time Since Wake:       95000 seconds

System Integrity Protection: disabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
abort() called

Screen Shot 2022-02-08 at 12 55 14 AM

Cirrus: https://cirrus-ci.com/build/6466679780671488

@RandyMcMillan
Copy link
Contributor

RandyMcMillan commented Feb 8, 2022

Running Cirrus on PR:
Cirrus: https://cirrus-ci.com/build/6466679780671488

Running Cirrus on the rebased branch:
Rebase: https://cirrus-ci.com/build/4721486761033728

@RandyMcMillan
Copy link
Contributor

It seems that Switch chain belongs in the Settings menu:
RandyMcMillan@9b1456c
https://cirrus-ci.com/build/4848117060206592

Screen Shot 2022-02-08 at 2 30 11 AM

@RandyMcMillan
Copy link
Contributor

RandyMcMillan commented Feb 8, 2022

On a side note:

It could be argued that "FIle" is incorrect since mostly wallet operations are listed under this menu.
The wallet related functions could be grouped together - with the other functions in a sub menu group.
File could be changed to Wallet

Screen Shot 2022-02-08 at 2 38 13 AM

@Sjors Sjors force-pushed the 2021/08/toggle_network branch from 12431e0 to f3ddafa Compare February 8, 2022 09:52
@Sjors
Copy link
Member Author

Sjors commented Feb 8, 2022

@RandyMcMillan thanks for testing! That crash is worrying. I'm getting this too now some of the time. Inspired by #336 I changed QApplication::quit(); to Q_EMIT quitRequested();. That seems to fix it.

I also moved the menu to Settings. And rebased.

@dlarchikov:

Please add support of custom private rpc for regtest.

I'm not sure what you mean by this.

@RandyMcMillan
Copy link
Contributor

I will retest shortly - this sounds like a much friendlier method of shutdown...

@RandyMcMillan
Copy link
Contributor

Approach ACK f3ddafa

MacOS (x86_64) is now receiving a gentle shutdown signal - removing the unexpected shutdown alert.
This should be allowing the data directory to be in a good state upon restarting.

I will test MacOS ARM64 shortly.

Great Work @Sjors !

Screen Shot 2022-02-08 at 11 37 36 AM (3)

Screen Shot 2022-02-08 at 11 37 40 AM 1(3)

The selected chain is stored in the QSettings for mainnet.
@Sjors Sjors force-pushed the 2021/08/toggle_network branch from f3ddafa to df3ad9a Compare February 8, 2022 17:14
@Sjors
Copy link
Member Author

Sjors commented Feb 8, 2022

Thanks! I fixed the duplicate "ClientClient" string.

@RandyMcMillan
Copy link
Contributor

RandyMcMillan commented Feb 9, 2022

reACK Approach df3ad9a

Tested on MacOS Arm64 - shutting down cleanly.

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reservations about this feature, and also think the implementation could be improved, but code review ACK 12431e0 since I don't think there are problems with the code.

Code review comments below suggest ways to improve the implementation, and I also agree with luke-jr (#414 (comment)) and kalle and achow and jarolrod that in general this change could result in confusion and be a net negative. I mostly just don't think it makes sense from a user perspective that you are forced to shut down your connection and wallets for one network to connect to a different network, instead of just opening different networks in different windows. There's no problem doing this on Linux or Windows (IIUC from #78 (comment)) because Linux and Windows packages can provide separate icons for launching testnet and signet instances. Ideally the mac package would just provide separate icons as well so we wouldn't need this less flexible and potentially confusing toggle.

I don't see a technical reason why providing separate icons shouldn't be possible on mac. This guide about creating DMGs https://intmaker.com/deploy-to-macos/ has a section "Level 3: additional applications" about adding helper applications alongside the main application. In this case, helper applications could be Bitcoin-Qt (testnet) and Bitcoin-Qt (signet) scripts that call the main Bitcoin-Qt application with appropriate command line arguments. https://superuser.com/a/16777 shows how to write applescripts that invoke applications with command lines and https://apple.stackexchange.com/a/407885 shows how to package scripts as applications with icons.

Another approach would be to replace the "Switch Chain" toggle menu with an "Open Chain" menu, which would just open new windows connecting to other networks, instead of closing down the whole application and restarting. The implementation could still use QSettings to remember what windows are open so relaunching bitcoin will reopen the same windows (Or if every window was manually closed by the user, reopen the last closed window).

//: Switch to the mainnet, testnet, signet or regtest chain.
QMessageBox::StandardButton btn_ret_val = QMessageBox::question(this, tr("Switch chain"),
//: Switching between mainnet, testnet, signet or regtest chain requires a restart.
tr("Client restart required to switch chain.\n\nClient will be shut down. Do you want to proceed?"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In commit "gui: toggle chain via menu" (12431e0)

I think it would be good for the dialog to describe what the option actually does. I'm concerned that someone could click this without really understanding it, and then next time they start bitcoin they find their wallets are missing and bitcoin is doing a new sync to a different network.

I think ideally dialog would say something like. "Are you sure you want to switch networks from main to test? Testnet coins are separate from actual bitcoins, and are not supposed to have any value. Switching networks
requires restarting Bitcoin Core, and any existing wallets from the current network will be hidden while using the other network. It will be possible to switch back to the current network by using the "Switch chain" menu again and restarting." It could also be good to change the affirmative button text from "Yes" to something more explicit like "Switch to {network name} network and exit."

@@ -564,6 +564,10 @@ int GuiMain(int argc, char* argv[])
// - QSettings() will use the new application name after this, resulting in network-specific settings
// - Needs to be done before createOptionsModel

QSettings settings;
std::string chain = settings.value("chain", "main").toString().toStdString();
gArgs.SoftSetArg("-chain", chain);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In commit "gui: toggle chain via menu" (12431e0)

It might be good to show a message on startup the first time bitcoin is started after switching networks.

The toggle chain menu could set a boolean "switched_chain" QSetting, and this code could check for the "switched_chain" setting, clear it, and show a message like "Bitcoin Core is connecting to new network {network}. Use the "Switch chain" menu to switch networks again." (It could be a dialog with a "Do not show this message in the future checkbox" if users switch network repeatedly.) But I think this would provide a useful alert and a good second chance to recover if someone clicked through the first dialog not expecting bitcoin to be starting from scratch again.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re: #414 (comment)

It might be good to show a message on startup the first time bitcoin is started after switching networks. [...]

Replying to myself, maybe a better startup message would be: "Bitcoin-Qt configuration has changed and will now connect to the {Testnet} network instead of the {Mainnet} network. {Mainnet} wallets will not be loaded while connected to the {Testnet} network. Also {Testnet} coins are separate from actual bitcoins, and are not supposed to have any value." Dialog could include a checkbox "Do not show this message again," and buttons "Continue connecting to {Testnet} network" / "Exit and switch back to {Mainnet network}" for a safe escape.

(And again I really think ideally none of these dialogs would be necessary and new networks would just open in new windows without closing existing ones. But showing clear messages could at least avoid pitfalls if only one window can be open at a time)

Comment on lines +193 to +195
- Toggle chain from mainnet to testnet, signet or regtest. The GUI now always sets `-chain`,
so any occurrences of `-testnet`, `-signet` or `-regtest` in `bitcoin.conf` should
be replace with `chain=test`, `chain=signet` or `chain=regtest` respectively. (bitcoin-core/gui#414)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In commit "gui: toggle chain via menu" (12431e0)

I think it would be better if these notes were clearer about what behavior is. What happens if you don't follow the advice? Is this saying if you run use -testnet the parameter will be silently ignored because the GUI overrides it internally?

If so, I think this might rise to the level of a bug because command line arguments by design are supposed to override GUI settings and other configuration sources. If not, and there is an explicit error about conflicting settings, that is probably ok. But I think ideally GUI setting would still be overridden if -chain or -testnet or -signet or -regtest were specified. It seems like it should be trivial to implement that instead of requiring users to read this and change their setups.


connect(chain_selection_menu, &QMenu::aboutToShow, [this, chain_selection_menu] {
chain_selection_menu->clear();
const std::vector<std::pair<QString, QString>> chains = {{"main", "&Bitcoin"}, {"test", "&Testnet"}, {"regtest", "&Regtest"}, {"signet", "&Signet"}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In commit "gui: toggle chain via menu" (12431e0)

Interesting the text is is "Bitcoin" instead of "Mainnet". I think that it is good because it implies the other networks are not the Bitcoin network. Another way to do this while being a little more consistent could be to make the choices "Mainnet (Bitcoin)" / "Testnet" / "Regtest" / "Signet"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noted this as well - IMO "Bitcoin" is a better way to go - "Mainnet" may actually confuse new users at this point.

@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 3, 2022

🐙 This pull request conflicts with the target branch and needs rebase.

Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".

@Sjors
Copy link
Member Author

Sjors commented Mar 10, 2022

@ryanofsky thanks for all the comments, I'm a bit behind on things, but will get to them.

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re: #414 (comment)

@ryanofsky thanks for all the comments, I'm a bit behind on things, but will get to them.

👍

Even though I suggested a lot of changes, I think this PR is ok in its current form. The other reviewers who objected to this PR previously should speak up if they still have issues with it, or if they think any changes would make it better. Sjors has already put a good amount of work into this, and some of the changes I suggested would require even more effort. So it'd be good to sync up and make sure effort is not wasted.

@@ -564,6 +564,10 @@ int GuiMain(int argc, char* argv[])
// - QSettings() will use the new application name after this, resulting in network-specific settings
// - Needs to be done before createOptionsModel

QSettings settings;
std::string chain = settings.value("chain", "main").toString().toStdString();
gArgs.SoftSetArg("-chain", chain);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re: #414 (comment)

It might be good to show a message on startup the first time bitcoin is started after switching networks. [...]

Replying to myself, maybe a better startup message would be: "Bitcoin-Qt configuration has changed and will now connect to the {Testnet} network instead of the {Mainnet} network. {Mainnet} wallets will not be loaded while connected to the {Testnet} network. Also {Testnet} coins are separate from actual bitcoins, and are not supposed to have any value." Dialog could include a checkbox "Do not show this message again," and buttons "Continue connecting to {Testnet} network" / "Exit and switch back to {Mainnet network}" for a safe escape.

(And again I really think ideally none of these dialogs would be necessary and new networks would just open in new windows without closing existing ones. But showing clear messages could at least avoid pitfalls if only one window can be open at a time)

@RandyMcMillan
Copy link
Contributor

Concept reACK

If a custom signet is detected - It would be great to add a truncated "finger print" of the active signet_challenge - I have experimented with adding a signet challenge to the window title and menu and the string is simply too long - but a "finger print" will work in the window title. Maybe use a finger print with 8 chars?

examples:

  1. BitcoinCore - [signet] [stuvwxyz]
    or
  2. BitcoinCore - [signet] [...stuvwxyz]
    or
  3. BitcoinCore - [signet] [abcd...wxyz]

Just an idea...but if this was added - option 3 seems best IMO.

@luke-jr
Copy link
Member

luke-jr commented Mar 13, 2022

Concept re-NACK.

How about for macOS only, a menu item that simply launches a separate instance on a test network?

@stickies-v stickies-v mentioned this pull request Mar 29, 2022
5 tasks
@hebasto
Copy link
Member

hebasto commented Jul 19, 2022

What is the status of this PR?

@Sjors
Copy link
Member Author

Sjors commented Jul 19, 2022

@hebasto still on my list to look into some of the other approaches suggested above. But if anyone else wants to do it sooner, don't hesitate!

How about for macOS only, a menu item that simply launches a separate instance on a test network?

That would be fine by me, not sure if it requires adding dependencies to launch an application.

@hebasto
Copy link
Member

hebasto commented Oct 26, 2022

Closing this as it has not had any activity in a while. If you are interested in continuing work on this, please leave a comment so that it can be reopened.

But if anyone else wants to do it sooner, don't hesitate!

Will be labeled "Up for grabs".

@hebasto hebasto closed this Oct 26, 2022
@bitcoin-core bitcoin-core locked and limited conversation to collaborators Oct 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature Needs rebase Up for grabs UX All about "how to get things done"
Projects
None yet
Development

Successfully merging this pull request may close these issues.