Core abstractions for blockchain ledger operations with support for multiple cloud providers.
$ dotnet add package NuvTools.BlockchainCore abstractions for blockchain ledger operations with support for multiple cloud providers.
# Core abstractions
dotnet add package NuvTools.Blockchain
# Azure Confidential Ledger implementation
dotnet add package NuvTools.Blockchain.Azure
Add the following to your appsettings.json:
{
"NuvTools.Blockchain": {
"LedgerEndpoint": "https://your-ledger-name.confidential-ledger.azure.com"
}
}
using NuvTools.Blockchain.Azure;
// Uses default section "NuvTools.Blockchain"
builder.Services.AddBlockchain(builder.Configuration);
// Or specify a custom section name
builder.Services.AddBlockchain(builder.Configuration, "CustomSectionName");
using NuvTools.Blockchain;
public class MyService(ILedgerService ledgerService)
{
public async Task WriteToLedgerAsync(MyRecord record)
{
// Write an entry to the ledger
var transactionId = await ledgerService.WriteAsync(record);
// Read back the entry
var entry = await ledgerService.ReadAsync<MyRecord>(transactionId);
Console.WriteLine($"Committed at: {entry?.CommitTimeUtc}");
}
}
NuvTools.Blockchain.AzureMIT License - see LICENSE for details.