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
- Create virtual environment
$ python3 -m venv env
$ source env/bin/activate
- Install poetry
$ pip install poetry
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cosmos-proto-0.0.0.tar.gz
.
File metadata
- Download URL: cosmos-proto-0.0.0.tar.gz
- Upload date:
- Size: 170.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0 CPython/3.10.6 Darwin/21.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fec2a2450f3ee69d3738bcc895603ceeab492241d6f2e539ea92d10f76ffe35 |
|
MD5 | 260b34831c9038547628352bda858a00 |
|
BLAKE2b-256 | 317c91f8977a283971686614438d4b364b93098c145db9c8bd4c45f9f12ee5ce |
File details
Details for the file cosmos_proto-0.0.0-py3-none-any.whl
.
File metadata
- Download URL: cosmos_proto-0.0.0-py3-none-any.whl
- Upload date:
- Size: 244.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0 CPython/3.10.6 Darwin/21.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | feeb5441fa4a00b5eb198a312e4cf56047f2be99d3604ed55b6ace6f03fecfee |
|
MD5 | 804ca60cda0e0b3b7eceefb679a225e0 |
|
BLAKE2b-256 | 0969276023a90df3675c19e4ce0aba9bde7038ad99e72474c86aa906b1e8e444 |