EonaCat.Logger.BlockChain 1.0.0

Prefix Reserved
dotnet add package EonaCat.Logger.BlockChain --version 1.0.0
                    
NuGet\Install-Package EonaCat.Logger.BlockChain -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EonaCat.Logger.BlockChain" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EonaCat.Logger.BlockChain" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="EonaCat.Logger.BlockChain" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EonaCat.Logger.BlockChain --version 1.0.0
                    
#r "nuget: EonaCat.Logger.BlockChain, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EonaCat.Logger.BlockChain@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EonaCat.Logger.BlockChain&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=EonaCat.Logger.BlockChain&version=1.0.0
                    
Install as a Cake Tool

EonaCat.Logger.BlockChain

Send logs to a blockChain using EonaCat.Logger.BlockChain.

Example usage:

builder.Logging.AddBlockchainLogger(opts =>
{
    opts.BlockchainType = "ethereum";
    opts.Config["RpcUrl"] = "https://polygon-rpc.com";
    opts.Config["PrivateKey"] = "0x...";
    opts.Config["ContractAddress"] = "0x...";
});

Below are example configurations for Ethereum, Bitcoin, and Solana blockchains.

var services = new ServiceCollection();

        // Ethereum example config
        var ethOptions = new BlockchainLoggerOptions
        {
            BlockchainType = "ethereum",
            Config = new Dictionary<string, string>
            {
                ["RpcUrl"] = "https://rinkeby.infura.io/v3/YOUR_INFURA_PROJECT_ID",
                ["PrivateKey"] = "0xYOUR_PRIVATE_KEY",
                ["ContractAddress"] = "0xYOUR_CONTRACT_ADDRESS"
            }
        };

        // Bitcoin example config
        var btcOptions = new BlockchainLoggerOptions
        {
            BlockchainType = "bitcoin",
            Config = new Dictionary<string, string>
            {
                ["RpcUrl"] = "http://localhost:8332",
                ["RpcUser"] = "user",
                ["RpcPassword"] = "pass",
                ["PrivateKeyWIF"] = "your_bitcoin_wif_private_key"
            }
        };

        // Solana example config
        var solOptions = new BlockchainLoggerOptions
        {
            BlockchainType = "solana",
            Config = new Dictionary<string, string>
            {
                ["RpcUrl"] = "https://api.mainnet-beta.solana.com",
                ["PrivateKeyBase64"] = "base64_encoded_private_key"
            }
        };

        // Register three loggers with different categories
        services.AddLogging(builder =>
        {
            builder.ClearProviders();

            builder.Services.AddSingleton<ILoggerProvider>(new BlockchainLoggerProvider(ethOptions));
            builder.Services.AddSingleton<ILoggerProvider>(new BlockchainLoggerProvider(btcOptions));
            builder.Services.AddSingleton<ILoggerProvider>(new BlockchainLoggerProvider(solOptions));
        });

        var serviceProvider = services.BuildServiceProvider();

        var ethLogger = serviceProvider.GetRequiredService<ILoggerFactory>().CreateLogger("EthereumLogger");
        var btcLogger = serviceProvider.GetRequiredService<ILoggerFactory>().CreateLogger("BitcoinLogger");
        var solLogger = serviceProvider.GetRequiredService<ILoggerFactory>().CreateLogger("SolanaLogger");

        Console.WriteLine("Logging to Ethereum...");
        ethLogger.LogInformation("This is a test log message for Ethereum.");

        Console.WriteLine("Logging to Bitcoin...");
        btcLogger.LogInformation("This is a test log message for Bitcoin.");

        Console.WriteLine("Logging to Solana...");
        solLogger.LogInformation("This is a test log message for Solana.");

        Console.WriteLine("Done sending logs.");

        // Delay to let async log complete
        await Task.Delay(5000);
    }
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 95 6/28/2025