informalsystems / tendermint-rs

Client libraries for Tendermint/CometBFT in Rust!
Apache License 2.0
603 stars 224 forks source link

Request for Detailed and Beginner Friendly Tutorials for Rust Seeking to Develop ABCI Apps #1070

Closed GTime closed 2 years ago

GTime commented 2 years ago

Hi, I will like to plead for a detailed beginner friendly tutorials for developer who want to write there own ABCI apps using the library.

I am a Rust development, I am part of an African dev community of with over 200 developers consisting of 80% Rust Devs.

We are working to join the Web 3.0 train. I proposed tendermint and most devs in the community are excited why the solution that tendermint provide but are hindered by lack beginner friendly tutorials(in both textual and video) and resources available in our core languages which are Rust.

I will appreciate a feedback, Thank you

thanethomson commented 2 years ago

Thanks for your interest in Tendermint!

What's your use case? (i.e. who are your users and what do you want to do for them?) That's the place to start really.

Then you have to understand that ABCI's not designed to be beginner-friendly if what you want to build is cryptocurrency-oriented (i.e. with coins, accounts, etc.). If you look into the protocol, it's extremely simple and doesn't implement any of those concepts. It's purely a protocol for deterministic state machines to interact with Tendermint Core.

You'll quickly see that you either need a framework that provides all of that infrastructure for you that implements the ABCI protocol, like the Cosmos SDK in Go, or you have to implement it yourself (a pretty massive task).

There are some efforts to build out a form of SDK in Rust, like orga, and then there's our internal effort to build a proof-of-concept blockchain application basecoin-rs that implements ABCI and could eventually form the basis for a Rust-based SDK of sorts.

You could also look into https://github.com/CosmWasm/cosmwasm

GTime commented 2 years ago

Thanks @thanethomson, I do appreciate your feedback.

I was hoping to find a detailed examples(with descriptions for every step) on how to use tendermint-rs. Maybe examples of an ABCI app(such a blog with ibc module) developed with tendermint-rs.

I will also like to know if basecoin-rs could be like a Rust version of the Cosmos SDK?

thanethomson commented 2 years ago

The reason we don't have that is because tendermint-rs is not one thing. It's a collection of crates for doing different things relating to Tendermint Core. Have you read the Tendermint Core docs and gone through the tutorials there?

Once you understand Tendermint Core and have been able to set up a full node running the kvstore ABCI app, the next step would be to figure out which of the crates you'll be needing for your use case. For example, you can use tendermint-rpc to interact with Tendermint nodes via their RPC endpoint; you can use tendermint-light-client to build light clients; you can use tendermint-abci to build ABCI applications that run on top of Tendermint Core. As you'll see they're very different kinds of use cases.

Once you've figured out your use case, pick which crate(s) you may need and then just read the crates' documentation on how to use them.

As for basecoin-rs, no, it's not going to be a Rust version of the Cosmos SDK. Think of it as a proof-of-concept ABCI application that implements all the basic functionality to implement an IBC-enabled blockchain. If you want an example of what it takes to build a meaningful ABCI application in Rust, basecoin-rs is one example of that. Just note that basecoin-rs is heavily under development at present and is changing rapidly.

GTime commented 2 years ago

@thanethomson Thanks for the breakdown, your explanations did make my thing clear. I really do appreciate you for your replies. I will do more research on Tendermint Core then jump back to tendermint-rs.

I am dedicating the whole year to understand, experiment and develop a Blockchain with Tendermint Core in Rust. I will like to get in touch with for advice through out my Blockchain journey for this year, if that is okay by you.

Please how do I active get in touch with you? Here or ?

thanethomson commented 2 years ago

To be totally honest, building a Rust-based blockchain on top of Tendermint is really not a beginner-friendly activity. I'd highly recommend starting out building a blockchain using the Cosmos SDK in Go and then see whether you really want to effectively re-implement the entire Cosmos SDK in Rust.

I think let's keep these kinds of discussions in the Discussions on the repo, so feel free to post questions at #1063 and we'll do our best to respond. If you discover tendermint-rs related problems or have suggestions for features, feel free to log them as an issue here.