Skip to main content

The Python Protobuf implementation for Cosmos SDK chains

Project description

Python implementation for cosmos.proto

Currently, this repo contains generated python files for Terra 2 and Osmosis Blockchains supported Modules.

Setup

  1. Create virtual environment
$ python3 -m venv env
$ source env/bin/activate
  1. Install poetry
$ pip install poetry
  1. Install packages,
$ pip install poetry
$ poetry install

If you encounter "version solving failed." error, try poetry add <package_name>, followed by poetry lock and then poetry install

Generating python files for new proto files

We use betterproto[compiler] for generating python code from proto files, and it is party a manual process. Here are a few pointers to help you through the process -

  • cd into each module and make sure all *.proto files are in one place.
  • For each .proto file, check the import paths and update them if needed.
  • Once the paths are corrected, use the following command to generate python files.
$ protoc -I . --python_betterproto_out=<OUTPUT DIR NAME> <PROTO FILE NAMES>

For eq - protoc -I . --python_betterproto_out=py genesis.proto query.proto gov.proto feetoken.proto

To install betterproto[compiler], use -

pip install "betterproto[compiler]"

TO DO : Update the scripts

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cosmos-proto-0.0.0.tar.gz (170.2 kB view hashes)

Uploaded Source

Built Distribution

cosmos_proto-0.0.0-py3-none-any.whl (244.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page