Skip to main content
Version: 0.2.3

Install and run

Requirements

Any of the approaches below that mention cargo require you to have installed Rust. You might also need to install pkg-config and make.

The required Rust version is specified in rust-toolchain.toml in the project root and handled automatically by cargo.

Install an executable binary

Installing an executable binary is achievable with cargo install via crates.io or github.com. This approach downloads the crate, builds it in release mode and copies it to ~/.cargo/bin/. To avoid needing to compile and wait, check the pre-compiled binary section.

Remove Pythonic Devnet

If in the past you installed Pythonic Devnet, be sure to remove it to avoid name collision of the old and the new executable - if by no other means, then by rm $(which starknet-devnet).

Install from crates.io

$ cargo install starknet-devnet

Install from GitHub

  • Use the --locked flag to ensure using the dependencies listed in Cargo.lock in the project root.
  • Preferably familiarize yourself with the cargo install command (docs).
$ cargo install --git https://github.com/0xSpaceShard/starknet-devnet-rs.git --locked

Install with asdf

  • Run the following to add the starknet-devnet plugin
$ asdf plugin add starknet-devnet
  • Show all installable versions:
$ asdf list-all starknet-devnet
  • Install latest version:
$ asdf install starknet-devnet latest
  • Install specific version:
$ asdf install starknet-devnet 0.2.0

Check asdf guide for more instructions on how to install & manage versions.

Run the installed executable

When cargo install finishes, follow the output in your terminal. If properly configured, you should be able to run Devnet with:

$ starknet-devnet

Fetch a pre-compiled binary executable

If you want to save time and skip project compilation on installation, since Devnet v0.0.5, the Assets section of each GitHub release contains a set of platform-specific pre-compiled binary executables. Extract and run with:

$ curl -sSfL https://github.com/0xSpaceShard/starknet-devnet-rs/releases/download/<VERSION>/<COMPRESSED_ARCHIVE> | tar -xvz -C <TARGET_DIR>
$ <TARGET_DIR>/starknet-devnet

Run from source

To install the project from source, after git-cloning the Devnet repository, running the following command will install, build and start Devnet:

$ cargo run

Specify optional CLI params like this:

$ cargo run -- [ARGS]

For a more optimized performance (though with a longer compilation time), run:

$ cargo run --release