Infrastructure Library for NLightning
$ dotnet add package NLightning.InfrastructureNLightning.Infrastructure is a core component of the NLightning ecosystem, providing essential infrastructure services for Lightning Network implementations in .NET. This library serves as a bridge between the application and domain layers and external dependencies.
libsodiumlibsodium.jsWe've decided to have 2 packages, one for desktop/server development, and one for Blazor WebAssembly development.
The reason behind this is that for a Blazor app running fully on the browser we don't have access to native libsodium.
Install the package from NuGet:
# For the "standard" version of the package run
dotnet add package NLightning.Infrastructure
# For the Blazor WebAssembly version run
dotnet add package NLightning.Infrastructure.Blazor
NLightning.Infrastructure automatically adapts to your build environment:
When using in a Blazor WebAssembly project, you need to initialize the crypto provider:
using NLightning.Infrastructure.Crypto.Providers.JS;
// Initialize before starting the app
await BlazorCryptoProvider.InitializeBlazorCryptoProviderAsync();
await builder.Build().RunAsync();
NLightning.Infrastructure is primarily used by other NLightning components, but you can also use it directly for:
// Crypto operations, networking, and other infrastructure services
// Detailed documentation coming soon