Add Bitcoin Only Build

This commit is contained in:
XPayServer
2020-07-28 22:48:51 +02:00
parent b7d66efb20
commit 92ae1109d0
41 changed files with 270 additions and 74 deletions

View File

@@ -49,8 +49,10 @@ jobs:
LATEST_TAG=${CIRCLE_TAG:1} #trim v from tag
#
sudo docker build --pull -t $DOCKERHUB_REPO:$LATEST_TAG-amd64 -f amd64.Dockerfile .
sudo docker build --pull --build-arg CONFIGURATION_NAME=Altcoins-Release -t $DOCKERHUB_REPO:$LATEST_TAG-altcoins-amd64 -f amd64.Dockerfile .
sudo docker login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
sudo docker push $DOCKERHUB_REPO:$LATEST_TAG-amd64
sudo docker push $DOCKERHUB_REPO:$LATEST_TAG-altcoins-amd64
arm32v7:
machine:
@@ -63,8 +65,10 @@ jobs:
LATEST_TAG=${CIRCLE_TAG:1} #trim v from tag
#
sudo docker build --pull -t $DOCKERHUB_REPO:$LATEST_TAG-arm32v7 -f arm32v7.Dockerfile .
sudo docker build --pull --build-arg CONFIGURATION_NAME=Altcoins-Release -t $DOCKERHUB_REPO:$LATEST_TAG-altcoins-arm32v7 -f arm32v7.Dockerfile .
sudo docker login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
sudo docker push $DOCKERHUB_REPO:$LATEST_TAG-arm32v7
sudo docker push $DOCKERHUB_REPO:$LATEST_TAG-altcoins-arm32v7
arm64v8:
machine:
@@ -77,8 +81,10 @@ jobs:
LATEST_TAG=${CIRCLE_TAG:1} #trim v from tag
#
sudo docker build --pull -t $DOCKERHUB_REPO:$LATEST_TAG-arm64v8 -f arm64v8.Dockerfile .
sudo docker build --build-arg CONFIGURATION_NAME=Altcoins-Release --pull -t $DOCKERHUB_REPO:$LATEST_TAG-altcoins-arm64v8 -f arm64v8.Dockerfile .
sudo docker login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
sudo docker push $DOCKERHUB_REPO:$LATEST_TAG-arm64v8
sudo docker push $DOCKERHUB_REPO:$LATEST_TAG-altcoins-arm64v8
multiarch:
machine:
@@ -100,6 +106,13 @@ jobs:
sudo docker manifest annotate $DOCKERHUB_REPO:$LATEST_TAG $DOCKERHUB_REPO:$LATEST_TAG-arm64v8 --os linux --arch arm64 --variant v8
sudo docker manifest push $DOCKERHUB_REPO:$LATEST_TAG -p
sudo docker manifest create --amend $DOCKERHUB_REPO:$LATEST_TAG-altcoins $DOCKERHUB_REPO:$LATEST_TAG-altcoins-amd64 $DOCKERHUB_REPO:$LATEST_TAG-altcoins-arm32v7 $DOCKERHUB_REPO:$LATEST_TAG-altcoins-arm64v8
sudo docker manifest annotate $DOCKERHUB_REPO:$LATEST_TAG-altcoins $DOCKERHUB_REPO:$LATEST_TAG-altcoins-amd64 --os linux --arch amd64
sudo docker manifest annotate $DOCKERHUB_REPO:$LATEST_TAG-altcoins $DOCKERHUB_REPO:$LATEST_TAG-altcoins-arm32v7 --os linux --arch arm --variant v7
sudo docker manifest annotate $DOCKERHUB_REPO:$LATEST_TAG-altcoins $DOCKERHUB_REPO:$LATEST_TAG-altcoins-arm64v8 --os linux --arch arm64 --variant v8
sudo docker manifest push $DOCKERHUB_REPO:$LATEST_TAG-altcoins -p
workflows:
version: 2
build_and_test:

View File

@@ -2,6 +2,8 @@
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Configurations>Debug;Release;Altcoins-Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>
<ItemGroup>

View File

