Knuth: Scalenet support released

0 327
Avatar for kth
Written by
3 years ago

The Knuth team is pleased to announce 3 releases we have done this week. The most outstanding item of these 3 releases is the support for the new network, designed to test big/huge blocks: Scalenet.

Knuth Node v0.6.0

This release includes the following features and fixes:

  • Scalenet support.

  • Performance improvements.

  • Code style improvements.


Knuth C-API v0.6.0

This release includes the following features and fixes:

  • Scalenet support.

  • Performance improvements.

  • Code style improvements.


Knuth C#/.NET API v0.8.0

This release includes the following features and fixes:

  • Based on the Knuth C-API version 0.6.0.

  • Scalenet support.

  • Several fixes regarding to default node configuration.

  • Performance improvements.

  • Code style improvements.


If you would like to test the new Scalenet network using our C# API, you can follow these simple steps:

> "Hello, Scalenet"

Using this library is very simple, since Knuth provides a NuGet package.

1. Create a new C# console project:

$ mkdir HelloScalenet
$ cd HelloScalenet
$ dotnet new console

2. Add a reference to our C# API package:

$ dotnet add package kth-bch

3. Edit Program.cs and write some code:

using System;
using System.Threading.Tasks;
using Knuth;

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

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

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

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

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

        private static async Task<bool> DownloadSomeBlocks(Node node) {
            UInt64 height = 12000;
            while (running_) {
                var res = await node.Chain.GetLastHeightAsync();
                if (res.Result >= height) 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;
        }
    }
}

4. Enjoy Knuth node as a C# library:

$ dotnet run

Importante note: You can see the prerequisites here.


For information about how to install Knuth, please visit our website at https://kth.cash/#download.

We thank Bitcoin Cash ecosystem for its warm support and constant feedback.

Sincerely,The Knuth team.

6
$ 4.95
$ 2.00 from @jimtendo
$ 1.94 from @TheRandomRewarder
$ 0.50 from @ErdoganTalk
+ 4
Sponsors of kth
empty
empty
empty
Avatar for kth
Written by
3 years ago

Comments