Skip to content
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

Column in channels view showing the channel id with a link to amboss page #199

Merged
merged 2 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/Helpers/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
public static readonly string? FUNDSMANAGER_ENDPOINT;
public static readonly string? COINGECKO_ENDPOINT;
public static readonly string? MEMPOOL_ENDPOINT;
public static readonly string? AMBOSS_ENDPOINT;
public static readonly string? REMOTE_SIGNER_ENDPOINT;

// Credentials
Expand Down Expand Up @@ -70,9 +71,9 @@
public static readonly long ANCHOR_CLOSINGS_MINIMUM_SATS;
public static readonly string DEFAULT_DERIVATION_PATH = "48'/1'";
public static readonly int SESSION_TIMEOUT_MILLISECONDS = 3_600_000;

//Sat/vb ratio
public static decimal MIN_SAT_PER_VB_RATIO = 0.9m;
public static decimal MIN_SAT_PER_VB_RATIO = 0.9m;
public static decimal MAX_SAT_PER_VB_RATIO = 2.0m;
/// <summary>
/// Max ratio of the tx total input sum that could be used as fee
Expand All @@ -92,7 +93,7 @@
return envVariable;
}

static Constants()

Check warning on line 96 in src/Helpers/Constants.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Non-nullable field 'NBXPLORER_URI' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
{
IS_DEV_ENVIRONMENT = StringHelper.IsTrue(Environment.GetEnvironmentVariable("IS_DEV_ENVIRONMENT"));
// Features
Expand All @@ -105,7 +106,7 @@
// Connections
POSTGRES_CONNECTIONSTRING = Environment.GetEnvironmentVariable("POSTGRES_CONNECTIONSTRING") ?? POSTGRES_CONNECTIONSTRING;

NBXPLORER_URI = GetEnvironmentalVariableOrThrowIfNotTesting("NBXPLORER_URI");

Check warning on line 109 in src/Helpers/Constants.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Possible null reference assignment.

NBXPLORER_BTCRPCURL = Environment.GetEnvironmentVariable("NBXPLORER_BTCRPCURL");

Expand All @@ -121,6 +122,8 @@

MEMPOOL_ENDPOINT = Environment.GetEnvironmentVariable("MEMPOOL_ENDPOINT");

AMBOSS_ENDPOINT = Environment.GetEnvironmentVariable("AMBOSS_ENDPOINT");

// Credentials
NBXPLORER_BTCRPCUSER = Environment.GetEnvironmentVariable("NBXPLORER_BTCRPCUSER");

Expand All @@ -130,7 +133,7 @@

if (PUSH_NOTIFICATIONS_ONESIGNAL_ENABLED)
{
PUSH_NOTIFICATIONS_ONESIGNAL_APP_ID = GetEnvironmentalVariableOrThrowIfNotTesting("PUSH_NOTIFICATIONS_ONESIGNAL_APP_ID", "if PUSH_NOTIFICATIONS_ONESIGNAL_ENABLED is set, PUSH_NOTIFICATIONS_ONESIGNAL_APP_ID");

Check warning on line 136 in src/Helpers/Constants.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Possible null reference assignment.

PUSH_NOTIFICATIONS_ONESIGNAL_API_BASE_PATH = GetEnvironmentalVariableOrThrowIfNotTesting("PUSH_NOTIFICATIONS_ONESIGNAL_API_BASE_PATH", "if PUSH_NOTIFICATIONS_ONESIGNAL_ENABLED is set,PUSH_NOTIFICATIONS_ONESIGNAL_API_BASE_PATH");

Expand Down Expand Up @@ -177,7 +180,7 @@
}

// Usage
BITCOIN_NETWORK = Environment.GetEnvironmentVariable("BITCOIN_NETWORK");

Check warning on line 183 in src/Helpers/Constants.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Possible null reference assignment.

var minChannelCapacity = GetEnvironmentalVariableOrThrowIfNotTesting("MINIMUM_CHANNEL_CAPACITY_SATS");
if (minChannelCapacity != null) MINIMUM_CHANNEL_CAPACITY_SATS = long.Parse(minChannelCapacity, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture);
Expand All @@ -198,11 +201,11 @@

var timeout = Environment.GetEnvironmentVariable("SESSION_TIMEOUT_MILLISECONDS");
if (timeout != null) SESSION_TIMEOUT_MILLISECONDS = int.Parse(timeout);

//Sat/vb ratio
var minSatPerVbRatioEnv = Environment.GetEnvironmentVariable("MIN_SAT_PER_VB_RATIO");
MIN_SAT_PER_VB_RATIO = minSatPerVbRatioEnv!= null ? decimal.Parse(minSatPerVbRatioEnv) : MIN_SAT_PER_VB_RATIO;

var maxSatPerVbRatioEnv = Environment.GetEnvironmentVariable("MAX_SAT_PER_VB_RATIO");
MAX_SAT_PER_VB_RATIO = maxSatPerVbRatioEnv!= null ? decimal.Parse(maxSatPerVbRatioEnv) : MAX_SAT_PER_VB_RATIO;

Expand Down
9 changes: 8 additions & 1 deletion src/Pages/Channels.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@using System.Security.Claims
@using Humanizer
@using NBitcoin
@using Polly
@using Channel = FundsManager.Data.Models.Channel
@attribute [Authorize(Roles = "FinanceManager, NodeManager, Superadmin")]
<PageTitle>Active Channels</PageTitle>
Expand Down Expand Up @@ -153,7 +154,13 @@
</DataGridColumn>
<DataGridColumn TItem="Channel" Field="@nameof(Channel.CreationDatetime)" Caption="@nameof(Channel.CreationDatetime).Humanize(LetterCasing.Sentence)" Sortable="true"/>
<DataGridColumn TItem="Channel" Field="@nameof(Channel.UpdateDatetime)" Caption="@nameof(Channel.UpdateDatetime).Humanize(LetterCasing.Sentence)" Sortable="true"/>

<DataGridColumn TItem="Channel" Field="@nameof(Channel.ChanId)" Caption="Channel Id" Sortable="false">
<DisplayTemplate>
<a href="@(Constants.AMBOSS_ENDPOINT + "/edge/" + context.ChanId)" target="_blank">
@context.ChanId
</a>
</DisplayTemplate>
</DataGridColumn>
</DataGridColumns>
</DataGrid>
</Column>
Expand Down
3 changes: 2 additions & 1 deletion src/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"ENABLE_HW_SUPPORT": "true",
"MINIMUM_WITHDRAWAL_BTC_AMOUNT": "0.001",
"MINIMUM_CHANNEL_CAPACITY_SATS": "20000",
"MEMPOOL_ENDPOINT": "https://mempool-staging.elenpay.tech",
"MEMPOOL_ENDPOINT": "https://mempool.space",
"AMBOSS_ENDPOINT": "https://amboss.space",
"TRANSACTION_CONFIRMATION_MINIMUM_BLOCKS": "6",
"MONITOR_WITHDRAWALS_CRON": "0 */1 * * * ?",
"COINGECKO_ENDPOINT": "https://pro-api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=bitcoin",
Expand Down
Loading