diff --git a/README.md b/README.md new file mode 100644 index 0000000..5052e7c --- /dev/null +++ b/README.md @@ -0,0 +1,59 @@ +# Rust bindings and server for Tenderdash ABCI++ protocol + +## Introduction + +![example workflow](https://github.com/dashpay/rs-tenderdash-abci/actions/workflows/test.yml/badge.svg?branch=master) + +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](https://docs.rs/tonic/latest/tonic/)-based ABCI++ protocol client/server, supporting grpc connections + +## Structure + +The repository contains the following crates: + +* [tenderdash-abci](./abci/) - main crate, including ABCI++ socket and tcp server implementation, `Application` trait and re-exporting `tenderdash-proto` crate +* [tenderdash-proto](./proto/) - ABCI++ messages and data types definitions, and gRPC client/server implementation, generated based on Tenderdash protobuf specifications +* [tenderdash-proto-compiler](./proto-compiler/) - an internal tool that fetches tenderdash repository and converts protobuf files to Rust +* + +## Version Compatibility + +The major and minor versions of this library are designed to match those of [Tenderdash]. For instance, if you're working with `Tenderdash 1.2.34`, you should use `rs-tenderdash-abci 1.2.*` to ensure compatibility. + +This library also includes built-in support for ABCI protocol version verification. The ABCI protocol version, as defined in Tenderdash's [version.go](https://github.com/dashpay/tenderdash/blob/HEAD/version/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](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](Dockerfile-debian). +2. Add tenderdash-abci crate to your project: + + ```bash + cargo add --git https://github.com/dashpay/rs-tenderdash-abci tenderdash-abci + ``` + +3. Implement the [Application](abci/src/application.rs) trait with your custom logic. You can check [kvstore](abci/tests/kvstore.rs) 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: + +```bash +export TENDERDASH_COMMITISH=688ee3e3f2624e6ebb20f5d74e0812109b7b9a27 +cargo build +``` + +## Credits + +This project is a partial fork of [tendermint-rs] project. + +## License + +[MIT](LICENSE.md) + +[Tenderdash]: https://github.com/dashpay/tenderdash +[tendermint-rs]: https://github.com/informalsystems/tendermint-rs diff --git a/abci/Cargo.toml b/abci/Cargo.toml index 43fc89e..ba3e346 100644 --- a/abci/Cargo.toml +++ b/abci/Cargo.toml @@ -5,8 +5,10 @@ edition = "2021" license = "Apache-2.0" readme = "README.md" categories = ["cryptography::cryptocurrencies", "network-programming"] -keywords = ["abci", "blockchain", "bft", "consensus", "tendermint"] +keywords = ["abci", "blockchain", "bft", "consensus", "tendermint", "dash"] repository = "https://github.com/dashpay/rs-tenderdash-abci/tree/main/abci" +documentation = "https://dashpay.github.io/rs-tenderdash-abci/tenderdash_abci/" + description = """tenderdash-abci provides a simple framework with which to build\ low-level applications on top of Tenderdash.""" diff --git a/proto/Cargo.toml b/proto/Cargo.toml index c4d30e4..e282400 100644 --- a/proto/Cargo.toml +++ b/proto/Cargo.toml @@ -4,8 +4,15 @@ name = "tenderdash-proto" edition = "2021" license = "Apache-2.0" repository = "https://github.com/dashpay/rs-tenderdash-abci/tree/main/proto" +documentation = "https://dashpay.github.io/rs-tenderdash-abci/tenderdash_proto/" readme = "README.md" -categories = ["cryptography", "cryptography::cryptocurrencies", "database"] +categories = [ + "cryptography", + "cryptography::cryptocurrencies", + "database", + "dash", + "tenderdash", +] keywords = ["blockchain", "tenderdash", "proto"] description = """