Coder Social home page Coder Social logo

deljavi937 / basecoin-rs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from informalsystems/basecoin-rs

0.0 0.0 0.0 1.59 MB

An example ABCI application making use of tendermint-rs and ibc-rs

License: Apache License 2.0

Shell 6.85% Rust 92.33% Makefile 0.26% Dockerfile 0.57%

basecoin-rs's Introduction

basecoin-rs

At a high level, basecoin implements the application logic that sits between the Tendermint consensus layer and ibc-rs. It is a rudimentary Tendermint ABCI application that implements the following functionality in the form of modules -

  • bank - keeps track of different accounts' balances and facilitates transactions between those accounts.
  • ibc - enables support for IBC (clients, connections & channels)

Its main use-cases are serving as a testing ground and mock implementation for verifying the correctness and behaviour of the ibc-rs modules.

Requirements

So far this app has been tested with:

  • Rust > v1.64
  • CometBFT v0.37

How to integrate ibc-rs changes into basecoin

Since basecoin serves as a suite of integration tests against ibc-rs's functionality, each ibc-rs PR also requires an accompanying basecoin PR. The steps to do this are:

  1. In a new branch in basecoin, update ibc revisions with the latest commit of the ibc-rs PR.
  2. Implement the necessary changes in basecoin in order to get it working with the latest commit revision of ibc-rs.
  3. Run cargo clippy --all-features and cargo clippy --no-default-features and fix any issues that clippy raises.
  4. Open a PR in the basecoin-rs repository, making sure to the link to the associated ibc-rs PR.
  5. Check to see if the integration tests pass.

Starting up an instance of basecoin

Step 1: Reset your local CometBFT node

$ cometbft init
$ cometbft unsafe-reset-all

Step 2: Modify CometBFT config

Edit the CometBFT config.toml file (default location ~/.cometbft/config/config.toml) to update the proxy_app and P2P laddr as follows.

proxy_app = "tcp://127.0.0.1:26358"
# ...
[p2p]
laddr = "tcp://0.0.0.0:26356"

Step 3: Module specific setup

See the module documentation for more details -

Step 4: Run the basecoin app and CometBFT

# See all supported CLI options
$ cargo run -- --help
basecoin 0.1.0

USAGE:
    basecoin [FLAGS] [OPTIONS]

Commands:
    start
    query   Query a state of Basecoin application from the store
    help    Prints this message or the help of the given subcommand(s)

OPTIONS:
        --config <FILE>  The path to the configuration file [default: config.toml]
        --verbose        Increase output logging verbosity to DEBUG level
        --quiet          Suppress all output logging (overrides --verbose)
    -h  --help           Prints help information
    -V, --version        Prints version information

# Run the ABCI application (from this repo)
# The -v is to enable trace-level logging
$ cargo run -- -v

# In another terminal
$ cometbft node

UML diagrams

system diagram

class diagram

activity diagram - DeliverTx

basecoin-rs's People

Contributors

hu55a1n1 avatar farhad-shabani avatar plafer avatar thanethomson avatar seanchen1991 avatar rnbguy avatar ebuchman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.