gui-qml icon indicating copy to clipboard operation
gui-qml copied to clipboard

Persist Proxy settings

Open pablomartin4btc opened this issue 11 months ago • 1 comments

(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.

pablomartin4btc avatar Nov 14 '24 20:11 pablomartin4btc