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.2.tar.gz.

File metadata

File hashes

Hashes for multiversx_sdk_rust_contract_builder-4.0.2.tar.gz
Algorithm Hash digest
SHA256 054119e1bff9d3f11de7a6588da804e9af72f47180bfdffb2d145fb415df0b9d
MD5 7178699b742186cdf022559ba42251ad
BLAKE2b-256 0096f78ab13a44226c73fc2b336cc06d00dd9992031729fe9b53337a695d8893

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multiversx_sdk_rust_contract_builder-4.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f05e46538077f3d1f9d43a3bee70b30342fc0bcbfbe50d6b45bb52a09524335f
MD5 3e47fb8fe78bed8e38581676b515ead1
BLAKE2b-256 1dfd77936b8a8dc8a35205c1750d23f8e3ee0db564181145bd82479bd0164a9c

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