Wodanaz.Tendermint.Api
0.10.2
See the version list below for details.
dotnet add package Wodanaz.Tendermint.Api --version 0.10.2
NuGet\Install-Package Wodanaz.Tendermint.Api -Version 0.10.2
<PackageReference Include="Wodanaz.Tendermint.Api" Version="0.10.2" />
paket add Wodanaz.Tendermint.Api --version 0.10.2
#r "nuget: Wodanaz.Tendermint.Api, 0.10.2"
// Install Wodanaz.Tendermint.Api as a Cake Addin #addin nuget:?package=Wodanaz.Tendermint.Api&version=0.10.2 // Install Wodanaz.Tendermint.Api as a Cake Tool #tool nuget:?package=Wodanaz.Tendermint.Api&version=0.10.2
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
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.
Product | Versions 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 was computed. 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. |
-
net6.0
- Google.Protobuf (>= 3.23.2)
- Grpc.Core.Api (>= 2.53.0)
-
net7.0
- Google.Protobuf (>= 3.23.2)
- Grpc.Core.Api (>= 2.53.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.