@@ -45,6 +45,7 @@ namespace BTCPayServer
_NBXplorerNetworkProvider = new NBXplorerNetworkProvider(networkType);
NetworkType = networkType;
InitBitcoin();
#if ALTCOINS_RELEASE || DEBUG
InitLiquid();
InitLiquidAssets();
InitLitecoin();
@@ -80,6 +81,7 @@ namespace BTCPayServer
// Disabled because of https://twitter.com/Cryptopia_NZ/status/1085084168852291586
//InitBitcoinplus();
//InitUfo();
#endif
}
/// <summary>

View File

@@ -1,3 +1,4 @@
#if ALTCOINS_RELEASE || DEBUG
using NBitcoin;
using NBitcoin.Altcoins;
using NBitcoin.Altcoins.Elements;
@@ -34,3 +35,4 @@ namespace BTCPayServer
}
#endif

View File

@@ -1,3 +1,4 @@
#if ALTCOINS_RELEASE || DEBUG
using NBitcoin;
namespace BTCPayServer
@@ -81,3 +82,4 @@ namespace BTCPayServer
}
#endif

View File

@@ -1,3 +1,4 @@
#if ALTCOINS_RELEASE || DEBUG
using System.Collections.Generic;
using System.Linq;
using NBitcoin;
@@ -58,3 +59,4 @@ namespace BTCPayServer
}
}
}
#endif

View File

@@ -0,0 +1,18 @@
#if ALTCOINS_RELEASE || DEBUG
using System.Collections.Generic;
using System.Linq;
namespace BTCPayServer
{
public static class LiquidExtensions
{
public static IEnumerable<string> GetAllElementsSubChains(this BTCPayNetworkProvider networkProvider)
{
var elementsBased = networkProvider.GetAll().OfType<ElementsBTCPayNetwork>();
var parentChains = elementsBased.Select(network => network.NetworkCryptoCode.ToUpperInvariant()).Distinct();
return networkProvider.UnfilteredNetworks.GetAll().OfType<ElementsBTCPayNetwork>()
.Where(network => parentChains.Contains(network.NetworkCryptoCode)).Select(network => network.CryptoCode.ToUpperInvariant());
}
}
}
#endif

View File

@@ -1,4 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configurations>Debug;Release;Altcoins-Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>
<Import Project="../Build/Version.csproj" Condition="Exists('../Build/Version.csproj')" />
<Import Project="../Build/Common.csproj" />

View File

@@ -1,4 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configurations>Debug;Release;Altcoins-Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>
<Import Project="../Build/Version.csproj" Condition="Exists('../Build/Version.csproj')" />
<Import Project="../Build/Common.csproj" />
<ItemGroup>

View File

@@ -1,4 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configurations>Debug;Release;Altcoins-Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>
<Import Project="../Build/Version.csproj" Condition="Exists('../Build/Version.csproj')" />
<Import Project="../Build/Common.csproj" />

View File

@@ -9,6 +9,8 @@
<UserSecretsId>AB0AC1DD-9D26-485B-9416-56A33F268117</UserSecretsId>
<!--https://devblogs.microsoft.com/aspnet/testing-asp-net-core-mvc-web-apps-in-memory/-->
<PreserveCompilationContext>true</PreserveCompilationContext>
<Configurations>Debug;Release;Altcoins-Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>
<!--https://devblogs.microsoft.com/aspnet/testing-asp-net-core-mvc-web-apps-in-memory/-->
<Target Name="CopyAditionalFiles" AfterTargets="Build" Condition="'$(TargetFramework)'!=''">

View File

