Skip to content

Commit

Permalink
Merge branch 'master' into pr/946-create-app-for-osx-and-pack-app-in-dmg
Browse files Browse the repository at this point in the history
  • Loading branch information
nopara73 committed Dec 13, 2018
2 parents c0d1cb3 + b86d03d commit 2b49810
Show file tree
Hide file tree
Showing 17 changed files with 186 additions and 50 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<AvaloniaVersion>0.7.1-build935-beta</AvaloniaVersion>
<AvaloniaVersion>0.7.1-build989-beta</AvaloniaVersion>
<AvaloniaBehaviorsVersion>0.7.0</AvaloniaBehaviorsVersion>
</PropertyGroup>

Expand Down
12 changes: 6 additions & 6 deletions WalletWasabi.Backend/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,37 +54,37 @@ <h1>Reclaim your privacy now!</h1>
<div class="col-lg-4 col-12 box-1">
<img src="images/windows.png" height="100" alt="open_source">
<br /><br />
<a class="btn-block btn btn-lg btn-dark" href="https://github.com/zkSNACKs/WalletWasabi/releases/download/v1.0.2/Wasabi-1.0.2.msi">
<a class="btn-block btn btn-lg btn-dark" href="https://github.com/zkSNACKs/WalletWasabi/releases/download/v1.0.3/Wasabi-1.0.3.msi">
<img class="download-icon" src="/images/download.svg" width="18" height="18" alt="Download Wasabi">
Windows 7, 8, 10
<br />
<small>.msi, 64 bit</small>
</a>
<a href="https://github.com/zkSNACKs/WalletWasabi/releases/download/v1.0.2/Wasabi-1.0.2.msi.asc">(Signature)</a>
<a href="https://github.com/zkSNACKs/WalletWasabi/releases/download/v1.0.3/Wasabi-1.0.3.msi.asc">(Signature)</a>
<a href="https://github.com/zkSNACKs/WalletWasabi/blob/master/WalletWasabi.Documentation/Guides/InstallInstructions.md#windows">(Help)</a>
</div>
<div class="col-lg-4 col-12 box-2">
<img src="images/linux.png" height="100" alt="open_source">
<br /><br />
<a class="btn-block btn btn-lg btn-dark" href="https://github.com/zkSNACKs/WalletWasabi/releases/download/v1.0.2/WasabiLinux-1.0.2.tar.gz">
<a class="btn-block btn btn-lg btn-dark" href="https://github.com/zkSNACKs/WalletWasabi/releases/download/v1.0.3/WasabiLinux-1.0.3.tar.gz">
<img class="download-icon" src="/images/download.svg" width="18" height="18" alt="Download Wasabi">
Linux
<br />
<small>.tar.gz, 64 bit</small>
</a>
<a href="https://github.com/zkSNACKs/WalletWasabi/releases/download/v1.0.2/WasabiLinux-1.0.2.tar.gz.asc">(Signature)</a>
<a href="https://github.com/zkSNACKs/WalletWasabi/releases/download/v1.0.3/WasabiLinux-1.0.3.tar.gz.asc">(Signature)</a>
<a href="https://github.com/zkSNACKs/WalletWasabi/blob/master/WalletWasabi.Documentation/Guides/InstallInstructions.md#linux">(Help)</a>
</div>
<div class="col-lg-4 col-12 box-3">
<img src="images/apple.png" height="100" alt="open_source">
<br /><br />
<a class="btn-block btn btn-lg btn-dark" href="https://github.com/zkSNACKs/WalletWasabi/releases/download/v1.0.2/WasabiOsx-1.0.2.tar.gz">
<a class="btn-block btn btn-lg btn-dark" href="https://github.com/zkSNACKs/WalletWasabi/releases/download/v1.0.3/WasabiOsx-1.0.3.tar.gz">
<img class="download-icon" src="/images/download.svg" width="18" height="18" alt="Download Wasabi">
macOS 10.12+
<br />
<small>.tar.gz, 64 bit</small>
</a>
<a href="https://github.com/zkSNACKs/WalletWasabi/releases/download/v1.0.2/WasabiOsx-1.0.2.tar.gz.asc">(Signature)</a>
<a href="https://github.com/zkSNACKs/WalletWasabi/releases/download/v1.0.3/WasabiOsx-1.0.3.tar.gz.asc">(Signature)</a>
<a href="https://github.com/zkSNACKs/WalletWasabi/blob/master/WalletWasabi.Documentation/Guides/InstallInstructions.md#osx">(Help)</a>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions WalletWasabi.Documentation/Guides/InstallInstructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Check out this [video guide](https://www.youtube.com/watch?v=qFbv_b-bju4) or tak

![](https://imgur.com/iZXWBAl.png)

Download the Linux archive and extract it, while keeping the file permissions: `tar -pxzf WasabiLinux-1.0.2.tar.gz`.
Download the Linux archive and extract it, while keeping the file permissions: `tar -pxzf WasabiLinux-1.0.3.tar.gz`.
You can run Wasabi by executing `./wassabee`.

After first run, a working directory will be created: `~/.walletwasabi/`. Amongst others, here is where your wallet files and your logs reside.
Expand All @@ -31,7 +31,7 @@ Check out this [video guide](https://www.youtube.com/watch?v=qFbv_b-bju4) or tak

![](https://imgur.com/jpnKad7.png)

Download the OSX archive and extract it, while keeping the file permissions: `tar -pxzf WasabiOsx-1.0.2.tar.gz`.
Download the OSX archive and extract it, while keeping the file permissions: `tar -pxzf WasabiOsx-1.0.3.tar.gz`.
You can run Wasabi by executing `./wassabee`.

After first run, a working directory will be created: `~/.walletwasabi/`. Amongst others, here is where your wallet files and your logs reside.
58 changes: 52 additions & 6 deletions WalletWasabi.Gui/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using WalletWasabi.Helpers;
using WalletWasabi.Interfaces;
using WalletWasabi.Logging;
using WalletWasabi.TorSocks5;

namespace WalletWasabi.Gui
{
Expand All @@ -31,6 +32,12 @@ public class Config : IConfig
[JsonProperty(PropertyName = "TestNetBackendUriV3")]
public string TestNetBackendUriV3 { get; private set; }

[JsonProperty(PropertyName = "MainNetFallbackBackendUri")]
public string MainNetFallbackBackendUri { get; private set; }

[JsonProperty(PropertyName = "TestNetFallbackBackendUri")]
public string TestNetFallbackBackendUri { get; private set; }

[JsonProperty(PropertyName = "RegTestBackendUriV3")]
public string RegTestBackendUriV3 { get; private set; }

Expand All @@ -50,10 +57,16 @@ public class Config : IConfig
public int? TorSocks5Port { get; internal set; }

private Uri _backendUri;
private Uri _fallbackBackendUri;

public Uri GetCurrentBackendUri()
{
if (!(_backendUri is null)) return _backendUri;
if (TorProcessManager.RequestFallbackAddressUsage)
{
return GetFallbackBackendUri();
}

if (_backendUri != null) return _backendUri;

if (Network == Network.Main)
{
Expand All @@ -71,6 +84,26 @@ public Uri GetCurrentBackendUri()
return _backendUri;
}

public Uri GetFallbackBackendUri()
{
if (_fallbackBackendUri != null) return _fallbackBackendUri;

if (Network == Network.Main)
{
_fallbackBackendUri = new Uri(MainNetFallbackBackendUri);
}
else if (Network == Network.TestNet)
{
_fallbackBackendUri = new Uri(TestNetFallbackBackendUri);
}
else // RegTest
{
_fallbackBackendUri = new Uri(RegTestBackendUriV3);
}

return _fallbackBackendUri;
}

private IPEndPoint _torSocks5EndPoint;

public IPEndPoint GetTorSocks5EndPoint()
Expand Down Expand Up @@ -119,12 +152,15 @@ public Config(string filePath)
SetFilePath(filePath);
}

public Config(Network network, string mainNetBackendUriV3, string testNetBackendUriV3, string regTestBackendUriV3, string mainNetBlindingRsaPubKey, string testNetBlindingRsaPubKey, string regTestBlindingRsaPubKey, string torHost, int? torSocks5Port)
public Config(Network network, string mainNetBackendUriV3, string testNetBackendUriV3, string mainNetFallbackBackendUri, string testNetFallbackBackendUri, string regTestBackendUriV3, string mainNetBlindingRsaPubKey, string testNetBlindingRsaPubKey, string regTestBlindingRsaPubKey, string torHost, int? torSocks5Port)
{
Network = Guard.NotNull(nameof(network), network);

MainNetBackendUriV3 = Guard.NotNullOrEmptyOrWhitespace(nameof(mainNetBackendUriV3), mainNetBackendUriV3);
TestNetBackendUriV3 = Guard.NotNullOrEmptyOrWhitespace(nameof(testNetBackendUriV3), testNetBackendUriV3);
MainNetFallbackBackendUri = Guard.NotNullOrEmptyOrWhitespace(nameof(mainNetFallbackBackendUri), mainNetFallbackBackendUri);
TestNetFallbackBackendUri = Guard.NotNullOrEmptyOrWhitespace(nameof(testNetFallbackBackendUri), testNetFallbackBackendUri);
TestNetBackendUriV3 = Guard.NotNullOrEmptyOrWhitespace(nameof(testNetBackendUriV3), testNetBackendUriV3);
RegTestBackendUriV3 = Guard.NotNullOrEmptyOrWhitespace(nameof(regTestBackendUriV3), regTestBackendUriV3);

MainNetBlindingRsaPubKey = Guard.NotNullOrEmptyOrWhitespace(nameof(mainNetBlindingRsaPubKey), mainNetBlindingRsaPubKey);
Expand Down Expand Up @@ -155,6 +191,8 @@ public async Task LoadOrCreateDefaultFileAsync()

MainNetBackendUriV3 = "http://wasabiukrxmkdgve5kynjztuovbg43uxcbcxn6y2okcrsg7gb6jdmbad.onion/";
TestNetBackendUriV3 = "http://testwnp3fugjln6vh5vpj7mvq3lkqqwjj3c2aafyu7laxz42kgwh2rad.onion/";
MainNetFallbackBackendUri = "https://wasabiwallet.io/";
TestNetFallbackBackendUri = "https://wasabiwallet.co/";
RegTestBackendUriV3 = "http://localhost:37127/";

MainNetBlindingRsaPubKey = "16421152619146079007287475569112871971988560541093277613438316709041030720662622782033859387192362542996510605015506477964793447620206674394713753349543444988246276357919473682408472170521463339860947351211455351029147665615454176157348164935212551240942809518428851690991984017733153078846480521091423447691527000770982623947706172997649440619968085147635776736938871139581019988225202983052255684151711253254086264386774936200194229277914886876824852466823571396538091430866082004097086602287294474304344865162932126041736158327600847754258634325228417149098062181558798532036659383679712667027126535424484318399849";
Expand Down Expand Up @@ -189,6 +227,8 @@ public async Task LoadFileAsync()

MainNetBackendUriV3 = config.MainNetBackendUriV3 ?? MainNetBackendUriV3;
TestNetBackendUriV3 = config.TestNetBackendUriV3 ?? TestNetBackendUriV3;
MainNetFallbackBackendUri = config.MainNetFallbackBackendUri ?? MainNetFallbackBackendUri;
TestNetFallbackBackendUri = config.TestNetFallbackBackendUri ?? TestNetFallbackBackendUri;
RegTestBackendUriV3 = config.RegTestBackendUriV3 ?? RegTestBackendUriV3;

MainNetBlindingRsaPubKey = config.MainNetBlindingRsaPubKey ?? MainNetBlindingRsaPubKey;
Expand Down Expand Up @@ -221,17 +261,23 @@ public async Task<bool> CheckFileChangeAsync()
return true;
}

if (!MainNetBackendUriV3.Equals(config.MainNetBackendUriV3, StringComparison.OrdinalIgnoreCase))
{
return true;
}
if (!TestNetBackendUriV3.Equals(config.TestNetBackendUriV3, StringComparison.OrdinalIgnoreCase))
{
return true;
}

if (!RegTestBackendUriV3.Equals(config.RegTestBackendUriV3, StringComparison.OrdinalIgnoreCase))
if (!MainNetFallbackBackendUri.Equals(config.MainNetFallbackBackendUri, StringComparison.OrdinalIgnoreCase))
{
return true;
}

if (!MainNetBackendUriV3.Equals(config.MainNetBackendUriV3, StringComparison.OrdinalIgnoreCase))
if (!TestNetFallbackBackendUri.Equals(config.TestNetFallbackBackendUri, StringComparison.OrdinalIgnoreCase))
{
return true;
}
if (!RegTestBackendUriV3.Equals(config.RegTestBackendUriV3, StringComparison.OrdinalIgnoreCase))
{
return true;
}
Expand Down
3 changes: 2 additions & 1 deletion WalletWasabi.Gui/Global.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ public static void InitializeNoWallet()

TorManager = new TorProcessManager(Config.GetTorSocks5EndPoint(), TorLogsFile);
TorManager.Start(false, DataDir);
TorManager.StartMonitor(TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(7), DataDir);
var fallbackRequestTestUri = new Uri(Config.GetFallbackBackendUri(), "/api/software/versions");
TorManager.StartMonitor(TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(7), DataDir, fallbackRequestTestUri);

Logger.LogInfo<TorProcessManager>($"{nameof(TorProcessManager)} is initialized.");

Expand Down
14 changes: 12 additions & 2 deletions WalletWasabi.Gui/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
xmlns:beh="clr-namespace:AvalonStudio.Utils.Behaviors;assembly=AvalonStudio.Utils"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Icon="resm:WalletWasabi.Gui.Assets.WasabiLogo.png?assembly=WalletWasabi.Gui"
Title="{Binding Title}" BorderThickness="1" BorderBrush="{DynamicResource AvalonBorderBrush}"
Title="{Binding Title}"
MinWidth="1100" MinHeight="530"
FontFamily="{DynamicResource UiFont}" FontSize="14"
Foreground="{DynamicResource ThemeForegroundBrush}"
Expand All @@ -23,8 +23,18 @@
<behaviors:PredicateCloseBehavior CanClose="{Binding CanClose}" />
</i:Interaction.Behaviors>
<cont:MetroWindow.TitleBarContent>
<menu:MainMenuView DataContext="{Binding Shell.MainMenu}" Margin="4 0 0 0" Foreground="{DynamicResource ThemeForegroundBrush}" VerticalAlignment="Stretch" FontSize="13" />
</cont:MetroWindow.TitleBarContent>
<Grid Margin="0,10,0,0">
<cont:MetroWindow.Styles>
<Style Selector="Menu > MenuItem:selected /template/ Border#root">
<Setter Property="Background" Value="{DynamicResource ThemeControlMidBrush}"/>
</Style>

<Style Selector="Menu > MenuItem">
<Setter Property="Padding" Value="7 0"/>
</Style>
</cont:MetroWindow.Styles>
<Grid>
<DockPanel LastChildFill="True">
<wasabi:StatusBar DockPanel.Dock="Bottom" DataContext="{Binding StatusBar}" />
<shell:ShellView DataContext="{Binding Shell}" />
Expand Down
27 changes: 26 additions & 1 deletion WalletWasabi.Gui/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using Avalonia;
using Avalonia.Gtk3;
using AvalonStudio.Shell;
using AvalonStudio.Shell.Extensibility.Platforms;
using NBitcoin;
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Logging;
Expand Down Expand Up @@ -81,6 +83,29 @@ static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEv
Logger.LogWarning(e?.ExceptionObject as Exception, "UnhandledException");
}

private static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure<App>().UsePlatformDetect().UseReactiveUI();
private static AppBuilder BuildAvaloniaApp()
{
var result = AppBuilder.Configure<App>();

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
result
.UseWin32()
.UseDirect2D1();
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
result.UseGtk3(new Gtk3PlatformOptions
{
UseDeferredRendering = true,
UseGpuAcceleration = true
}).UseSkia();
}
{
result.UsePlatformDetect();
}

return result;
}
}
}
11 changes: 0 additions & 11 deletions WalletWasabi.Gui/WalletWasabi.Gui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@

<ItemGroup>
<None Remove="Extensions\DummyHack.txt" />
<None Remove="msvcp140.dll" />
<None Remove="vcruntime140.dll" />
</ItemGroup>

<ItemGroup>
Expand All @@ -54,15 +52,6 @@
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="msvcp140.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="vcruntime140.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia.Desktop" />
</ItemGroup>
Expand Down
Binary file removed WalletWasabi.Gui/msvcp140.dll
Binary file not shown.
Binary file removed WalletWasabi.Gui/vcruntime140.dll
Binary file not shown.
10 changes: 10 additions & 0 deletions WalletWasabi/Extensions/RPCClientExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WalletWasabi.Logging;
using WalletWasabi.Models;
Expand Down Expand Up @@ -114,5 +117,12 @@ private static EstimateSmartFeeResponse SimulateRegTestFeeEstimation(int confirm
var resp = new EstimateSmartFeeResponse { Blocks = confirmationTarget, FeeRate = feeRate };
return resp;
}

public static async Task<RPCResponse> TestMempoolAcceptAsync(this RPCClient rpc, bool allowHighFees, params Transaction[] transactions)
{
RPCResponse resp = await rpc.SendCommandAsync("testmempoolaccept", transactions.Select(x => x.ToHex()).ToArray(), allowHighFees);

return resp;
}
}
}
2 changes: 1 addition & 1 deletion WalletWasabi/Helpers/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace WalletWasabi.Helpers
{
public static class Constants
{
public static readonly Version ClientVersion = new Version(1, 0, 2);
public static readonly Version ClientVersion = new Version(1, 0, 3);
public const string BackendMajorVersion = "2";
public static readonly VersionsResponse VersionsResponse = new VersionsResponse { ClientVersion = ClientVersion.ToString(), BackenMajordVersion = BackendMajorVersion };

Expand Down
2 changes: 1 addition & 1 deletion WalletWasabi/Services/WalletService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public async Task InitializeAsync(CancellationToken cancel)
}
}
}
catch(Exception ex)
catch (Exception ex)
{
Logger.LogWarning<WalletService>(ex);
}
Expand Down
Loading

0 comments on commit 2b49810

Please sign in to comment.