Skip to content

Application Blockchain Interface library written in Rust.

Notifications You must be signed in to change notification settings

dashpay/rs-tenderdash-abci

Repository files navigation

Rust bindings and server for Tenderdash ABCI++ protocol

Introduction

example workflow

This repository contains Rust bindings for Tenderdash. It includes:

  • data types, requests and responses required on Tenderdash
  • ABCI++ protocol server, supporting Unix sockets and TCP connections
  • tonic-based ABCI++ protocol client/server, supporting grpc connections

Structure

The repository contains the following crates:

  • tenderdash-abci - main crate, including ABCI++ socket and tcp server implementation, Application trait and re-exporting tenderdash-proto crate
  • tenderdash-proto - ABCI++ messages and data types definitions, and gRPC client/server implementation, generated based on Tenderdash protobuf specifications
  • tenderdash-proto-compiler - an internal tool that fetches tenderdash repository and converts protobuf files to Rust

Version Compatibility

Versioning of this library follows the Semantic Versioning 2.0.0 specification. Specifically, it consists of MAJOR.MINOR.PATCH+BUILD, where BUILD denotes minimum version of Tenderdash required.

For instance, if you're working with Tenderdash 1.3.0, you should use rs-tenderdash-abci 1.2.0+1.3.0.

This library also includes built-in support for ABCI protocol version verification. The ABCI protocol version, as defined in Tenderdash's version.go under the ABCISemVer constant, must align with the ABCI protocol version of this library. You can find the library's ABCI protocol version in proto/src/tenderdash.rs under the ABCI_VERSION constant.

Quick start

  1. Install dependencies. You can find a current list of dependencies in the Dockerfile.

  2. Add tenderdash-abci crate to your project:

    cargo add --git https://github.com/dashpay/rs-tenderdash-abci tenderdash-abci
  3. Implement the Application trait with your custom logic. You can check kvstore as a minimal example.

Using custom protocol buffers definitions

If you want to build rs-tenderdash-abci using protocol buffers definitions from a custom Tenderdash version, you can do so by setting the TENDERDASH_COMMITISH environment variable to the desired Tenderdash commit ID before initiating the build process.

For instance, if you want to build the library with support for Tenderdash v0.14-dev.3, which corresponds to the commit ID 688ee3e3f2624e6ebb20f5d74e0812109b7b9a27, you can use the following command:

export TENDERDASH_COMMITISH=688ee3e3f2624e6ebb20f5d74e0812109b7b9a27
cargo build

Credits

This project is a partial fork of tendermint-rs project.

License

MIT