Wodanaz.Tendermint.Api 0.38.6

dotnet add package Wodanaz.Tendermint.Api --version 0.38.6
NuGet\Install-Package Wodanaz.Tendermint.Api -Version 0.38.6
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="Wodanaz.Tendermint.Api" Version="0.38.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Wodanaz.Tendermint.Api --version 0.38.6
#r "nuget: Wodanaz.Tendermint.Api, 0.38.6"
#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.
// Install Wodanaz.Tendermint.Api as a Cake Addin
#addin nuget:?package=Wodanaz.Tendermint.Api&version=0.38.6

// Install Wodanaz.Tendermint.Api as a Cake Tool
#tool nuget:?package=Wodanaz.Tendermint.Api&version=0.38.6

Tendermint C# GRPC ABCI Assembly

This is a precompiled package of the Tendermint ABCI API. The API is also mostly compatible with the current CosmosBFT 0.38 implementation.

Tendermint Server

Implementing a Tendermint Server is quite easy. Preprare your ASP.NET core Web Application or API Project for gRPC use and implement the abstract ABCIApplication.ABCIApplicationBase class:

	public class WodanazApp : ABCIApplication.ABCIApplicationBase, IWodanazApp
	{
		private IConfiguration _conf;

		public WodanazApp(IConfiguration conf)
		{
			_conf = conf;
		}

		public override Task<ResponseInfo> Info(RequestInfo request, ServerCallContext context)
		{
			// Only fake results
			return Task.FromResult(new ResponseInfo() { AppVersion = 1, Version = "1.0", Data = "Data" });
		}

		public override Task<ResponseInitChain> InitChain(RequestInitChain request, ServerCallContext context)
		{
			// Fake result
			return Task.FromResult(new ResponseInitChain() { });
		}

		public override Task<ResponseEcho> Echo(RequestEcho request, ServerCallContext context)
		{
			// Some echo info
			var echo = new ResponseEcho { Message = $"Validator is Running: {DateTime.Now:dd-MM-yyyy HH:mm}" };
			return Task.FromResult(echo);
		}
	}
Testing the server

If you added the Grpc.Tools package, you can simply use a generic client, e.g grpcui like this

grpcui -insecure 127.0.0.1:5001

gRPC Test with grpcui

Or you can install a local version of Tendermint as described here, initialize the node properly and then start tendermint like this:

tendermint node --abci grpc --proxy_app 127.0.0.1:5001

Note that .NET 6.0 by default publishes the gRPC endpoints on port 5000 (http) and 5001 (https). If you use different ports change the command accordingly. In my tests, Tendermint was not able to do TLS handshakes with a .NET core HTTPS endpoint properly. This means that you have to restrict Kestrel to Http2 only connections. I managed to establish a connection between Tendermint and the C# app using the following Kestrel configuration.

{
  "AllowedHosts": "*",
  "Kestrel": {
    "Endpoints": {
      "gRPC": {
        "Protocols": "Http2",
        "Url": "http://127.0.0.1:5000"
      }
    }
  }
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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. 
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.38.6 110 3/17/2024
0.10.4 141 7/3/2023
0.10.3 107 6/3/2023
0.10.2 109 6/1/2023