Skip to main content

MultiversX: utility package for building Rust contracts (reproducible builds).

Project description

mx-sdk-build-contract

Docker image (and wrappers) for reproducible contract builds (Rust). See docs.multiversx.com.

Build the Docker image

docker buildx build --no-cache . -t sdk-rust-contract-builder:experimental -f ./Dockerfile

Build contract using the wrapper

Without providing cargo-target-dir:

python3 ./build_with_docker.py --image=sdk-rust-contract-builder:experimental \
    --project=~/contracts/reproducible-contract-build-example \
    --output=~/contracts/output-from-docker

With providing cargo-target-dir:

python3 ./build_with_docker.py --image=sdk-rust-contract-builder:experimental \
    --project=~/contracts/reproducible-contract-build-example \
    --output=~/contracts/output-from-docker \
    --cargo-target-dir=~/cargo-target-dir-docker

Building from a packaged source code:

python3 ./build_with_docker.py --image=sdk-rust-contract-builder:experimental \
    --packaged-src=~/contracts/example-0.0.0.source.json \
    --output=~/contracts/output-from-docker

Build contract using the Docker inner script

This is useful for useful for testing, debugging and reviewing the script.

export PROJECT=${HOME}/contracts/reproducible-contract-build-example
export OUTPUT=${HOME}/contracts/output
export CARGO_TARGET_DIR=${HOME}/cargo-target-dir
export PATH=${HOME}/multiversx-sdk/vendor-rust/bin:${HOME}/multiversx-sdk/wabt/latest/bin:${PATH}
export RUSTUP_HOME=${HOME}/multiversx-sdk/vendor-rust
export CARGO_HOME=${HOME}/multiversx-sdk/vendor-rust

Build a project:

python3 ./build_within_docker.py --project=${PROJECT} --output=${OUTPUT} \
    --cargo-target-dir=${CARGO_TARGET_DIR}

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

Built Distribution

File details

Details for the file multiversx_sdk_rust_contract_builder-4.0.3.tar.gz.

File metadata

File hashes

Hashes for multiversx_sdk_rust_contract_builder-4.0.3.tar.gz
Algorithm Hash digest
SHA256 54d32369c74c4cda1f07feeb70be86c7b0b61af9569d276ee4ac4e197c9bcbaa
MD5 12979f248f5dc865664abec9d90d7c0e
BLAKE2b-256 dd1a191a348a963c555809b8cda14c374b49c8d041cfc2e1a67c2b55e40560d5

See more details on using hashes here.

File details

Details for the file multiversx_sdk_rust_contract_builder-4.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for multiversx_sdk_rust_contract_builder-4.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f5b26ea0e1506324dd5042c727646f19592d01370e8e50d3bfe735148a6c752c
MD5 e252f3efa74e5e1c3b0b6e9f89f19030
BLAKE2b-256 3a01a852b3396a9a58ba06e14ff0f75da124206cf55b7a394ad668ef7802016c

See more details on using hashes here.

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