@@ -5,8 +5,12 @@
<RazorCompileOnBuild>false</RazorCompileOnBuild>
<DefineConstants>$(DefineConstants);RAZOR_RUNTIME_COMPILE</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<Configurations>Debug;Release;Altcoins-Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Build\**" />
@@ -21,6 +25,10 @@
<None Remove="Build\**" />
<None Remove="wwwroot\bundles\jqueryvalidate\**" />
<None Remove="wwwroot\vendor\jquery-nice-select\**" />
<Content Update="Views\Shared\NBXSyncSummary.cshtml">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Remove="Currencies.txt" />
@@ -28,6 +36,22 @@
<ItemGroup>
<EmbeddedResource Include="bundleconfig.json" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Debug' Or '$(Configuration)'=='Altcoins-Release' ">
<PackageReference Include="Nethereum.ABI" Version="3.8.0" />
<PackageReference Include="Nethereum.HdWallet" Version="3.8.0" />
<PackageReference Include="Nethereum.StandardTokenEIP20" Version="3.8.0" />
<PackageReference Include="Nethereum.Web3" Version="3.8.0" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Release'">
<Content Remove="Services\Altcoins\**\*" />
<Content Remove="Views\EthereumLikeStore\**\*" />
<Content Remove="Views\MoneroLikeStore\**\*" />
<Content Remove="Views\Shared\Ethereum\**\*" />
<Content Remove="Views\Shared\Monero\**\*" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="BTCPayServer.Hwi" Version="1.1.3" />
<PackageReference Include="BTCPayServer.Lightning.All" Version="1.2.0" />

View File

@@ -90,11 +90,9 @@ namespace BTCPayServer.Configuration
var networkProvider = new BTCPayNetworkProvider(NetworkType);
var filtered = networkProvider.Filter(supportedChains.ToArray());
var elementsBased = filtered.GetAll().OfType<ElementsBTCPayNetwork>();
var parentChains = elementsBased.Select(network => network.NetworkCryptoCode.ToUpperInvariant()).Distinct();
var allSubChains = networkProvider.GetAll().OfType<ElementsBTCPayNetwork>()
.Where(network => parentChains.Contains(network.NetworkCryptoCode)).Select(network => network.CryptoCode.ToUpperInvariant());
supportedChains.AddRange(allSubChains);
#if ALTCOINS_RELEASE || DEBUG
supportedChains.AddRange(filtered.GetAllElementsSubChains());
#endif
NetworkProvider = networkProvider.Filter(supportedChains.ToArray());
foreach (var chain in supportedChains)
{

View File

@@ -0,0 +1,10 @@
namespace BTCPayServer.Contracts
{
public interface ISyncSummaryProvider
{
bool AllAvailable();
string Partial { get; }
}
}

View File

@@ -520,7 +520,9 @@ namespace BTCPayServer.Controllers
Value = value,
WalletId = new WalletId(store.Id, paymentMethodId.CryptoCode),
Enabled = !excludeFilters.Match(paymentMethodId) && strategy != null,
#if ALTCOINS_RELEASE || DEBUG
Collapsed = network is ElementsBTCPayNetwork elementsBTCPayNetwork && elementsBTCPayNetwork.NetworkCryptoCode != elementsBTCPayNetwork.CryptoCode && string.IsNullOrEmpty(value)
#endif
});
break;
case LightningPaymentType _:

View File

@@ -16,6 +16,7 @@ namespace BTCPayServer
return money.ToDecimal(MoneyUnit.BTC);
case MoneyBag mb:
return mb.Select(money => money.GetValue(network)).Sum();
#if ALTCOINS_RELEASE || DEBUG
case AssetMoney assetMoney:
if (network is ElementsBTCPayNetwork elementsBTCPayNetwork)
{
@@ -24,6 +25,7 @@ namespace BTCPayServer
: 0;
}
throw new NotSupportedException("IMoney type not supported");
#endif
default:
throw new NotSupportedException("IMoney type not supported");
}

View File

