{"id":31619315,"url":"https://github.com/multiversx/mx-template-devcontainers","last_synced_at":"2025-10-06T14:04:51.523Z","repository":{"id":134884436,"uuid":"593957094","full_name":"multiversx/mx-template-devcontainers","owner":"multiversx","description":"MultiversX devcontainer templates to be used in VSCode or GitHub Codespaces, for Smart Contract development (others to come).","archived":false,"fork":false,"pushed_at":"2025-09-03T08:30:59.000Z","size":87,"stargazers_count":4,"open_issues_count":1,"forks_count":4,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-09-03T10:17:20.886Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/multiversx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-01-27T08:46:26.000Z","updated_at":"2025-09-03T08:16:31.000Z","dependencies_parsed_at":"2024-01-31T20:26:39.338Z","dependency_job_id":"fad15532-ef36-4bae-9880-887ac685e594","html_url":"https://github.com/multiversx/mx-template-devcontainers","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/multiversx/mx-template-devcontainers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-template-devcontainers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-template-devcontainers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-template-devcontainers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-template-devcontainers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multiversx","download_url":"https://codeload.github.com/multiversx/mx-template-devcontainers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-template-devcontainers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278621844,"owners_count":26017253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-06T14:03:49.236Z","updated_at":"2025-10-06T14:04:51.515Z","avatar_url":"https://github.com/multiversx.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mx-template-devcontainers\n\nMultiversX devcontainer templates to be used in **VSCode** or **GitHub Codespaces**, for Smart Contract development (others to come).\n\n## For users of the templates\n\nBefore everything, please follow the Visual Studio Code series on dev containers:\n - [Beginner's Series to Dev Containers](https://youtube.com/playlist?list=PLj6YeMhvp2S5G_X6ZyMc8gfXPMFPg3O31)\n - [Dev Container How To](https://youtube.com/playlist?list=PLj6YeMhvp2S6GjVyDHTPp8tLOR0xLGLYb)\n - [Developing inside a Container](https://code.visualstudio.com/docs/devcontainers/containers)\n\nIn Visual Studio code, the following MultiversX dev containers are available:\n\n - [MultiversX: Smart Contracts Development (Rust)](src/smart-contracts-rust)\n - ...\n\n## Using the Docker images without VSCode\n\nIf you'd like to use the Docker image(s) to invoke `mxpy` commands and build contracts directly from a terminal, without VSCode's devcontainers feature, below are a few examples.\n\nFirst, let's export some environment variables:\n\n```\nexport IMAGE=multiversx/devcontainer-smart-contracts-rust:latest\nexport DOCKER_USER=$(id -u):$(id -g)\n\n# Mandatory: run the container as the current user (should be 1000:1000), not as root.\n# Suggestion: use a stateless container; remove it after use (--rm).\n# Suggestion: map the current directory to \"/data\" in the container.\nexport RUN=\"docker run --network=host --user=${DOCKER_USER} --rm -it --volume $(pwd):/data\"\n```\n\nRun the container and do a quick inspection:\n\n```\n${RUN} ${IMAGE} whoami\n${RUN} ${IMAGE} mxpy --version\n${RUN} ${IMAGE} cargo --version\n${RUN} ${IMAGE} rustc --version\n${RUN} ${IMAGE} sc-meta --version\n${RUN} ${IMAGE} wasm-opt --version\n```\n\nClone `mx-contracts-rs` locally, then build a few contracts within the container:\n\n```\ngit clone https://github.com/multiversx/mx-contracts-rs.git  --single-branch --depth=1\n\n${RUN} ${IMAGE} sc-meta all build --path /data/mx-contracts-rs/contracts/adder\nstat ./mx-contracts-rs/contracts/adder/output/adder.wasm\n\n${RUN} ${IMAGE} sc-meta all build --path /data/mx-contracts-rs/contracts/ping-pong-egld\nstat ./mx-contracts-rs/contracts/ping-pong-egld/output/ping-pong-egld.wasm\n```\n\nDeploy a previously-built smart contract on Devnet:\n\n```\n${RUN} ${IMAGE} mxpy contract deploy \\\n    --bytecode /data/mx-contracts-rs/contracts/adder/output/adder.wasm \\\n    --arguments 0 \\\n    --pem /home/developer/multiversx-sdk/testwallets/latest/users/alice.pem \\\n    --recall-nonce \\\n    --gas-limit 5000000 \\\n    --chain D \\\n    --proxy https://devnet-gateway.multiversx.com \\\n    --send\n```\n\nCall a function of a previously-deployed smart contract:\n\n```\n${RUN} ${IMAGE} mxpy contract call \\\n    erd1qqqqqqqqqqqqqpgqr3clh6ghpww5fc4uhwh2amsseuvecswzd8ssxu68s3 \\\n    --function \"add\" \\\n    --arguments 42 \\\n    --pem /home/developer/multiversx-sdk/testwallets/latest/users/alice.pem \\\n    --recall-nonce \\\n    --gas-limit 5000000 \\\n    --chain D \\\n    --proxy https://devnet-gateway.multiversx.com \\\n    --send\n```\n\nQuery a smart contract:\n\n```\n${RUN} ${IMAGE} mxpy contract query \\\n    erd1qqqqqqqqqqqqqpgqr3clh6ghpww5fc4uhwh2amsseuvecswzd8ssxu68s3 \\\n    --function \"getSum\" \\\n    --proxy https://devnet-gateway.multiversx.com\n```\n\nSetup a localnet (make sure to set the `--workdir`, as well), then inspect the generated files (on the mapped volume):\n\n```\n${RUN} --workdir /data ${IMAGE} mxpy localnet setup\ncat ./localnet.toml\ntree -L 1 ./localnet\n```\n\nStart the localnet (make sure to publish the necessary ports; see the generated `localnet.toml`):\n\n```\n${RUN} --workdir /data --publish 7950:7950 ${IMAGE} mxpy localnet start\n```\n\nYou can pause the localnet by simply stopping the container, then restart it by invoking the `start` command again.\n\nIn a separate terminal, inspect an endpoint of the localnet's Proxy (as a smoke test):\n\n```\ncurl http://127.0.0.1:7950/network/config | jq\n```\n\n## For maintainers of the templates\n\nSkip this section if you are not a maintainer of this repository.\n\nResources:\n - [Create a Dev Container](https://code.visualstudio.com/docs/devcontainers/create-dev-container)\n - [devcontainers/templates](https://github.com/devcontainers/templates)\n - [devcontainers/template-starter](https://github.com/devcontainers/template-starter)\n - [Public index of templates](https://containers.dev/templates)\n\n\n### Build images\n\nBuild the Docker images for local testing:\n\n```\ndocker build --network=host ./resources/smart-contracts-rust -t multiversx/devcontainer-smart-contracts-rust:latest -f ./resources/smart-contracts-rust/Dockerfile\n```\n\n### Test the templates\n\n```\nrm -rf \"/tmp/test-workspace\" \u0026\u0026 mkdir -p \"/tmp/test-workspace\" \u0026\u0026 \\\ncp -R \"src/smart-contracts-rust/.devcontainer\" \"/tmp/test-workspace\" \u0026\u0026 \\\ncode \"/tmp/test-workspace/\"\n```\n\nThen, in VSCode, launch the command `Dev Containers: Rebuild and Reopen in Container`, wait, then inspect the environment. For example, check version of `mxpy`, `rust`, `sc-meta`, build the sample smart contracts, verify output of `rust-analyzer`.\n\n### Publish images\n\nLocally:\n\n```\ndocker build --network=host ./resources/smart-contracts-rust -t multiversx/devcontainer-smart-contracts-rust:latest -f ./resources/smart-contracts-rust/Dockerfile\ndocker push multiversx/devcontainer-smart-contracts-rust:latest\n```\n\nOn Github, trigger the GitHub workflow(s) `publish-image-*.yml` to publish the image(s). Ideally, do this on the `main` branch.\n\n### Publish templates\n\nTrigger the GitHub workflow `publish-templates.yml` to publish the templates. Ideally, do this on the `main` branch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiversx%2Fmx-template-devcontainers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultiversx%2Fmx-template-devcontainers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiversx%2Fmx-template-devcontainers/lists"}