From 579fb94884f43228bb18f1a7f3bab9ef17b58362 Mon Sep 17 00:00:00 2001 From: lklimek <842586+lklimek@users.noreply.github.com> Date: Mon, 25 Mar 2024 14:40:27 +0100 Subject: [PATCH] doc: README (#16) * doc: README * build(github): deploy docs to github pages * build(github-pages): only deploy from master branch * chore: trying to get github-pages working * build(github-pages): copy README.md as pages index * build(github-pages): separate workflow for github pages * chore: code cleanup * build(github-pages): add permissions * chore(github-pages): set tenderdash_abci as default page * chore: add docs url in cargo.toml * build(github-pages): exclude tenderdash-proto-compiler * chore: move github pages GHA code to separate pr * Squashed commit of the following: commit 17ed6e7e18a28602afa40622688a421389adcc89 Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Fri Mar 15 17:56:00 2024 +0100 fix: release.sh platform deps update broken (#57) commit af64c65d94ef233053be8616e4c92f571fb5aae0 Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Fri Mar 15 17:29:40 2024 +0100 fix(proto-compiler): existence of unzipped tenderdash sources not verified correctly (#56) * fix(proto-compiler): better detection of missing protobuf files * build: release 0.14.0-dev.9 commit 86ba24b8f6d92e6eb24c7d6aff39f9f733d307ba Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Wed Mar 13 15:46:59 2024 +0100 build: release v0.14.0-dev.8 for tenderdash 0.14.0-dev.4 (#55) commit 672f8bafcf2e6e2b5b7e16192bbbfbcf1b03cbb6 Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Tue Mar 12 06:34:13 2024 +0100 feat(proto)!: grpc server and client support (#50) * feat(proto): grpc server and client support * chore: make ServerRuntime public * test(proto): test grpc server with tenderdash in docker * chore(proto): fix imports * chore: build issues * chore: abci grpc-server feature * chore: imports and features * chore: grpc test * chore: re-export tonic * chore: fix missing serde serialization * chore(proto): fix feature flags * chore(proto): fix warn * fix: wrong json serialization of ConsensusParams * fix: wrong json serialization of ConsensusParams * chore: fix build * chore: simplify features * chore: self review, simplify features * chore: comments * test(abci): grpc test uses latest tenderdash tag * chore: bump version to 0.14.0-dev.7 for tenderdash v0.14.0-dev.3, abci 0.26.0 * chore: fix missing serde serialization * fix: wrong json serialization of ConsensusParams * build(deps): update chrono and replace deprecated fn calls --------- Co-authored-by: Ivan Shumkov commit c5ece7b8313862e4976151957b5e1b589da36d72 Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Fri Mar 8 10:03:42 2024 +0100 build(deps): bump chrono and replace deprecated calls (#54) * build(deps): update chrono and replace deprecated fn calls commit 784a0c5c4fba5f6b57449dc3b1ec70b92846cc0b Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Mar 4 16:34:57 2024 +0100 build(deps): update bollard requirement from 0.15.0 to 0.16.0 (#53) Updates the requirements on [bollard](https://github.com/fussybeaver/bollard) to permit the latest version. - [Release notes](https://github.com/fussybeaver/bollard/releases) - [Commits](https://github.com/fussybeaver/bollard/compare/v0.15.0...v0.16.0) --- updated-dependencies: - dependency-name: bollard dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 1b8829eeb584ededfe358cbfe3856934bec12a4f Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Mon Mar 4 16:33:58 2024 +0100 fix(proto)!: wrong json serialization of consensus params (#51) * fix: wrong json serialization of ConsensusParams * chore: fix build commit 309f5897bce57ff9d1c2e4b9a24138cd90838dd3 Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Thu Feb 29 11:30:04 2024 +0100 fix: tenderdash-proto rebuilt with every run due to changed *.proto (#52) * fix: tenderdash-proto rebuilt with every run due to changed *.proto files * refactor: self review * chore: fix GHA build errors * chore: clippy * chore: build errs fix commit 8b5afe6b653a430941d803f3c729c7c6d073734d Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Tue Feb 20 09:49:49 2024 +0100 fix(abci): tenderdash version check requires exact version match (#49) fix(abci): version match fixed commit a2151d40e80d4ce7076160017a6fcbe21d6e252e Author: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Fri Feb 2 12:35:26 2024 +0100 build: release script to update versions commit 701ba0fa92cb0f6bb5b986ec1ad141390040116c Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Thu Feb 1 15:31:46 2024 +0100 feat!: support ThresholdRecoverRaw in tenderdash v0.14 (#43) * chore: clippy * fix: use TENDERDASH_COMMITISH env var if set * feat: support ThresholdRecoverRaw vote extensions * chore: bump version to 0.14.0-dev.1 * chore: bump version to 0.14.0-dev.6 * chore: set default Tenderdash version to v0.14.0-dev.2 * feat: threshold raw vote extensions sign_hash * fix: take TENDERDASH_VERSION from td version.go * chore: fmt * refactor(abci)!: renames in signature processing * chore(abci): add comments to remove tracing:: in signatures once stable commit 28108943299d1a734748dc17211df349a3cf915a Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Wed Jan 31 15:52:44 2024 +0100 build(deps): use protoc 25.2 (#47) * build(deps): use protoc 25.2 * chore: fix typo commit 556f3a9b6724bdbe44acf8045cd87144a997bccb Author: Quantum Explorer Date: Sat Jan 6 20:41:43 2024 +0700 fix: bump version commit b6ed3ba95ccecf717734ead35578324fa67d177a Author: Quantum Explorer Date: Sat Jan 6 20:13:32 2024 +0700 fix: bump version commit e4de5973f6160938cb66be74e161b6e00f13675a Author: Quantum Explorer Date: Sat Jan 6 18:54:50 2024 +0700 fix: bump version commit 6ebfaa31052f7ad538d6589323e5daf7e5e55999 Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Wed Dec 20 07:28:05 2023 +0100 build: retry download of tenderdash zip on unzip failures (#46) fix: retry download of tenderdash zip on unzip failures commit b4df6543efb0457a477db30153131495da1b8bbb Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Mon Dec 18 18:38:54 2023 +0100 chore: release for tenderdash 0.14.0-dev.1 (#45) commit 865fd059564c203ae20ae0f9343f1e7f3fe1b200 Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Thu Dec 14 14:04:57 2023 +0100 feat: use TENDERDASH_COMMITISH env var to set tenderdash rev to use (#44) * fix: use TENDERDASH_COMMITISH env var if set * chore: fix nightly build issues commit f413119a5c7f4b519ba3eec5746cd013a73e45db Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Mon Oct 9 13:08:57 2023 +0200 build: release 0.13.1 for tenderdash 0.13.2+ (#42) build: release 0.13.1 for tenderdash 0.13.2 commit 32cff5cfba6ed45c79f27c8c201c789bd303a823 Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Mon Oct 9 12:53:22 2023 +0200 fix(tenderdash-abci): ensure crate features build without default features (#39) * fix(tenderdash-abci): correct handling of features * chore: change resolver in cargo.toml to 2 * fix: missing prost-derive feature in proto commit 2a98bf2b4425c81c3319fae7a2525c4cab5b53fa Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Thu Oct 5 21:30:53 2023 +0200 fix(tenderdash-abci): deadlock on multiple msgs received (#41) commit 3280669e9feb1f45911ff8462b98bc95c7499ab5 Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Thu Oct 5 21:25:50 2023 +0200 ci: remove sccache from github actions (#40) commit 69344287b749f6db33b6aa2cc5be7aef88a605ce Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Oct 3 16:29:53 2023 +0200 build(deps): update prost requirement from 0.11 to 0.12 (#34) Updates the requirements on [prost](https://github.com/tokio-rs/prost) to permit the latest version. - [Release notes](https://github.com/tokio-rs/prost/releases) - [Commits](https://github.com/tokio-rs/prost/compare/prost-build-0.11.1...v0.12.0) --- updated-dependencies: - dependency-name: prost dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 94f9714b0bfc1ea84b7790d027b21306ee200216 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Oct 3 16:29:41 2023 +0200 build(deps): update prost-build requirement from 0.11 to 0.12 (#33) Updates the requirements on [prost-build](https://github.com/tokio-rs/prost) to permit the latest version. - [Release notes](https://github.com/tokio-rs/prost/releases) - [Commits](https://github.com/tokio-rs/prost/compare/prost-build-0.11.1...v0.12.0) --- updated-dependencies: - dependency-name: prost-build dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit f4235c117ed98d3735ce80ca8914853242c50d9e Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Oct 3 16:22:02 2023 +0200 build(deps): update bollard requirement from 0.14.0 to 0.15.0 (#37) Updates the requirements on [bollard](https://github.com/fussybeaver/bollard) to permit the latest version. - [Release notes](https://github.com/fussybeaver/bollard/releases) - [Commits](https://github.com/fussybeaver/bollard/compare/v0.14.0...v0.15.0) --- updated-dependencies: - dependency-name: bollard dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 45fc4472b4a7b5205f524406b8ae966946f3dc09 Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Wed Sep 13 14:05:30 2023 +0200 chore: release rs-tenderdash-abci v0.13.0 for tenderdash v0.13.0 (#36) chore: release Tenderdash v0.13.0 commit f2b15b89f38a252dbd95f971ed813b3e53831abb Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Fri Sep 8 16:32:23 2023 +0200 feat(abci): support tracing::span inside rs-tenderdash-abci (#35) * feat(proto): DeriveFrom for ABCI Request Value * feat(abci): add tracing spans * feat: add request id to tracing span * chore: log exception responses on error! level and simplify span * chore: minor improvements and docs * chore: traced exception format same as response * chore: minor fix * chore: cargo fmt * fix: doctest commit 00454dbc5d1e452e62ea0c4af7192404467a7655 Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Thu Jul 20 17:11:05 2023 +0200 feat(proto): Timestamp::from_milis() (#24) * build: upgrade to tenderdash v0.13.0-dev.1 * chore: formatting improvement to restart GHA * feat(proto): Timestamp::from_milis() * chore(proto): panic when timestamp millis out of range + tests * chore: unify cargo.toml dependency code style commit b397f6331aa1455fa021983d12167ea5aa3c8d12 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Jul 20 13:28:10 2023 +0200 build(deps): update num-derive requirement from 0.3 to 0.4 (#26) Updates the requirements on [num-derive](https://github.com/rust-num/num-derive) to permit the latest version. - [Changelog](https://github.com/rust-num/num-derive/blob/master/RELEASES.md) - [Commits](https://github.com/rust-num/num-derive/compare/num-derive-0.3.0...num-derive-0.4.0) --- updated-dependencies: - dependency-name: num-derive dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit a0efded5fcced12472367183dc4eb82b54ef47df Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Thu Jul 20 13:27:21 2023 +0200 build: remove sccache from docker build process (#32) build: remove sccache from docker commit 8ed01885be6fc01ebbf9d79633fa6af129a22d1a Author: Dmitrii Golubev Date: Thu Jul 20 09:21:40 2023 +0200 chore: upgrade tenderdash version to 0.13.0-dev.2 (#31) commit 0bb35a3d8bbb27afded70c68b25572e59658060d Author: Dmitrii Golubev Date: Thu Jul 13 17:54:16 2023 +0200 revert: "refactor: make self for offer_snapshot mutable (#27)" (#30) Revert "refactor: make self for offer_snapshot mutable (#27)" This reverts commit f9f4685ef6547a46d343633d5d6ce847c10e12f0. commit f9f4685ef6547a46d343633d5d6ce847c10e12f0 Author: Dmitrii Golubev Date: Thu Jul 13 17:10:03 2023 +0200 refactor: make self for offer_snapshot mutable (#27) * refactor: make self for offer_snapshot mutable commit c161fd627e53315bcf785dd718b4fd2b3c7512e1 Author: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Wed Jun 28 16:34:08 2023 +0200 chore: release for tenderdash 0.12.0 commit 29b505669545153206a7c4c9154f0b738c5b5654 Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Mon Jun 26 09:51:40 2023 +0200 feat: graceful shutdown (#23) * feat: graceful shutdown * feat: async net io * chore: graceful shutdown * chore: graceful shutdown * chore: unix graceful shutdown * chore: simplify code * chore: child token * chore: use child token to NOT kill calling server * fix: missing tokio feature * chore: clippy * chore: apply peer review feedback commit e7b27c3c7a4f447cc5dd8d3b36833a04e6dd18f5 Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Tue Jun 6 11:33:15 2023 +0200 feat: impl SignDigest for CanonicalVote for easier light client verification (#22) feat: impl SignDigest for CanonicalVote commit a177503c21c196ec38e4086ef347fd11ed8cb355 Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Thu Apr 27 18:16:26 2023 +0200 chore!: move signature functions to abci and more strict type controls (#21) * fix(proto): signature: state id must have 32 bytes * fix(proto): added block id constraint * chore: move signature processing from proto to abci as proto is no_std * chore(abci): log sign bytes on trace lvl * chore: signatures * chore(abci): more strict type checks * chore: signs: restore reverse() * chore(abci): minor code improvements commit 623e225bee4bc4841bec9183b0710423359383d9 Author: Quantum Explorer Date: Wed Apr 19 09:33:46 2023 +0700 updated gitignore commit e66a7d6683c0843f11e980f8f057ea78feccef49 Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Mon Apr 17 20:20:32 2023 +0200 feat(proto): add sign_digest() to commit and vote extension (#20) * refactor(proto)!: replace flex_error with thiserror * feat(proto): add sign_bytes() to commit and vote * Revert "refactor(proto)!: replace flex_error with thiserror" This reverts commit 45014e9acab26257523b3e801159d3adf4f38bda. * chore(proto): adjust errors * feat(proto): impl SignBytes for VoteExtension * refactor(proto): delete SignContext * feat(proto): add SignDigest trait for commit * chore(proto): sign_digest borrows quorum hash * test(proto): test sign_digest() * fix(proto): writing &Vec instead of &[\_] * chore(proto): self-review * chore(proto): make SignBytes public for tests commit d61717a0c6ae129f6f64da6189d1e59e176ed42c Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Fri Apr 7 08:10:53 2023 +0200 test: build rs-tenderdash-abci in Docker (#14) * build: sample Dockerfile image * chore: fix dockerfile * chore: try to fix caching * chore: dockerfile improvements * build: disable arm64 build * build: simplify Dockerfile * build(docker): silence apt-get * build(github): docer image only for arm * chore(Dockerfile): trying to get arm to build * build(docker): trying to fix arm build * build(docker): fixed image for arm * build(docker): refer to correct branch * build(github): on PR, build only amd64 image * chore: typo * chore: typo * chore: typo * chore: typo * build(proto-compiler): use vendored-openssl * build(docker): add Alpine docker image to be built * build(docker): typo * build(github): build only amd64 on non-master branch * build(github): enable sccache * build(github): enable Github cache for sccache in Docker images * build(docker): minor caching fix * build(docker): avoid sccache port conflicts on parallel build in github * build(github): allow manual run of docker job * build(docker): add missing dependency for arm64 * chore: remove unused dependencies * chore: display some stats * chore(proto-compiler): use vendored openssl * chore: fix comments * build(github): don't cache /target to use less space * build(github): don't precompile protobuf definitions * chore(proto-compiler): replace openssl with openssl-sys * Revert "build(github): don't precompile protobuf definitions" This reverts commit 8a49d5d7fb443cb6d32a7f22595dab1a19dc4870. * chore(proto-compiler): optimize dependencies * refactor(proto-compiler): use ureq instead of reqwest to improve performance commit 313c68396b9798a794a7c7154189989c8da5c22b Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Mon Apr 3 12:40:25 2023 +0200 revert(abci): remove RefUniwndSafe trait from RequestDispatcher (#19) commit 96878db21613509041e7e703ac2d7ff4854c1d55 Author: lklimek <842586+lklimek@users.noreply.github.com> Date: Fri Mar 31 19:13:31 2023 +0200 refactor(proto-compiler): download protobuf definitions via https instead of git (#18) * feat: use submodules instead of git2 crate to get protobuf definitions * test(proto): ensure that tenderdash version we use is correct * build(github): enable checkout submodules * build(github): enable checkout submodules * Revert " build(github): enable checkout submodules" This reverts commit 2ba1db342712934502f0f642ca84dfd4c95578d8. * build(github): enable checkout submodules * chote(proto-compiler): use git checkout on tenderdash submodule * chore(proto-compiler): fix git handling * chore(proto-compiler): git fetch update shallow * chore(proto-compiler): fetch tags * chore(proto-compiler): update submodule as needed * chore(proto-compiler): download tenderdash sources zip instead of cloning git repo * chore(proto-compiler): create cache (/target) dir if not exist * build(github): don't checkout submodules anymore * doc: Using custom protocol buffers definitions --- README.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ abci/Cargo.toml | 4 +++- proto/Cargo.toml | 9 +++++++- 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 README.md 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 90489d2..a87992e 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 75566b3..a0cd356 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 = """