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

Persist Proxy settings #433

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pablomartin4btc
Copy link
Contributor

@pablomartin4btc pablomartin4btc commented Nov 14, 2024

(This is based on top of #430).

Adding the required logic to persist the configuration of both default Proxy and Tor proxy values to settings.json(location).

Disabling a proxy thru its switch will remove the setting from the config file.


What to test on this PR:

Simply verify that the proxy value entered in the UI gets persisted into the file mentioned above, and if you manually touch the file or restart the application, the UI reflects the values read from the file.

How to test that the Proxy feature it's actually working:

1. Start bitcoin-qt with rpc enabled (with `-proxy` option OR leave it without it to verify that the value is getting read from the `settings.json` file).

./src/qt/bitcoin-qt -regtest -proxy=127.0.0.1 -server=1

2. Run rpc getnetworkinfo from bitcoin-cli to verify the proxy has been set (you might need to update the -rpcport according to the chainnet selected option).
./src/bitcoin-cli -regtest -rpcport=18443 getnetworkinfo
{
  "version": 259900,
  "subversion": "/Satoshi:25.99.0/",
  "protocolversion": 70016,
  "localservices": "0000000000000409",
  "localservicesnames": [
    "NETWORK",
    "WITNESS",
    "NETWORK_LIMITED"
  ],
  "localrelay": true,
  "timeoffset": 0,
  "networkactive": true,
  "connections": 0,
  "connections_in": 0,
  "connections_out": 0,
  "networks": [
    {
      "name": "ipv4",
      "limited": false,
      "reachable": true,
      "proxy": "127.0.0.1:9050",
...

  1. If you wish to check also the proper proxy traffic you can setup up a local proxy following the "Test instructions" section at the top description of the gui PR #836.

Allowed to configure the proxy with an IPv6 address and moved
the validation out from the UI/ control to the node interface.
@pablomartin4btc pablomartin4btc force-pushed the qml-proxy-settings-persistence branch from 6c0cb81 to d9f99a9 Compare November 14, 2024 20:03
@pablomartin4btc pablomartin4btc changed the title Persist proxy settings to settings.json Persist Proxy settings Nov 14, 2024
@pablomartin4btc pablomartin4btc force-pushed the qml-proxy-settings-persistence branch from d9f99a9 to 0c9722a Compare November 14, 2024 20:11
Addding the logic to persist the ip address and port values of both
the default proxy and the tor proxy configuration into settings.js.
@D33r-Gee
Copy link
Contributor

D33r-Gee commented Dec 4, 2024

does it need rebase?

Copy link
Contributor

@D33r-Gee D33r-Gee left a comment

Choose a reason for hiding this comment

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

tACK 8ef413b works as expected on Ubuntu 20.04

Ubuntu 20.04 screenshots

Screenshot 2024-12-05 100228
settings.json:
Screenshot 2024-12-05 100245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants