Skip to content
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
2 changes: 1 addition & 1 deletion .docfx/docs/quickstart/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and testing purposes.

Before you begin, ensure you have the following installed on your system:

- [.NET 9.0 SDK](https://dotnet.microsoft.com/download/dotnet/9.0) or later
- [.NET 10.0 SDK](https://dotnet.microsoft.com/download/dotnet/10.0) or later
- Git (for cloning the repository)

## Installation
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/combined-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Download Standard Coverage
uses: dawidd6/action-download-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Build
run: dotnet build --configuration Release.Native -p:MSBuildWarningsAsMessages=MSB4121
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dotnet.wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Build
run: dotnet build --configuration Release.Wasm
Expand All @@ -29,7 +29,7 @@ jobs:

- name: Install Dependencies
shell: pwsh
run: bin/Release.Wasm/net9.0/playwright.ps1 install chromium
run: bin/Release.Wasm/net10.0/playwright.ps1 install chromium
working-directory: test/BlazorTests/NLightning.Blazor.Tests

- name: Test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Build
run: dotnet build --configuration Release -p:MSBuildWarningsAsMessages=MSB4121
Expand Down
50 changes: 25 additions & 25 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,31 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Dotnet Setup
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x

- name: Download Coverage Reports
uses: dawidd6/action-download-artifact@v3
continue-on-error: true # Allow the docs to build even if there are no coverage reports
with:
workflow: combined-report.yml
name: coverage-docfx
path: .docfx/docs/coverage-reports/
- name: Checkout
uses: actions/checkout@v3
- name: Dotnet Setup
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- run: dotnet tool update -g docfx
- run: docfx .docfx/docfx.json
- name: Download Coverage Reports
uses: dawidd6/action-download-artifact@v3
continue-on-error: true # Allow the docs to build even if there are no coverage reports
with:
workflow: combined-report.yml
name: coverage-docfx
path: .docfx/docs/coverage-reports/

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: '.docfx/_site'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- run: dotnet tool update -g docfx
- run: docfx .docfx/docfx.json

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: '.docfx/_site'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

2 changes: 1 addition & 1 deletion .github/workflows/pr.combined-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Download Standard Coverage
uses: dawidd6/action-download-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Build
run: dotnet build --configuration Release.Native -p:MSBuildWarningsAsMessages=MSB4121
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr.wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Build
run: dotnet build --configuration Release.Wasm
Expand All @@ -29,7 +29,7 @@ jobs:

- name: Install Dependencies
shell: pwsh
run: bin/Release.Wasm/net9.0/playwright.ps1 install chromium
run: bin/Release.Wasm/net10.0/playwright.ps1 install chromium
working-directory: test/BlazorTests/NLightning.Blazor.Tests

- name: Test
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Build
run: dotnet build --configuration Release -p:MSBuildWarningsAsMessages=MSB4121
Expand All @@ -38,7 +38,7 @@ jobs:
title: "Code Coverage"
tag: "${{ github.run_number }}_${{ github.run_id }}"
toolpath: "reportgeneratortool"

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2.16.1
if: always()
Expand Down
6 changes: 6 additions & 0 deletions NLightning.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLightning.Node", "src\NLightning.Node\NLightning.Node.csproj", "{A103C727-E983-4510-81FB-301625DC1A7F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{AF4411D4-8EE9-423E-8213-1C9D35E47882}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLightning.Infrastructure.Persistence", "src\NLightning.Infrastructure.Persistence\NLightning.Infrastructure.Persistence.csproj", "{2EBE72E4-F20D-4668-B2A5-F7DCDECA0832}"
EndProject
Expand All @@ -25,6 +28,9 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLightning.BlazorTestApp", "test\BlazorTests\NLightning.BlazorTestApp\NLightning.BlazorTestApp.csproj", "{99E240CC-6381-40DF-B784-528D2EDBBDFC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BlazorTests", "BlazorTests", "{6F76E9AF-7E6D-42D8-918A-4C5B26BE07C1}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLightning.Blazor.Tests", "test\BlazorTests\NLightning.Blazor.Tests\NLightning.Blazor.Tests.csproj", "{C0F21413-47D0-4584-84A5-B730909E7349}"
EndProject
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
 
[![MIT License](https://img.shields.io/github/license/ngoline/nlightning)](LICENSE)
 
![.NET 9.0](https://img.shields.io/badge/Version-.NET%209.0-informational?style=flat&logo=dotnet)
![.NET 10.0](https://img.shields.io/badge/Version-.NET%2010.0-informational?style=flat&logo=dotnet)

Welcome to the C# implementation of the Lightning Network!

Expand Down Expand Up @@ -52,7 +52,7 @@ and testing purposes.

Before you begin, ensure you have the following installed on your system:

- [.NET 9.0 SDK](https://dotnet.microsoft.com/download/dotnet/9.0) or any later 9.x version
- [.NET 10.0 SDK](https://dotnet.microsoft.com/download/dotnet/10.0) or any later 9.x version
- Git (for cloning the repository)

This project uses a global.json file to pin the .NET SDK to version 9.0.0, but with rollForward:
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "9.0.0",
"version": "10.0.0",
"rollForward": "latestMinor",
"allowPrerelease": false
}
Expand Down
3 changes: 1 addition & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project>
<!--Project props-->
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
10 changes: 2 additions & 8 deletions src/NLightning.Application/NLightning.Application.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.1</Version>
<Configurations>Debug;Release;Debug.Native;Release.Native;Debug.Wasm;Release.Wasm</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -50,12 +45,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.5"/>
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.5"/>
<PackageReference Include="Microsoft.Extensions.Logging" Version="10.0.5"/>
<PackageReference Include="Microsoft.Extensions.Options" Version="10.0.5"/>
</ItemGroup>

<ItemGroup>
<Folder Include="Node\Services\"/>
<Folder Include="Protocol\"/>
</ItemGroup>

Expand Down
3 changes: 2 additions & 1 deletion src/NLightning.Bolt11/Models/Invoice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ public List<BitcoinAddress>? FallbackAddresses
get
{
return _taggedFields
.TryGetAll(TaggedFieldTypes.FallbackAddress, out List<FallbackAddressTaggedField> fallbackAddress)
.TryGetAll(TaggedFieldTypes.FallbackAddress,
out List<FallbackAddressTaggedField>? fallbackAddress)
? fallbackAddress.Select(x => x.Value).ToList()
: null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/NLightning.Domain/Protocol/Payloads/PingPayload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class PingPayload : IMessagePayload
public PingPayload()
{
var randomGenerator = new Random();
// Get number of bytes at random between HashConstants.SHA256_HASH_LEN and ushort.MaxValue
// Get the number of bytes at random between HashConstants.SHA256_HASH_LEN and ushort.MaxValue
NumPongBytes = (ushort)randomGenerator.Next(byte.MaxValue, MaxLength);
BytesLength = (ushort)randomGenerator.Next(CryptoConstants.Sha256HashLen, 4 * CryptoConstants.Sha256HashLen);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MessagePack" Version="3.1.3"/>
<PackageReference Include="NBitcoin" Version="8.0.13"/>
<PackageReference Include="NBitcoin.Secp256k1" Version="3.1.6"/>
<PackageReference Include="NetMQ" Version="4.0.1.16"/>
<PackageReference Include="MessagePack" Version="3.1.4"/>
<PackageReference Include="NBitcoin" Version="9.0.5"/>
<PackageReference Include="NBitcoin.Secp256k1" Version="3.2.0"/>
<PackageReference Include="NetMQ" Version="4.0.2.2"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ public class BlockchainMonitorService : IBlockchainMonitor
private readonly SemaphoreSlim _newBlockSemaphore = new(1, 1);
private readonly SemaphoreSlim _blockBacklogSemaphore = new(1, 1);
private readonly ConcurrentDictionary<uint256, WatchedTransactionModel> _watchedTransactions = new();
#if NET9_0_OR_GREATER
private readonly OrderedDictionary<uint, Block> _blocksToProcess = new();
#else
// TODO: Check if ordering is the same in .NET 8
private readonly SortedDictionary<uint, Block> _blocksToProcess = new();
#endif

private BlockchainState _blockchainState = new(0, Hash.Empty, DateTime.UtcNow);
private CancellationTokenSource? _cts;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<BaseOutputPath>..\NLightning.Models\bin\</BaseOutputPath>
<Configurations>Debug;Release;Debug.Native;Debug.Wasm;Release.Wasm;Release.Native</Configurations>
<Platforms>AnyCPU</Platforms>

<BaseOutputPath>..\NLightning.Infrastructure.Persistence\bin\</BaseOutputPath>
</PropertyGroup>

Expand All @@ -20,14 +14,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.12"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.12"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.12">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.5"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.5"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.11"/>
<PackageReference Include="EFCore.NamingConventions" Version="8.0.3"/>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.1"/>
<PackageReference Include="EFCore.NamingConventions" Version="10.0.1"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<BaseOutputPath>..\NLightning.Models\bin\</BaseOutputPath>
<Configurations>Debug;Release;Debug.Native;Debug.Wasm;Release.Wasm;Release.Native</Configurations>
<Platforms>AnyCPU</Platforms>

<BaseOutputPath>..\NLightning.Infrastructure.Persistence\bin\</BaseOutputPath>
</PropertyGroup>

Expand All @@ -20,13 +14,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.12"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.12"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.12">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.5"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.5"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.12"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.5"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ partial class NLightningDbContextModelSnapshot : ModelSnapshot
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "8.0.12");
modelBuilder.HasAnnotation("ProductVersion", "10.0.5");

modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Bitcoin.BlockchainStateEntity", b =>
{
Expand Down
Loading
Loading