Crates.io | tsp |
lib.rs | tsp |
version | 0.2.3 |
source | src |
created_at | 2017-08-22 08:41:21.613085 |
updated_at | 2017-08-22 08:45:33.268109 |
description | An implementation of the TSP protocol used by Tendermint Core. Allows the building of COSMOS apps in Rust. |
homepage | https://tendermint.com/docs/guides/app-development |
repository | https://github.com/tendermint/rust-tsp |
max_upload_size | |
id | 28533 |
size | 292,816 |
A rust implementation of the ABCI protocol for Tendermint.
We have a friendly community of like-minded people which are always eager to help someone in need of advice or just looking for casual banter.
Please read, understand and adhere to our code of conduct.
This library implements the ABCI protocol and can be used to write ABCI applications for Tendermint in rust. Here you can find more information about Tendermint and ABCI application.
For a real life example of an ABCI application you can checkout Ethermint or Basecoin.
Make sure that you have Rust installed. The easiest way is to follow the instructions on rustup.
To test the examples, please clone this repository.
git clone git@github.com:tendermint/rust-abci.git
Please have a look at the dummy or counter app inside src/bin
to get a feeling for how this server works.
To use this library to build your own ABCI apps in rust you have to include the following in your Cargo.toml
file.
[dependencies]
rust-abci = "0.1.0"
Or if you want to live on the edge then point directly towards our git repo.
[dependencies]
rust-abci = { git = "git@github.com:tendermint/rust-abci.git" }
To run either of the example apps you have to have Tendermint installed and initialised. Please install it according to these instructions. You can also check out Ethermint for an in-depth explanation of how ABCI apps work.
Rememeber to run tendermint with the --abci grpc
flag like so.
tendermint node --abci grpc
Once the Tendermint instance is up and running you can start either of the examples like this. Of course, please rememeber to switch into the rust-abci folder.
cargo run --features "grpc_support" --bin dummy
cargo run --features "grpc_support" --bin counter
// TODO - publish to rust docs
// TODO - give quick examples
The message types for the ABCI protocol are defined in a protobuf file, which can be copied from here.
We use rust-protobuf to generate compatible rust files from the protobuf source files. For convenience the generated rust files are checked into git and will be packaged with the library. If you want to generate them yourself you can. Install these two tools.
cargo install protobuf
cargo install grpc-compiler
protoc --rust_out src/ types.proto
protoc --rust-grpc_out src/ types.proto