mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-05 18:20:30 +01:00
Allow config to set default block explorer link (#4249)
This logic can potentially be inside BlockExplorerLinkStartupTask instead but it's not a big deal imo
This commit is contained in:
parent
ba423a79e3
commit
63620409a9
2 changed files with 6 additions and 0 deletions
|
@ -138,6 +138,7 @@ namespace BTCPayServer.Configuration
|
||||||
{
|
{
|
||||||
builder.AppendLine(CultureInfo.InvariantCulture, $"#{n.CryptoCode}.explorer.url={n.NBXplorerNetwork.DefaultSettings.DefaultUrl}");
|
builder.AppendLine(CultureInfo.InvariantCulture, $"#{n.CryptoCode}.explorer.url={n.NBXplorerNetwork.DefaultSettings.DefaultUrl}");
|
||||||
builder.AppendLine(CultureInfo.InvariantCulture, $"#{n.CryptoCode}.explorer.cookiefile={ n.NBXplorerNetwork.DefaultSettings.DefaultCookieFile}");
|
builder.AppendLine(CultureInfo.InvariantCulture, $"#{n.CryptoCode}.explorer.cookiefile={ n.NBXplorerNetwork.DefaultSettings.DefaultCookieFile}");
|
||||||
|
builder.AppendLine(CultureInfo.InvariantCulture, $"#{n.CryptoCode}.blockexplorerlink=https://mempool.space/tx/{{0}}");
|
||||||
if (n.SupportLightning)
|
if (n.SupportLightning)
|
||||||
{
|
{
|
||||||
builder.AppendLine(CultureInfo.InvariantCulture, $"#{n.CryptoCode}.lightning=/root/.lightning/lightning-rpc");
|
builder.AppendLine(CultureInfo.InvariantCulture, $"#{n.CryptoCode}.lightning=/root/.lightning/lightning-rpc");
|
||||||
|
|
|
@ -189,6 +189,11 @@ namespace BTCPayServer.Hosting
|
||||||
};
|
};
|
||||||
options.NBXplorerConnectionSettings.Add(setting);
|
options.NBXplorerConnectionSettings.Add(setting);
|
||||||
options.ConnectionString = configuration.GetOrDefault<string>("explorer.postgres", null);
|
options.ConnectionString = configuration.GetOrDefault<string>("explorer.postgres", null);
|
||||||
|
var blockExplorerLink = configuration.GetOrDefault<string>("blockexplorerlink", null);
|
||||||
|
if (!string.IsNullOrEmpty(blockExplorerLink))
|
||||||
|
{
|
||||||
|
btcPayNetwork.BlockExplorerLink = blockExplorerLink;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
services.AddOptions<LightningNetworkOptions>().Configure<BTCPayNetworkProvider>(
|
services.AddOptions<LightningNetworkOptions>().Configure<BTCPayNetworkProvider>(
|
||||||
|
|
Loading…
Add table
Reference in a new issue