The avalanche-types
crate implements and is the canonical representation of Avalanche primitive types in Rust. Avalanche types are separated by modules and are all under the src
directory.
This crate also provides an SDK library for developing subnets in Rust. For the SDK functionality, see src/subnet
which contains everything required to build a subnet VM in Rust.
The following VMs were built with the SDK:
- Simple Rust VM: TimestampVM
- Complex Rust VM: SpacesVM
Examples can be found in examples
and are a good first step to getting an understanding of general usage.
- How to Build a Simple Rust VM tutorial provides a basic example of using the Rust SDK.
- TimestampVM Template allows you to quickly generate a TimestampVM based project with cargo generate
This project uses the latest stable Rust toolchain.
First please try find the answer to your question in the code documentation. If more clarification is required, try opening an issue with the question.
- Ids (e.g.,
src/ids
) - Transaction types/serialization (e.g.,
src/platformvm/txs
) - Certificates (e.g.,
src/key/cert
) - Keys and addresses (e.g.,
src/key/secp256k1
) - Peer-to-peer messages (e.g.,
src/message
) - RPC chain VM (e.g.,
src/subnet/rpc
) - Genesis generate helper (e.g.,
src/subnet_evm
) - Protobuf generated stubs and helpers (e.g.,
src/proto
) - AvalancheGo APIs (e.g.,
/src/avalanchego
)
The basic types available in this crate are used in other Avalanche Rust projects (e.g., distributed load tester blizzard
, avalanche-ops
).