From 69cf754fe104edae295cb11936a950be97441bac Mon Sep 17 00:00:00 2001 From: Ashutosh Tripathi <39340292+ashucoder9@users.noreply.github.com> Date: Fri, 14 Jun 2024 16:52:15 +0530 Subject: [PATCH 1/3] Resolve issue #69 Signed-off-by: Ashutosh Tripathi <39340292+ashucoder9@users.noreply.github.com> --- README.md | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 207d372..71dc775 100644 --- a/README.md +++ b/README.md @@ -49,23 +49,37 @@ You can build your precompile and Subnet-EVM with `./scripts/build.sh`. This scr ### Run -You can run you Precompile-EVM by using Avalanche Network Runner +You can run you Precompile-EVM by using the Avalanche CLI. + +First, create the configuration for your subnet. ```bash -avalanche-network-runner server \ ---log-level debug \ ---port=":8080" \ ---grpc-gateway-port=":8081" +avalanche subnet create mysubnet +✔ Custom +creating custom VM subnet mysubnet +Enter path to custom genesis: ./.devcontainer/genesis-example.json +✔ I already have a VM binary (local network deployments only) +Enter path to VM binary: /go/src/github.com/ava-labs/avalanchego/build/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy +✓ Successfully created subnet configuration ``` -Then launch a Subnet with your custom VM: +Next, launch the Subnet with your custom VM: ```bash - avalanche-network-runner control start \ - --log-level debug \ - --endpoint="0.0.0.0:8080" \ - --number-of-nodes=5 \ - --blockchain-specs '[{"vm_name": "subnetevm", "genesis": "./.devcontainer/genesis-example.json"}]' +avalanche subnet deploy mysubnet +✔ Local Network +Deploying [mysubnet] to Local Network +Backend controller started, pid: 10401, output at: /root/.avalanche-cli/runs/server_20240614_111700/avalanche-cli-backend.log +Installing avalanchego-v1.11.8... +avalanchego-v1.11.8 installation successful + +Booting Network. Wait until healthy... +Node logs directory: /root/.avalanche-cli/runs/network_20240614_111713/node/logs +Network ready to use. + +Deploying Blockchain. Wait until network acknowledges... + +Blockchain ready to use ``` ### Test From 4420ce103b8be6f855020d760cc29b22df9b7533 Mon Sep 17 00:00:00 2001 From: Ashutosh Tripathi <39340292+ashucoder9@users.noreply.github.com> Date: Fri, 14 Jun 2024 16:52:49 +0530 Subject: [PATCH 2/3] Update Dockerfile Signed-off-by: Ashutosh Tripathi <39340292+ashucoder9@users.noreply.github.com> --- .devcontainer/Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1be95a2..143785c 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,9 +1,15 @@ ARG AVALANCHEGO_VERSION FROM avaplatform/avalanche-cli:latest as avalanche-cli +FROM ghcr.io/foundry-rs/foundry:latest as foundry FROM avaplatform/avalanchego:$AVALANCHEGO_VERSION as avalanchego FROM mcr.microsoft.com/devcontainers/base COPY --from=avalanchego /avalanchego/build /go/src/github.com/ava-labs/avalanchego/build COPY --from=avalanche-cli /avalanche /usr/local/bin/avalanche +COPY --from=foundry /usr/local/bin/forge /usr/local/bin/forge +COPY --from=foundry /usr/local/bin/cast /usr/local/bin/cast +COPY --from=foundry /usr/local/bin/anvil /usr/local/bin/anvil +COPY --from=foundry /usr/local/bin/chisel /usr/local/bin/chisel + RUN curl -sSfL https://raw.githubusercontent.com/ava-labs/avalanche-network-runner/main/scripts/install.sh | sh -s From b092cc920e50accb90063c8be13024872a85365c Mon Sep 17 00:00:00 2001 From: Ashutosh Tripathi <39340292+ashucoder9@users.noreply.github.com> Date: Fri, 14 Jun 2024 17:25:27 +0530 Subject: [PATCH 3/3] Update README.md Signed-off-by: Ashutosh Tripathi <39340292+ashucoder9@users.noreply.github.com> --- README.md | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/README.md b/README.md index 71dc775..178ed13 100644 --- a/README.md +++ b/README.md @@ -54,32 +54,13 @@ You can run you Precompile-EVM by using the Avalanche CLI. First, create the configuration for your subnet. ```bash -avalanche subnet create mysubnet -✔ Custom -creating custom VM subnet mysubnet -Enter path to custom genesis: ./.devcontainer/genesis-example.json -✔ I already have a VM binary (local network deployments only) -Enter path to VM binary: /go/src/github.com/ava-labs/avalanchego/build/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy -✓ Successfully created subnet configuration +avalanche subnet create mysubnet --custom --vm $AVALANCHEGO_PLUGIN_PATH/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy --genesis ./.devcontainer/genesis-example.json ``` Next, launch the Subnet with your custom VM: ```bash avalanche subnet deploy mysubnet -✔ Local Network -Deploying [mysubnet] to Local Network -Backend controller started, pid: 10401, output at: /root/.avalanche-cli/runs/server_20240614_111700/avalanche-cli-backend.log -Installing avalanchego-v1.11.8... -avalanchego-v1.11.8 installation successful - -Booting Network. Wait until healthy... -Node logs directory: /root/.avalanche-cli/runs/network_20240614_111713/node/logs -Network ready to use. - -Deploying Blockchain. Wait until network acknowledges... - -Blockchain ready to use ``` ### Test