mx-proto
Protobuf and gRPC bindings for MultiversX network protocols.
mx-proto packages the generated bindings, gRPC stubs, and a few convenience
helpers that are commonly needed by downstream MultiversX services.
Install
[]
= "0.1"
Features
- Prost-generated bindings for the MultiversX protocol schemas
bytes::Bytesfor protobufbytesfields to reduce unnecessary copiestonicclient and server stubs for gRPC services- Helpers for transaction hashing and Bech32 address formatting
- Re-export of
prost::Messagefor encoding and decoding ergonomics
What Users Get
- Generated protobuf messages under
mx_proto::generated::* - The main schema set under
mx_proto::generated::proto::* - Additional generated modules such as storage and VM host bindings
- Manual helpers on
Transactionfor canonical hashing and Bech32 address formatting
Usage
use ;
let tx = Transaction ;
let tx_bytes = tx.encode_to_vec;
let hash = tx.get_tx_hash;
let sender = tx.sender_bech32?;
let receiver = tx.receiver_bech32?;
let batch = Batch ;
let batch_bytes = batch.encode_to_vec;
let decoded = decode?;
assert_eq!;
assert_eq!;
assert!;
assert!;
# Ok::
Examples
The packaged examples are intended to work even when the repository itself is private:
Regenerating Bindings
# Build the crate inside the workspace to regenerate the bindings from
# ../../proto/raw into Cargo's OUT_DIR.
Published crates and docs.rs builds use the checked-in generated bindings under
generated/. Workspace builds prefer regenerating from the raw schema files in
../../proto/raw when they are available.
docs.rs
The public documentation is intended to live on docs.rs. Because this crate ships checked-in generated bindings, docs.rs builds do not need access to the private workspace repository layout in order to succeed.
Included Schemas
The workspace raw schemas live under ../../proto/raw/ and include:
transaction.proto- Transaction structureblock.proto- Block and miniblock structuresheartbeat.proto- Validator heartbeat messages
Maintainer Release Flow
The repository includes a manual GitHub Actions workflow for publishing the crate. The expected maintainer flow is:
- Sync
proto/rawwith the upstream Go schema sources. - Run
cargo test -p mx-proto. - Run
cargo publish -p mx-proto --dry-run. - Trigger the publish workflow or publish locally with a crates.io token.