This repository contains the canonical Injective proto source files and pre-compiled generated code for the supported languages:
- C++ (
cpp_protos.zip) - C# (
csharp_protos.zip) - Java (
java_protos.zip) - Python (
python_protos.zip) - Rust (
rust_protos.zip)
Use the zip files as drop-in generated code for your project. The all_protos/ directory is the source-of-truth snapshot of the proto files that were used to produce the current zips.
All original proto files can be found in the all_protos/ folder. This directory is regenerated from proto/ every time make generate (or make run-full) is executed and reflects exactly the proto inputs used for the last published compilation.
If you are using the Injective proto components in Java you might want to use the following Maven dependencies (or use it as the base for your own Maven configuration):
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>injective_proto</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.25.1</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>1.59.0</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>1.59.0</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
</project>This section documents the process for updating the proto definitions and regenerating all compiled outputs when a new Injective chain version is released.
The following tools must be available on PATH before running any make targets:
bufCLI — used for proto export and remote code generation.python3— required byscripts/normalize_generated.py(normalization of C# and Rust outputs).git— used to clone the source repositories.zip— used bymake packto produce the output archives.- Internet access to
github.com—buf exportandgit clonefetch from InjectiveLabs forks hosted there.
No local protoc, grpc.tools, or Rust protoc plugins are needed. All code generation is handled by pinned Buf remote plugins declared in buf.gen.yaml.
The Makefile distinguishes between transient build artifacts and committed outputs.
Transient directories (created during the build, cleaned up at the end of make run-full, never committed):
| Path | Purpose |
|---|---|
proto/ |
Merged proto sources assembled from all upstream repositories |
third_party/ |
Raw output of buf export for dependency protos (cosmos-sdk, ibc-go, wasmd, cometbft, ics23) |
injective-core/ |
Shallow clone of InjectiveLabs/injective-core |
injective-indexer/ |
Shallow clone of InjectiveLabs/injective-indexer |
cpp/, csharp/, java/, python/, rust/ |
Per-language generated output before packing |
Committed outputs (updated by a maintainer and pushed as part of a version update):
| Path | Purpose |
|---|---|
all_protos/ |
Snapshot of the proto/ tree used in the last generation |
cpp_protos.zip |
Generated C++ code |
csharp_protos.zip |
Generated C# code |
java_protos.zip |
Generated Java code |
python_protos.zip |
Generated Python code |
rust_protos.zip |
Generated Rust code |
The top of Makefile contains six version variables. These are the only values a maintainer normally needs to change for a routine chain version update:
COMETBFT_VERSION_TAG=v1.0.1-inj.7
COSMOS_SDK_VERSION_TAG=v0.50.14-inj.9
IBC_GO_VERSION_TAG=v8.7.0-inj.4
WASMD_VERSION_TAG=v0.53.3-inj.3
INJECTIVE_CORE_VERSION_TAG=v1.20.0-alpha.3
INJECTIVE_INDEXER_VERSION_TAG=v1.19.41INJECTIVE_CORE_VERSION_TAG— the new chain version. This tag is cloned from InjectiveLabs/injective-core and itsproto/injective/tree is the primary source of Injective-specific protos.INJECTIVE_INDEXER_VERSION_TAG— the matching release of InjectiveLabs/injective-indexer, which supplies the exchange/indexer RPC protos underproto/exchange/.COMETBFT_VERSION_TAG,COSMOS_SDK_VERSION_TAG,IBC_GO_VERSION_TAG,WASMD_VERSION_TAG— InjectiveLabs forks of the respective upstream libraries. Bump these to the versions pinned by the newinjective-corerelease (check thego.modor release notes ofinjective-core).ics23is fetched from upstreamcosmos/ics23without a pinned tag and is not configurable here.
buf.gen.yaml pins all remote code generation plugins for reproducibility:
buf.build/protocolbuffers/*:v31.1andbuf.build/grpc/*:v1.76.0— core language plugins.buf.build/community/neoeinstein-prost*:v0.5.0— Rust prost/tonic plugins.
Update plugin versions in buf.gen.yaml only when deliberately upgrading the generated code style, not as part of a routine chain version bump.
From the injective-core release you are targeting, determine the correct versions of all dependencies:
- The
INJECTIVE_CORE_VERSION_TAGis the release tag itself (e.g.v1.20.0). - Find
COMETBFT_VERSION_TAG,COSMOS_SDK_VERSION_TAG,IBC_GO_VERSION_TAG, andWASMD_VERSION_TAGin thego.modof thatinjective-coretag, or in its release notes. - Find
INJECTIVE_INDEXER_VERSION_TAGfrom the indexer release corresponding to this chain version.
Edit lines 1–6 of Makefile to set the six *_VERSION_TAG variables to the values identified in step 1.
make run-fullThis single command runs the complete pipeline in sequence:
clean-all— removes any existing transient directories (proto/,third_party/,injective-core/,injective-indexer/, language output dirs) and existing*_protos.zipfiles.clone-all— shallow-clonesinjective-coreandinjective-indexerat the pinned tags (skips if already present).generate:sync-protosassembles the unifiedproto/tree:download-protos: runsbuf exportfor cosmos-sdk, ibc-go, wasmd, cometbft (using the InjectiveLabs forks at the pinned tags), and ics23; copies the output intothird_party/; then copiesinjective-core/proto/injectiveand everything fromthird_party/intoproto/.download-indexer-protos: copies all.protofiles frominjective-indexer/api/gen/grpcintoproto/exchange/.
- Runs
buf generate --template buf.gen.yamlagainstproto/, which calls all pinned remote plugins and writes output intocpp/,csharp/proto/,java/,python/, andrust/proto/. - Runs
normalize-generated(see About normalize-generated below). - Replaces
all_protos/with a fresh copy ofproto/.
pack— zips each language output directory into the five*_protos.ziparchives.- Final cleanup — removes
injective-core/,injective-indexer/,proto/,third_party/, and all per-language output directories so the working tree is clean.
git statusThe working tree should show changes only in:
Makefile(the version tag bumps from step 2)all_protos/(updated proto snapshot)cpp_protos.zip,csharp_protos.zip,java_protos.zip,python_protos.zip,rust_protos.zip
If unexpected files appear in git status, investigate before committing.
git checkout -b update-protos-v1.20.0
git add Makefile all_protos/ cpp_protos.zip csharp_protos.zip java_protos.zip python_protos.zip rust_protos.zip
git commit -m "chore: update protos for injective-core v1.20.0"
git push origin update-protos-v1.20.0Open a pull request and merge it to master after review.
After merging to master, create and push a git tag that matches the chain version:
git checkout master
git pull origin master
git tag v1.20.0
git push origin v1.20.0This repository does not use GitHub releases — tags are the authoritative version markers.
The following targets are available for iterative or partial runs:
make run-full— full end-to-end pipeline (clean → clone → generate → pack → clean transient). The normal entry point for a routine version update.make generate— syncs protos, runsbuf generate, normalizes output, and refreshesall_protos/. Assumesinjective-coreandinjective-indexerare already cloned. Use this to re-run generation after manually adjusting proto files orbuf.gen.yamlwithout re-cloning.make sync-protos— assemblesproto/from all upstream sources (runsdownload-protos+download-indexer-protos). Requires the repos to already be cloned.make download-protos— exports dependency protos viabuf exportand assemblesproto/excluding indexer protos. Requiresinjective-coreto be cloned.make download-indexer-protos— copies exchange RPC protos frominjective-indexerintoproto/exchange/. Requiresinjective-indexerto be cloned.make clone-all— clones bothinjective-coreandinjective-indexerat their pinned tags (no-op if already present).make clone-injective-core— clones onlyinjective-core(no-op if already present).make clone-injective-indexer— clones onlyinjective-indexer(no-op if already present).make normalize-generated— runsscripts/normalize_generated.pyagainst the existing language output dirs. Use this when iterating on the normalization script without re-running full generation.make pack— zips existing per-language output directories into*_protos.zip. Use this to repackage without re-generating.make clean-all— removes all transient directories and zip archives.
scripts/normalize_generated.py post-processes the raw buf generate output to produce a consistent directory tree:
- C#: moves generated
.csfiles from the flatbufoutput into a directory tree that mirrors the source proto path (read from thesource:annotation in each generated file). - Rust: moves generated
.rsfiles into a subdirectory matching the proto package's source path, and rewrites theinclude!paths inrust/proto/mod.rsaccordingly. Also generatesexchange/mod.rsfor the flat exchange package files. - Compatibility shims: copies
cosmos.crypto.multisig.v1beta1generated files to the legacycosmos.crypto.multisigpath (both C# and Rust) for backward compatibility. - Rust symbol rename: renames the
Validatorsenum incosmos.staking.v1beta1toEnumValidatorsto avoid a Rust naming conflict.
If you manually edit files under rust/proto/ or csharp/proto/, run make normalize-generated afterwards to re-apply these transformations.
buf generatefails with an authentication or permission error: remote plugins on the Buf Schema Registry require an authenticated session. Runbuf registry loginand follow the prompts to authenticate with your Buf account before running anymaketarget that invokesbuf generate.buf exportfails with a 404 or "tag not found": the InjectiveLabs fork must have the tag you set inMakefilepushed before the export can succeed. Verify the tag exists on the remote before bumping the version.git clonefails forinjective-coreorinjective-indexer: same cause — confirm the tag exists on the respective repository and that you have network access togithub.com.make sync-protoscan be retried safely: it starts by wipingproto/andthird_party/, so it is safe to re-run after a partial failure.rust/proto/mod.rsmust not be deleted manually: the Rust output relies on theprost-crateplugin emittinginclude_file=mod.rs. The normalization script rewrites paths inside this file; if it is missing, Rust consumers will not be able to resolve the generated modules.- Unexpected files after generation: if
git statusshows files outsideMakefile,all_protos/, and the five zips, the cleanup at the end ofmake run-fullmay not have completed. Runmake clean-alland re-generate, or inspect the Makefile'sclean_*macros to understand what is being deleted.