@@ -2,6 +2,7 @@ using System;
using System.IO;
using System.Threading;
using BTCPayServer.Configuration;
using BTCPayServer.Contracts;
using BTCPayServer.Controllers;
using BTCPayServer.Data;
using BTCPayServer.HostedServices;
@@ -16,7 +17,6 @@ using BTCPayServer.Security;
using BTCPayServer.Security.Bitpay;
using BTCPayServer.Security.GreenField;
using BTCPayServer.Services;
using BTCPayServer.Services.Altcoins.Monero;
using BTCPayServer.Services.Apps;
using BTCPayServer.Services.Fees;
using BTCPayServer.Services.Invoices;
@@ -47,7 +47,9 @@ using NBXplorer.DerivationStrategy;
using Newtonsoft.Json;
using NicolasDorier.RateLimits;
using Serilog;
#if ALTCOINS_RELEASE || DEBUG
using BTCPayServer.Services.Altcoins.Monero;
#endif
namespace BTCPayServer.Hosting
{
public static class BTCPayServerServices
@@ -75,7 +77,9 @@ namespace BTCPayServer.Hosting
services.RegisterJsonConverter(n => new ClaimDestinationJsonConverter(n));
services.AddPayJoinServices();
#if ALTCOINS_RELEASE || DEBUG
services.AddMoneroLike();
#endif
services.TryAddSingleton<SettingsRepository>();
services.TryAddSingleton<LabelFactory>();
services.TryAddSingleton<TorServices>();
@@ -177,6 +181,7 @@ namespace BTCPayServer.Hosting
services.TryAddSingleton<LightningConfigurationProvider>();
services.TryAddSingleton<LanguageService>();
services.TryAddSingleton<NBXplorerDashboard>();
services.TryAddSingleton<ISyncSummaryProvider, NBXSyncSummaryProvider>();
services.TryAddSingleton<StoreRepository>();
services.TryAddSingleton<PaymentRequestRepository>();
services.TryAddSingleton<BTCPayWalletProvider>();

View File

@@ -1,5 +1,7 @@
using System;
#if ALTCOINS_RELEASE || DEBUG
using BTCPayServer.Services.Altcoins.Monero.Payments;
#endif
using BTCPayServer.Services.Invoices;
using Newtonsoft.Json.Linq;
@@ -31,9 +33,11 @@ namespace BTCPayServer.Payments
case "offchain":
type = PaymentTypes.LightningLike;
break;
#if ALTCOINS_RELEASE || DEBUG
case "monerolike":
type = MoneroPaymentType.Instance;
break;
#endif
default:
type = null;
return false;

View File

@@ -1,3 +1,4 @@
#if ALTCOINS_RELEASE || DEBUG
using System;
using System.Collections.Generic;
@@ -16,3 +17,4 @@ namespace BTCPayServer.Services.Altcoins.Monero.Configuration
public string WalletDirectory { get; set; }
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if ALTCOINS_RELEASE || DEBUG
using System;
using System.Linq;
using BTCPayServer.Configuration;
@@ -23,6 +24,7 @@ namespace BTCPayServer.Services.Altcoins.Monero
serviceCollection.AddSingleton<MoneroLikePaymentMethodHandler>();
serviceCollection.AddSingleton<IPaymentMethodHandler>(provider => provider.GetService<MoneroLikePaymentMethodHandler>());
serviceCollection.AddSingleton<IStoreNavExtension, MoneroStoreNavExtension>();
serviceCollection.AddSingleton<ISyncSummaryProvider, MoneroSyncSummaryProvider>();
return serviceCollection;
}
@@ -67,3 +69,4 @@ namespace BTCPayServer.Services.Altcoins.Monero
}
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if ALTCOINS_RELEASE || DEBUG
using BTCPayServer.Contracts;
namespace BTCPayServer.Services.Altcoins.Monero
@@ -7,3 +8,4 @@ namespace BTCPayServer.Services.Altcoins.Monero
public string Partial { get; } = "Monero/StoreNavMoneroExtension";
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if ALTCOINS_RELEASE || DEBUG
using BTCPayServer.Payments;
namespace BTCPayServer.Services.Altcoins.Monero.Payments
@@ -34,3 +35,4 @@ namespace BTCPayServer.Services.Altcoins.Monero.Payments
public decimal NextNetworkFee { get; set; }
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if ALTCOINS_RELEASE || DEBUG
using BTCPayServer.Client.Models;
using BTCPayServer.Payments;
using BTCPayServer.Services.Altcoins.Monero.Utils;
@@ -65,3 +66,4 @@ namespace BTCPayServer.Services.Altcoins.Monero.Payments
}
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if ALTCOINS_RELEASE || DEBUG
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -128,3 +129,4 @@ namespace BTCPayServer.Services.Altcoins.Monero.Payments
}
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if ALTCOINS_RELEASE || DEBUG
using System.Globalization;
using BTCPayServer.Payments;
using BTCPayServer.Services.Invoices;
@@ -47,3 +48,4 @@ namespace BTCPayServer.Services.Altcoins.Monero.Payments
public override string InvoiceViewPaymentPartialName { get; } = "Monero/ViewMoneroLikePaymentData";
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if ALTCOINS_RELEASE || DEBUG
using BTCPayServer.Payments;
namespace BTCPayServer.Services.Altcoins.Monero.Payments
@@ -10,3 +11,4 @@ namespace BTCPayServer.Services.Altcoins.Monero.Payments
public PaymentMethodId PaymentId => new PaymentMethodId(CryptoCode, MoneroPaymentType.Instance);
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if ALTCOINS_RELEASE || DEBUG
using BTCPayServer.Filters;
using Microsoft.AspNetCore.Mvc;
@@ -36,3 +37,4 @@ namespace BTCPayServer.Services.Altcoins.Monero.RPC
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if ALTCOINS_RELEASE || DEBUG
namespace BTCPayServer.Services.Altcoins.Monero.RPC
{
public class MoneroEvent
@@ -13,3 +14,4 @@ namespace BTCPayServer.Services.Altcoins.Monero.RPC
}
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if ALTCOINS_RELEASE || DEBUG
using System;
using System.Threading;
using System.Threading.Tasks;
@@ -64,3 +65,4 @@ namespace BTCPayServer.Services.Altcoins.Monero.Services
}
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if ALTCOINS_RELEASE || DEBUG
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -374,3 +375,4 @@ namespace BTCPayServer.Services.Altcoins.Monero.Services
}
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if ALTCOINS_RELEASE || DEBUG
using System;
using System.Collections.Concurrent;
using System.Collections.Immutable;
@@ -117,3 +118,4 @@ namespace BTCPayServer.Services.Altcoins.Monero.Services
}
}
}
#endif

