Skip to content

A collection of all of the protobuf definitions and compiled protobuf files used by Althea and Gravity Bridge

Notifications You must be signed in to change notification settings

althea-net/proto

Repository files navigation

Proto

Your one-stop-shop for all the compiled Rust protos used by Althea and Gravity Bridge.

This project was heavily inspired by github.com/cosmos/cosmos-rust, in particular the proto-build folder.

Building the protos

Download and install the latest protoc release on your machine. The common protos need not be moved to /usr/local/include/google becuase they have been included in the common_proto folder in this repo. If you have trouble with google related protos consider updating the common_proto folder in this repo.

Once protoc has been setup simply cd proto_build ; cargo run

The resulting protos will need a little hand cleaning and version fixing as noted in the lib.rs files of each crate.

Compiled Rust Protos

The following folders receive the compiled Rust code generated by tonic-build and prost-build: althea_proto: https://crates.io/crates/althea_proto
cosmos_sdk_proto: https://crates.io/crates/cosmos_sdk_proto_althea
gravity_proto: https://crates.io/crates/gravity_proto

Dependency folders

The following folders are used as a source for protobuf files, using a special git submodule checkout configuration to avoid needless source code duplication (see Adding a new dependency).

althea-chain: https://github.com/althea-net/althea-chain
bech32-ibc: https://github.com/althea-net/bech32-ibc
cosmos-sdk: https://github.com/cosmos/cosmos-sdk gravity: https://github.com/gravity-bridge/gravity-bridge

Adding a new dependency

With git it is possible to check out only certain branches and directories from another git repository.

  1. git clone --depth=1 --no-checkout https://github.com/org/repo.git ./repo
  2. cd repo && git checkout commit-ish && cd ..
  3. git submodule add https://github.com/org/repo.git ./repo
  4. git submodule absorbgitdirs
  5. git -C repo config core.sparseCheckout true
  6. echo 'folder-to-include/*' >> .git/modules/repo/info/sparse-checkout
  7. git submodule update --force --checkout repo

Updating a dependency to a new version

With a desired tag, branch, or commit hash run the following

  1. cd dependency
  2. git fetch origin <tag, branch, hash>
  3. git checkout <tag, branch, hash>

About

A collection of all of the protobuf definitions and compiled protobuf files used by Althea and Gravity Bridge

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages