Academy

Build and Run

Learn how to build and run your custom VM on a local network.

Time to build and run your customized EVM. Follow the steps below to build and run your custom VM on a local network.

Build Your Custom VM

There's a simple build script in the Precompile-EVM we can utilize to build. First, make sure you are in the root folder of you Precompile-EVM:

cd $GOPATH/src/github.com/ava-labs/precompile-evm

Then run the command to initiate the build script:

./scripts/build.sh

If you do not see any error, the build was successful.

Create your blockchain configuration

You can run you customized Precompile-EVM by using the Avalanche CLI.

First, create the configuration for your blockchain with custom VM.

avalanche blockchain create myblockchain \
 --custom \
 --vm $VM_PATH \
 --genesis "./.devcontainer/genesis-example.json" \
 --force \
 --sovereign=false \
 --evm-token "TOK" \
 --warp \
 --icm

Launch L1 with you customized EVM

Next, launch the Avalanche L1 with your custom VM:

avalanche blockchain deploy myblockchain --local

After around 1 minute the blockchain should have been created and some more output should appear in the terminal. You'll also see the RPC URL of your blockchain in the terminal.

Edit on GitHub

Last updated on

On this page