kth-bch 0.23.1-pullrequest0015-0003

This is a prerelease version of kth-bch.
There is a newer version of this package available.
See the version list below for details.
dotnet add package kth-bch --version 0.23.1-pullrequest0015-0003
                    
NuGet\Install-Package kth-bch -Version 0.23.1-pullrequest0015-0003
                    
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="kth-bch" Version="0.23.1-pullrequest0015-0003" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="kth-bch" Version="0.23.1-pullrequest0015-0003" />
                    
Directory.Packages.props
<PackageReference Include="kth-bch" />
                    
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 kth-bch --version 0.23.1-pullrequest0015-0003
                    
#r "nuget: kth-bch, 0.23.1-pullrequest0015-0003"
                    
#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.
#addin nuget:?package=kth-bch&version=0.23.1-pullrequest0015-0003&prerelease
                    
Install kth-bch as a Cake Addin
#tool nuget:?package=kth-bch&version=0.23.1-pullrequest0015-0003&prerelease
                    
Install kth-bch as a Cake Tool

<img width="200px" src="https://github.com/k-nuth/cs-api/raw/master/docs/images/kth-purple.png" />

C# API

Bitcoin Cash full node as a C# library

Latest Release License <a target="_blank" href="https://t.me/knuth_cash">Telegram</a> <a target="_blank" href="https://k-nuth.slack.com/">Slack</a>

<p align="center"><img width="800px" src="docs/images/demo.png" /></p>

Knuth C# API is a high performance implementation of the Bitcoin Cash protocol focused on users requiring extra performance and flexibility. It is a Bitcoin Cash node you can use as a library.

Prerequisites

Knuth C# API is a wrapper over our C++ libraries, therefore in order to use the C# library we will need the toolchain to build the C++ libraries. Don't panic, you won't have to manually build our C++ libraries, you just have to provide some prerequisites, our build system will take care of the rest.

To speed up the compilation, we provide some pre-built C++ libraries for some common computer platforms, but case there are no pre-built binaries for your platform, our build system will automatically try to build from source code. In such a scenario, the following requirements must be added to the previous ones:

Getting started

  1. Create a new C# console project:
$ mkdir HelloKnuth
$ cd HelloKnuth
$ dotnet new console
  1. Add a reference to our C# API package:
$ dotnet add package kth-bch
  1. Edit Program.cs and write some code:
using System;
using System.Threading.Tasks;
using Knuth;

namespace HelloKnuth {
    public class Program {
        private static bool running_;

        static async Task Main(string[] args) {
            Console.CancelKeyPress += OnSigInterrupt;

            var config = Knuth.Config.Settings.GetDefault(NetworkType.Mainnet);
            using (var node = new Knuth.Node(config)) {
                await node.LaunchAsync();
                Console.WriteLine("Knuth node has been launched.");

                var height = await node.Chain.GetLastHeightAsync();
                Console.WriteLine($"Current height in local copy: {height.Result}");

                if (await ComeBackAfterTheBCHHardFork(node)) {
                    Console.WriteLine("Bitcoin Cash has been created!");
                }
            }
            Console.WriteLine("Good bye!");
        }

        private static async Task<bool> ComeBackAfterTheBCHHardFork(Node node) {
            UInt64 hfHeight = 478559;
            while (running_) {
                var res = await node.Chain.GetLastHeightAsync();
                if (res.Result >= hfHeight) return true;
                await Task.Delay(10000);
            }
            return false;
        }

        private static void OnSigInterrupt(object sender, ConsoleCancelEventArgs args) {
            Console.WriteLine("Stop signal detected.");
            args.Cancel = true;
            running_ = false;
        }
    }
}

  1. Enjoy Knuth node as a C# library:
$ dotnet run

Issues

