read.cash Log in
@kth more from that month

Knuth: Scalenet support released

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. https://github.com/k-nuth/c-api 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" https://read.cash/@kth/announcing-knuth-cnet-api-v021-0886f059#gt-quothello-knuthquot Using this library is very simple, since **Knuth provides a NuGet package.** https://www.nuget.org/packages/kth-bch 1. Create a new C# console project: https://read.cash/@kth/announcing-knuth-cnet-api-v021-0886f059#1-create-a-new-c-console-project $ mkdir HelloScalenet $ cd HelloScalenet $ dotnet new console 2. Add a reference to our C# API package: https://read.cash/@kth/announcing-knuth-cnet-api-v021-0886f059#2-add-a-reference-to-our-c-api-package $ dotnet add package kth-bch 3. Edit `Program.cs` and write some code: https://read.cash/@kth/announcing-knuth-cnet-api-v021-0886f059#3-edit-programcs-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: https://read.cash/@kth/announcing-knuth-cnet-api-v021-0886f059#4-enjoy-knuth-node-as-a-c-library $ dotnet run **Importante note: You can see the prerequisites here**. https://github.com/k-nuth/cs-api#prerequisites 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.

No comments yet

Log in to join in Reading is open to everyone. Replying needs an account.