timestampvm-rs-template
is a cargo generate template for timestampvm-rs, a minimal implementation of an Avalanche custom virtual machine (VM) in Rust, using the Avalanche Rust SDK.
First install cargo generate
cargo install cargo-generate
then to use this template run:
cargo generate --git https://github.com/ava-labs/timestampvm-rs-template --name myproject
- Latest version of stable Rust.
- To build and test the plugin you need protoc version >= 3.15.0.
# Use the build script
./scripts/build.release.sh
# or build using cargo
cargo build --release --bin {{project-name}}
VM_PLUGIN_PATH=$(pwd)/target/release/{{project-name}} \
./scripts/tests.e2e.sh
# or, specify the custom avalanchego binary
VM_PLUGIN_PATH=$(pwd)/target/release/{{project-name}} \
./scripts/tests.e2e.sh ~/go/src/github.com/ava-labs/avalanchego/build/avalanchego
# (optional) set NETWORK_RUNNER_ENABLE_SHUTDOWN=1 in "tests.e2e.sh"
# to shut down the network afterwards
For more examples see the timestampvm-rs repo.