Each of our modules has its own Github repository, but in case you want to create an issue, please do so in our main repository.

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. 
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
0.23.1 121 12/9/2024
0.23.1-pullrequest0016-0004 80 12/9/2024
0.23.1-pullrequest0015-0003 86 12/9/2024
0.23.1-pullrequest0014-0002 87 12/9/2024
0.23.1-feat-re-order-fi0002 76 12/9/2024
0.23.1-feat-improve-rea0002 82 12/9/2024
0.23.1-feat-add-readme0001 85 12/9/2024
0.23.1-ci0003 76 12/9/2024
0.23.1-ci0002 83 12/9/2024
0.23.1-ci0001 82 12/9/2024
0.23.0 116 12/9/2024
0.22.1-pullrequest0013-0005 85 12/9/2024
0.22.1-pullrequest0012-0004 84 12/8/2024
0.22.1-pullrequest0011-0003 80 12/8/2024
0.22.1-feat-payment-add0004 87 12/9/2024
0.22.1-feat-cpp-23-0002 88 12/8/2024
0.22.1-feat-copyright--0003 83 12/8/2024
0.22.1-ci0004 86 12/9/2024
0.22.1-ci0003 93 12/8/2024
0.22.1-ci0002 85 12/8/2024
0.22.0 125 9/9/2024
0.21.1-pullrequest0009-0015 96 9/9/2024
0.21.1-pullrequest0009-0014 92 9/9/2024
0.21.1-feat-bch-upgrad-0014 96 9/9/2024
0.21.1-ci0001 88 9/9/2024
0.21.0 515 11/4/2022
0.20.1-ci0003 253 11/4/2022
0.20.1-ci0002 264 11/4/2022
0.20.1-ci0001 244 8/13/2022
0.20.0 504 8/13/2022
0.19.1-ci0016 202 8/13/2022
0.19.1-ci0015 225 8/13/2022
0.19.1-ci0014 236 8/12/2022
0.19.1-ci0006 233 8/9/2022
0.19.0 547 3/26/2022
0.18.1-pullrequest0007-0015 246 3/26/2022
0.18.1-dotnet6-0015 216 3/26/2022
0.18.1-dotnet6-0014 242 3/26/2022
0.18.1-dotnet6-0011 237 3/25/2022
0.18.1-dotnet6-0010 258 3/25/2022
0.18.1-ci0005 232 3/26/2022
0.18.1-ci0002 233 3/23/2022
0.18.1-ci0001 322 9/8/2021
0.18.0 449 9/8/2021
0.17.1-ci0002 315 9/8/2021
0.17.0 462 9/8/2021
0.16.1-organize170block0001 286 9/7/2021
0.16.1-ci0002 342 9/8/2021
0.16.0 440 5/14/2021
0.15.1-ci0002 327 5/14/2021
0.15.0 450 4/14/2021
0.14.1-ci0001 339 4/14/2021
0.14.0 439 4/14/2021
0.13.2-ci0001 329 4/14/2021
0.13.1 483 3/11/2021
0.13.1-ci0009 392 3/11/2021
0.13.1-ci0008 399 3/11/2021
0.12.0 465 2/17/2021
0.11.1-ci0028 350 2/17/2021
0.11.1-ci0018 331 2/12/2021
0.11.1-ci0016 339 2/12/2021
0.11.1-ci0008 346 2/12/2021
0.11.1-ci0006 325 2/11/2021
0.11.1-ci0005 329 2/11/2021
0.11.1-ci0004 342 2/11/2021
0.11.1-ci0003 361 2/11/2021
0.11.0 469 2/10/2021
0.10.2-ci0017 355 2/10/2021
0.10.2-ci0001 330 2/8/2021
0.10.1 459 2/7/2021
0.10.0 426 2/5/2021
0.9.1-ci0006 336 2/5/2021
0.9.1-ci0003 402 12/22/2020
0.9.0 513 12/22/2020
0.8.0 551 10/29/2020
0.7.1-ci0005 413 10/28/2020
0.7.0 586 10/20/2020
0.6.0 603 10/19/2020
0.5.1-ci0004 468 10/19/2020
0.5.1-ci0002 411 10/19/2020
0.5.1-ci0001 409 10/17/2020
0.5.0 551 10/13/2020
0.4.1-ci0040 416 10/13/2020
0.4.1-ci0039 464 10/2/2020
0.4.0 595 9/18/2020
0.3.0 534 9/6/2020
0.2.1 580 8/31/2020
0.2.0 554 8/28/2020
0.1.0 571 8/25/2020