Skip to main content
Version: Next

Run with Docker

Devnet is available as a Docker image (Docker Hub link). To download the latest image, run:

$ docker pull starknetfoundation/starknet-devnet-rs

Supported platforms: linux/amd64 and linux/arm64 (also executable on darwin/arm64).

Running a container is done like this (see port publishing for more info):

$ docker run -p [HOST:]<PORT>:5050 starknetfoundation/starknet-devnet-rs [OPTIONS]

Docker image tags​

All of the versions published on crates.io for starknet-devnet are available as docker images, which can be used via:

$ docker pull starknetfoundation/starknet-devnet-rs:<CRATES_IO_VERSION>
note

The latest docker image tag corresponds to the last published non-prerelease version.

Accessing Devnet fixes before release​

Commits to the main branch of this repository are mostly available as images tagged with sha- followed by their commit hash (the full 40-lowercase-hex-digits SHA1 digest):

$ docker pull starknetfoundation/starknet-devnet-rs:sha-<COMMIT_HASH>

If a fix has been merged into the main branch of Devnet's code repository, you can access it before its inclusion in an official release. Just inspect the main commit list and copy the full SHA digest of the commit containing the fix (or preferably the latest commit) whose Build and Publish workflow completed successfully. A passing test workflow alone does not establish that the Docker image was published; some revisions may have no corresponding image.

Zero-seeded set of accounts​

By appending the -seed0 suffix, you can use images which predeploy funded accounts with --seed 0, thus always predeploying the same set of accounts:

$ docker pull starknetfoundation/starknet-devnet-rs:<VERSION>-seed0
$ docker pull starknetfoundation/starknet-devnet-rs:latest-seed0

Container port publishing​

Linux​

If on a Linux host machine, you can use --network host. This way, the port used internally by the container is also available on your host machine. The --port option can be used (as well as other CLI options).

$ docker run --network host starknetfoundation/starknet-devnet-rs [--port <PORT>]

Mac and Windows​

If not on Linux, you need to publish the container's internally used port to a desired <PORT> on your host machine. The internal port is 5050 by default (probably not your concern, but can be overridden with --port).

$ docker run -p [HOST:]<PORT>:5050 starknetfoundation/starknet-devnet-rs

E.g. if you want to use your host machine's 127.0.0.1:5050, you need to run:

$ docker run -p 127.0.0.1:5050:5050 starknetfoundation/starknet-devnet-rs

You may ignore any address-related output logged on container startup (e.g. Starknet Devnet listening on 0.0.0.0:5050). What you will use is what you specified with the -p argument.

If you don't specify the HOST part, the server will indeed be available on all of your host machine's addresses (localhost, local network IP, etc.), which may present a security issue if you don't want anyone from the local network to access your Devnet instance.

Development note​

The publish workflow builds temporary per-architecture images tagged sha-<COMMIT_HASH>-amd64 and sha-<COMMIT_HASH>-arm64, combines them into the multi-platform sha-<COMMIT_HASH> manifest, and removes the temporary tags. Release version tags and latest point to the corresponding multi-platform manifests; the seed-zero images follow the same process.