v5 (LATEST)

Devnet

Testnet

🚧 Development Version Notice

You are currently viewing documentation for the version that is under active development.

🔹 This version has not been deployed to mainnet yet

🔹 Features and APIs may change before final release

Coreum TS Protobuf

This repository contains the instructions on how to generate the typescript protobuf files used to interact with the Coreum blockchain using gRPC.

How it works

What the tool does is:

  1. Clones the repository of the Cosmos-SDK and Coreum.
  2. Extracts the protos of the modules that we want to generate.
  3. Generates the protobuf files using buf generate.

Prerequisites

Install the code generator, the runtime library, and the Buf CLI:

npm install @bufbuild/protobuf @bufbuild/protoc-gen-es @bufbuild/buf

How to use

  1. Clone the Coreum repository with the branch that you want, in this case we are going to clone the master branch.
git clone [email protected]:CoreumFoundation/coreum.git
  1. Clone the Cosmos SDK repository with the branch that you want, in this case we are going to clone the v0.47.5 branch, but you can use any branch you want.
git clone --branch v0.47.5 [email protected]:cosmos/cosmos-sdk.git
  1. Copy all the proto files in the current directory.
cp -r ./cosmos-sdk/proto/ ./coreum/proto/ .
  1. Run the buf generate command with the template provided in this repository.
npx buf generate ./proto/ --template buf.gen.yaml -o ./ts-protos

This will generate all the typescript protobuf files in the ts-protos directory.