View File

@@ -0,0 +1,24 @@
#if ALTCOINS_RELEASE || DEBUG
using System.Linq;
using BTCPayServer.Contracts;
namespace BTCPayServer.Services.Altcoins.Monero.Services
{
public class MoneroSyncSummaryProvider : ISyncSummaryProvider
{
private readonly MoneroRPCProvider _moneroRpcProvider;
public MoneroSyncSummaryProvider(MoneroRPCProvider moneroRpcProvider)
{
_moneroRpcProvider = moneroRpcProvider;
}
public bool AllAvailable()
{
return _moneroRpcProvider.Summaries.All(pair => pair.Value.WalletAvailable);
}
public string Partial { get; } = "Monero/MoneroSyncSummary";
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if ALTCOINS_RELEASE || DEBUG
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
@@ -302,3 +303,4 @@ namespace BTCPayServer.Services.Altcoins.Monero.UI
}
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if ALTCOINS_RELEASE || DEBUG
using System;
namespace BTCPayServer.Services.Altcoins.Monero.UI
@@ -13,3 +14,4 @@ namespace BTCPayServer.Services.Altcoins.Monero.UI
public string TransactionLink { get; set; }
}
}
#endif

View File

@@ -0,0 +1,22 @@
using BTCPayServer.Contracts;
using BTCPayServer.HostedServices;
namespace BTCPayServer.Services
{
public class NBXSyncSummaryProvider : ISyncSummaryProvider
{
private readonly NBXplorerDashboard _nbXplorerDashboard;
public NBXSyncSummaryProvider(NBXplorerDashboard nbXplorerDashboard)
{
_nbXplorerDashboard = nbXplorerDashboard;
}
public bool AllAvailable()
{
return _nbXplorerDashboard.IsFullySynched();
}
public string Partial { get; } = "NBXSyncSummary";
}
}

View File

