-
Notifications
You must be signed in to change notification settings - Fork 490
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
Tor: Configurable ports #11997
Tor: Configurable ports #11997
Conversation
@@ -54,7 +54,7 @@ public async Task<ExitCode> RunAsync(Func<Task> afterStarting) | |||
return ExitCode.Ok; | |||
} | |||
|
|||
if (AppConfig.MustCheckSingleInstance) | |||
if (AppConfig.MustCheckSingleInstance && !AppConfig.Arguments.Contains("--disableSingleInstanceCheck")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this as it does not feel 'finished'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to run two WW instances separately.
Once closing Wasabi the crash reporter shows up but I guess this is expected because of the argument --disableSingleInstanceCheck
in the command to run.
2024-01-10 19:01:13.618 [1] CRITICAL Program.Main (75) System.NullReferenceException: Object reference not set to an instance of an object.
at WalletWasabi.Services.SingleInstanceChecker.Dispose() in WalletWasabi\Services\SingleInstanceChecker.cs:line 219
at WalletWasabi.Daemon.WasabiApplication.BeforeStopping() in WalletWasabi.Daemon\WasabiAppBuilder.cs:line 104
at WalletWasabi.Daemon.WasabiApplication.RunAsync(Func`1 afterStarting) in WalletWasabi.Daemon\WasabiAppBuilder.cs:line 83
at WalletWasabi.Fluent.Desktop.WasabiAppExtensions.RunAsGuiAsync(WasabiApplication app) in WalletWasabi.Fluent.Desktop\Program.cs:line 147
at WalletWasabi.Fluent.Desktop.Program.Main(String[] args) in WalletWasabi.Fluent.Desktop\Program.cs:line 63
Does this help running Wasabi on torified OS? |
How about |
I want to remove that parameter. I'm not happy with the implementation of that part just yet. So yes, that's somewhat expected because this PR combines two features:
It's a step towards that future. There is more work to do if we want to support1 those OSes. Footnotes
|
176567e
to
882fec9
Compare
It sounds good but I'm not sure if we want to spend time on it. The idea of this PR was that having Tor ports configurable adds some value because you can:
Supporting |
Maybe need to ask ChatGPT to translate that Python code from JoinMarket to C#. :) I will probably try, but also don't want to spend too much time on this. |
This is suggestion from ChatGPT. using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
public class PortUtils
{
public static List<int> GetFreeTcpPorts(int numPorts)
{
List<int> ports = new List<int>();
List<Socket> sockets = new List<Socket>();
for (int i = 0; i < numPorts; i++)
{
Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
s.Bind(new IPEndPoint(IPAddress.Any, 0));
s.Listen(1);
ports.Add(((IPEndPoint)s.LocalEndPoint).Port);
sockets.Add(s);
}
foreach (Socket s in sockets)
{
s.Close();
}
return ports;
}
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK, code LGTM
This PR allows to change WW default ports assigned to the bundled Tor.
As a consequence, it would be possible to run WW instances like this:
That is useful for tests and useful for advanced scenarios for advanced users.