@@ -1,7 +1,6 @@
@using BTCPayServer.Services.Altcoins.Monero.Services
@inject BTCPayServer.HostedServices.NBXplorerDashboard dashboard
@inject MoneroRPCProvider MoneroRpcProvider
@if (!dashboard.IsFullySynched() || !MoneroRpcProvider.Summaries.All(pair => pair.Value.WalletAvailable))
@using BTCPayServer.Contracts
@inject IEnumerable<ISyncSummaryProvider> SyncSummaryProviders;
@if(SyncSummaryProviders.Any(provider => !provider.AllAvailable()))
{
<!-- Modal -->
<div id="modalDialog" class="modal-dialog animated bounceInRight"
@@ -14,71 +13,14 @@
<h4 class="modal-title">Your nodes are synching...</h4>
<button type="button" class="close" onclick="dismissSyncModal()">&times;</button>
</div>
<div class="modal-body">
<div class="modal-body" style="max-height: 400px; overflow-y: scroll;">
<p>
Your node is synching the entire blockchain and validating the consensus rules...
</p>
@foreach (var line in dashboard.GetAll().Where(summary => summary.Network.ShowSyncSummary))
@foreach (var provider in SyncSummaryProviders)
{
<h4>@line.Network.CryptoCode</h4>
@if (line.Status == null)
{
<ul>
<li>The node is offline</li>
@if (line.Error != null)
{
<li>Last error: @line.Error</li>
<partial name="@provider.Partial" />
}
</ul>
}
else
{
<ul>
<li>NBXplorer headers height: @line.Status.ChainHeight</li>
@if (line.Status.BitcoinStatus == null)
{
if (line.State == BTCPayServer.HostedServices.NBXplorerState.Synching)
{
<li>The node is starting...</li>
}
else
{
<li>The node is offline</li>
@if (line.Error != null)
{
<li>Last error: @line.Error</li>
}
}
}
else if (line.Status.BitcoinStatus.IsSynched)
{
<li>The node is synchronized (Height: @line.Status.BitcoinStatus.Headers)</li>
@if (line.Status.BitcoinStatus.IsSynched &&
line.Status.SyncHeight.HasValue &&
line.Status.SyncHeight.Value < line.Status.BitcoinStatus.Headers)
{
<li>NBXplorer is synchronizing... (Height: @line.Status.SyncHeight.Value)</li>
}
}
else
{
<li>Node headers height: @line.Status.BitcoinStatus.Headers</li>
<li>Validated blocks: @line.Status.BitcoinStatus.Blocks</li>
}
</ul>
@if (!line.Status.IsFullySynched && line.Status.BitcoinStatus != null)
{
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="@((int)(line.Status.BitcoinStatus.VerificationProgress * 100))"
aria-valuemin="0" aria-valuemax="100" style="width:@((int)(line.Status.BitcoinStatus.VerificationProgress * 100))%">
@((int)(line.Status.BitcoinStatus.VerificationProgress * 100))%
</div>
</div>
}
}
}
<partial name="Monero/MoneroSyncSummary"/>
<p>
<a href="https://www.youtube.com/watch?v=OrYDehC-8TU" target="_blank">Watch this video</a> to understand the importance of blockchain synchronization.
</p>

View File

@@ -0,0 +1,60 @@
@inject BTCPayServer.HostedServices.NBXplorerDashboard dashboard;
@foreach (var line in dashboard.GetAll().Where(summary => summary.Network.ShowSyncSummary))
{
<h4>@line.Network.CryptoCode</h4>
@if (line.Status == null)
{
<ul>
<li>The node is offline</li>
@if (line.Error != null)
{
<li>Last error: @line.Error</li>
}
</ul>
}
else
{
<ul>
<li>NBXplorer headers height: @line.Status.ChainHeight</li>
@if (line.Status.BitcoinStatus == null)
{
if (line.State == BTCPayServer.HostedServices.NBXplorerState.Synching)
{
<li>The node is starting...</li>
}
else
{
<li>The node is offline</li>
@if (line.Error != null)
{
<li>Last error: @line.Error</li>
}
}
}
else if (line.Status.BitcoinStatus.IsSynched)
{
<li>The node is synchronized (Height: @line.Status.BitcoinStatus.Headers)</li>
@if (line.Status.BitcoinStatus.IsSynched &&
line.Status.SyncHeight.HasValue &&
line.Status.SyncHeight.Value < line.Status.BitcoinStatus.Headers)
{
<li>NBXplorer is synchronizing... (Height: @line.Status.SyncHeight.Value)</li>
}
}
else
{
<li>Node headers height: @line.Status.BitcoinStatus.Headers</li>
<li>Validated blocks: @line.Status.BitcoinStatus.Blocks</li>
}
</ul>
@if (!line.Status.IsFullySynched && line.Status.BitcoinStatus != null)
{
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="@((int) (line.Status.BitcoinStatus.VerificationProgress * 100))"
aria-valuemin="0" aria-valuemax="100" style="width:@((int) (line.Status.BitcoinStatus.VerificationProgress * 100))%">
@((int) (line.Status.BitcoinStatus.VerificationProgress * 100))%
</div>
</div>
}
}
}

View File

@@ -1,5 +1,6 @@
FROM mcr.microsoft.com/dotnet/core/sdk:3.1.202 AS builder
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
ARG CONFIGURATION_NAME=Release
WORKDIR /source
COPY nuget.config nuget.config
COPY Build/Common.csproj Build/Common.csproj
@@ -15,7 +16,7 @@ COPY BTCPayServer.Data/. BTCPayServer.Data/.
COPY BTCPayServer.Client/. BTCPayServer.Client/.
COPY BTCPayServer/. BTCPayServer/.
COPY Build/Version.csproj Build/Version.csproj
RUN cd BTCPayServer && dotnet publish --output /app/ --configuration Release
RUN cd BTCPayServer && dotnet publish --output /app/ --configuration ${CONFIGURATION_NAME}
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1.4-buster-slim

View File

@@ -1,6 +1,7 @@
# This is a manifest image, will pull the image with the same arch as the builder machine
FROM mcr.microsoft.com/dotnet/core/sdk:3.1.202 AS builder
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
ARG CONFIGURATION_NAME=Release
RUN apt-get update \
&& apt-get install -qq --no-install-recommends qemu qemu-user-static qemu-user binfmt-support
@@ -19,7 +20,7 @@ COPY BTCPayServer.Data/. BTCPayServer.Data/.
COPY BTCPayServer.Client/. BTCPayServer.Client/.
COPY BTCPayServer/. BTCPayServer/.
COPY Build/Version.csproj Build/Version.csproj
RUN cd BTCPayServer && dotnet publish --output /app/ --configuration Release
RUN cd BTCPayServer && dotnet publish --output /app/ --configuration ${CONFIGURATION_NAME}
# Force the builder machine to take make an arm runtime image. This is fine as long as the builder does not run any program
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1.4-buster-slim-arm32v7

View File

@@ -1,6 +1,8 @@
# This is a manifest image, will pull the image with the same arch as the builder machine
FROM mcr.microsoft.com/dotnet/core/sdk:3.1.202 AS builder
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
ARG CONFIGURATION_NAME=Release
ENV LC_ALL en_US.UTF-8
RUN apt-get update \
&& apt-get install -qq --no-install-recommends qemu qemu-user-static qemu-user binfmt-support
@@ -19,7 +21,7 @@ COPY BTCPayServer.Data/. BTCPayServer.Data/.
COPY BTCPayServer.Client/. BTCPayServer.Client/.
COPY BTCPayServer/. BTCPayServer/.
COPY Build/Version.csproj Build/Version.csproj
RUN cd BTCPayServer && dotnet publish --output /app/ --configuration Release
RUN cd BTCPayServer && dotnet publish --output /app/ --configuration ${CONFIGURATION_NAME}
# Force the builder machine to take make an arm runtime image. This is fine as long as the builder does not run any program
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1.4-buster-slim-arm64v8

View File

@@ -36,6 +36,7 @@ Global
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
Altcoins-Release|Any CPU = Altcoins-Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{949A0870-8D8C-4DE5-8845-DDD560489177}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -50,6 +51,8 @@ Global
{949A0870-8D8C-4DE5-8845-DDD560489177}.Release|x64.Build.0 = Release|Any CPU
{949A0870-8D8C-4DE5-8845-DDD560489177}.Release|x86.ActiveCfg = Release|Any CPU
{949A0870-8D8C-4DE5-8845-DDD560489177}.Release|x86.Build.0 = Release|Any CPU
{949A0870-8D8C-4DE5-8845-DDD560489177}.Altcoins-Release|Any CPU.ActiveCfg = Altcoins-Release|Any CPU
{949A0870-8D8C-4DE5-8845-DDD560489177}.Altcoins-Release|Any CPU.Build.0 = Altcoins-Release|Any CPU
{B373F439-6E75-4A94-985D-10A0C7C500D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B373F439-6E75-4A94-985D-10A0C7C500D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B373F439-6E75-4A94-985D-10A0C7C500D0}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -62,6 +65,8 @@ Global
{B373F439-6E75-4A94-985D-10A0C7C500D0}.Release|x64.Build.0 = Release|Any CPU
{B373F439-6E75-4A94-985D-10A0C7C500D0}.Release|x86.ActiveCfg = Release|Any CPU
{B373F439-6E75-4A94-985D-10A0C7C500D0}.Release|x86.Build.0 = Release|Any CPU
{B373F439-6E75-4A94-985D-10A0C7C500D0}.Altcoins-Release|Any CPU.ActiveCfg = Altcoins-Release|Any CPU
{B373F439-6E75-4A94-985D-10A0C7C500D0}.Altcoins-Release|Any CPU.Build.0 = Altcoins-Release|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -74,6 +79,8 @@ Global
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Release|x64.Build.0 = Release|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Release|x86.ActiveCfg = Release|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Release|x86.Build.0 = Release|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Altcoins-Release|Any CPU.ActiveCfg = Altcoins-Release|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Altcoins-Release|Any CPU.Build.0 = Altcoins-Release|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -86,6 +93,8 @@ Global
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Release|x64.Build.0 = Release|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Release|x86.ActiveCfg = Release|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Release|x86.Build.0 = Release|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Altcoins-Release|Any CPU.ActiveCfg = Altcoins-Release|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Altcoins-Release|Any CPU.Build.0 = Altcoins-Release|Any CPU
{4D7A865D-3945-4C70-9CC8-B09A274A697E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4D7A865D-3945-4C70-9CC8-B09A274A697E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D7A865D-3945-4C70-9CC8-B09A274A697E}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -98,6 +107,8 @@ Global
{4D7A865D-3945-4C70-9CC8-B09A274A697E}.Release|x64.Build.0 = Release|Any CPU
{4D7A865D-3945-4C70-9CC8-B09A274A697E}.Release|x86.ActiveCfg = Release|Any CPU
{4D7A865D-3945-4C70-9CC8-B09A274A697E}.Release|x86.Build.0 = Release|Any CPU
{4D7A865D-3945-4C70-9CC8-B09A274A697E}.Altcoins-Release|Any CPU.ActiveCfg = Altcoins-Release|Any CPU
{4D7A865D-3945-4C70-9CC8-B09A274A697E}.Altcoins-Release|Any CPU.Build.0 = Altcoins-Release|Any CPU
{21A13304-7168-49A0-86C2-0A1A9453E9C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{21A13304-7168-49A0-86C2-0A1A9453E9C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21A13304-7168-49A0-86C2-0A1A9453E9C7}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -110,6 +121,8 @@ Global
{21A13304-7168-49A0-86C2-0A1A9453E9C7}.Release|x64.Build.0 = Release|Any CPU
{21A13304-7168-49A0-86C2-0A1A9453E9C7}.Release|x86.ActiveCfg = Release|Any CPU
{21A13304-7168-49A0-86C2-0A1A9453E9C7}.Release|x86.Build.0 = Release|Any CPU
{21A13304-7168-49A0-86C2-0A1A9453E9C7}.Altcoins-Release|Any CPU.ActiveCfg = Altcoins-Release|Any CPU
{21A13304-7168-49A0-86C2-0A1A9453E9C7}.Altcoins-Release|Any CPU.Build.0 = Altcoins-Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE