Familiarity with Linux/Mac command line is essential.
Overview
As you may be aware, Darwinia chains are EVM compatible, which means that the RPC behavior should be consistent with an Ethereum node. The majority of RPC usage aligns with the official Ethereum RPC, with the exception of the EVM tracing APIs. The key distinction is that the EVM tracing functionality is offered by a dedicated node. This tutorial will demonstrate how to run a dedicated node to enable EVM tracing functionality.
Run Evm Trace Node
Recommended Hardware
- RAM: 8 GB:
- Storage(SSD): 800 GB
Run Evm Tracing Node
The following steps are specific to Pangolin, but the steps for other networks are similar.
Prepare the tracing binary and overridden wasms
- Create a work dirctory
Let's create a directory called
run-evm-tracing-node
to store everything needed for setting up an EVM tracing node, including the downloaded evm tracing binary and the chain database. Additionally, we'll create a subdirectory called overridden-runtimes
under run-evm-tracing-node
to store all the overridden runtime files. To accomplish this, please execute the following command:bashmkdir run-evm-tracing-node && cd run-evm-tracing-node mkdir overridden-runtimes
- Download the precompiled tracing binary
As of the time of writing this doc (2023-09-04), the latest version of the Pangolin Chain is
v6.3.1
. Please ensure that you check for the latest version when running your own node.Please be aware that there are two types of binaries available on the release page. Select the one that starts with
darwinia-tracing-xxx
.bashwget https://github.com/darwinia-network/darwinia/releases/download/pango-6310/darwinia-tracing-x86_64-linux-gnu.tar.bz2 tar xvf darwinia-tracing-x86_64-linux-gnu.tar.bz2
- Download the overridden wasms
Once you have downloaded the tracing binary, you will need to download the overridden wasms before setting up your EVM tracing node. The overridden wasm files can be found in a repository maintained by the Darwinia core team. To do this, please run the following command:
bashgit clone https://github.com/darwinia-network/wasm-runtime-overrides.git cd wasm-runtime-overrides/ git checkout origin/pangolin cp -r pangolin/ ../run-evm-tracing-node/overridden-runtimes/
The
wasm-runtime-overrides
repository has four branches, each corresponding to one of the four Darwinia chains. You will need to switch to the branch that corresponds to your desired network and copy the wasm
directory to your temporary workaround location. In this tutorial, we will use the pangolin
branch.Start the evm tracing node
- Start the node by running the following command:
bash./darwinia \ --chain=pangolin \ --base-path=data/pangolin \ --state-pruning=archive \ --blocks-pruning=archive \ --execution=wasm \ --ws-external \ --rpc-external \ --rpc-cors=all \ --tracing-api=debug,trace \ --runtime-cache-size=64 \ --wasm-runtime-overrides=overridden-runtimes/pangolin/wasms
Please make sure to update the
--chain
, --base-path
, and --wasm-runtime-overrides
parameters according to the network you wish to set up. Additionally, ensure that the --execution=wasm
flag is enabled.- Verify your node is up and running successfully by reviewing the output displayed in the terminal. The terminal should display output similar to this:
bash2023-07-20 15:29:32 Darwinia 2023-07-20 15:29:32 ✌️ version 6.3.0-unknown 2023-07-20 15:29:32 ❤️ by Darwinia Network <hello@darwinia.network>, 2018-2023 2023-07-20 15:29:32 📋 Chain specification: Pangolin2 2023-07-20 15:29:32 🏷 Node name: befitting-drink-5121 2023-07-20 15:29:32 👤 Role: FULL 2023-07-20 15:29:32 💾 Database: RocksDb at data/pangolin/chains/pangolin2/db/full 2023-07-20 15:29:32 ⛓ Native runtime: Pangolin2-6310 (DarwiniaOfficialRust-0.tx0.au0) 2023-07-20 15:29:33 Parachain id: Id(2105) 2023-07-20 15:29:33 Parachain Account: 5Ec4AhNxga1JYLioRBNxfRnovheDELVbZTRSnKMgvSVPvNcN 2023-07-20 15:29:33 Parachain genesis state: 0x000000000000000000000000000000000000000000000000000000000000000000d353645e3503ca0ebe7319eee9bd70821acfa54d4161386990329b4a4f9813be03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c11131400 2023-07-20 15:29:33 Is collating: no 2023-07-20 15:29:34 [Parachain] Found wasm override. version=Pangolin2-6320 (DarwiniaOfficialRust-0.tx0.au0) file=overridden-runtimes/pangolin/wasms/pangolin-pango-6320-tracing-runtime.compact.compressed.wasm 2023-07-20 15:29:35 [Parachain] Found wasm override. version=Pangolin2-6300 (DarwiniaOfficialRust-0.tx0.au0) file=overridden-runtimes/pangolin/wasms/pangolin-pango-6300-tracing-runtime.compact.compressed.wasm 2023-07-20 15:29:36 [Parachain] Found wasm override. version=Pangolin2-6340 (DarwiniaOfficialRust-0.tx0.au0) file=overridden-runtimes/pangolin/wasms/pangolin-pango-6340-tracing-runtime.compact.compressed.wasm 2023-07-20 15:29:36 [Parachain] Found wasm override. version=Pangolin2-6310 (DarwiniaOfficialRust-0.tx0.au0) file=overridden-runtimes/pangolin/wasms/pangolin-pango-6310-tracing-runtime.compact.compressed.wasm 2023-07-20 15:29:38 [Relaychain] 👶 Creating empty BABE epoch changes on what appears to be first startup. 2023-07-20 15:29:38 [Relaychain] 🏷 Local node identity is: 12D3KooWFAFRHRmM3ARmKYdjKr5jzgu9HGiYi2kPW2Nh1hosmdQN 2023-07-20 15:29:38 [Relaychain] 💻 Operating system: linux 2023-07-20 15:29:38 [Relaychain] 💻 CPU architecture: x86_64 2023-07-20 15:29:38 [Relaychain] 💻 Target environment: gnu 2023-07-20 15:29:38 [Relaychain] 💻 CPU: AMD Ryzen 7 5700G with Radeon Graphics 2023-07-20 15:29:38 [Relaychain] 💻 CPU cores: 8 2023-07-20 15:29:38 [Relaychain] 💻 Memory: 63586MB 2023-07-20 15:29:38 [Relaychain] 💻 Kernel: 5.19.0-46-generic 2023-07-20 15:29:38 [Relaychain] 💻 Linux distribution: Ubuntu 22.04.1 LTS 2023-07-20 15:29:38 [Relaychain] 💻 Virtual machine: no 2023-07-20 15:29:38 [Relaychain] 📦 Highest known block at #0 2023-07-20 15:29:38 [Relaychain] 〽️ Prometheus exporter started at 127.0.0.1:9616 2023-07-20 15:29:38 [Relaychain] Running JSON-RPC HTTP server: addr=127.0.0.1:9934, allowed origins=["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"] 2023-07-20 15:29:38 [Relaychain] Running JSON-RPC WS server: addr=127.0.0.1:9945, allowed origins=["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"] 2023-07-20 15:29:38 [Relaychain] 🏁 CPU score: 1.27 GiBs 2023-07-20 15:29:38 [Relaychain] 🏁 Memory score: 14.10 GiBs 2023-07-20 15:29:38 [Relaychain] 🏁 Disk score (seq. writes): 733.15 MiBs 2023-07-20 15:29:38 [Relaychain] 🏁 Disk score (rand. writes): 315.71 MiBs 2023-07-20 15:29:38 [Relaychain] Starting with an empty approval vote DB. 2023-07-20 15:29:38 [Parachain] 🏷 Local node identity is: 12D3KooWMNkSu3SFJSaSYkjTwzBU2CtCvsMrAwkFMWRoiSwDDrTe 2023-07-20 15:29:38 [Parachain] 💻 Operating system: linux 2023-07-20 15:29:38 [Parachain] 💻 CPU architecture: x86_64 2023-07-20 15:29:38 [Parachain] 💻 Target environment: gnu 2023-07-20 15:29:38 [Parachain] 💻 CPU: AMD Ryzen 7 5700G with Radeon Graphics 2023-07-20 15:29:38 [Parachain] 💻 CPU cores: 8 2023-07-20 15:29:38 [Parachain] 💻 Memory: 63586MB 2023-07-20 15:29:38 [Parachain] 💻 Kernel: 5.19.0-46-generic 2023-07-20 15:29:38 [Parachain] 💻 Linux distribution: Ubuntu 22.04.1 LTS 2023-07-20 15:29:38 [Parachain] 💻 Virtual machine: no 2023-07-20 15:29:38 [Parachain] 📦 Highest known block at #0 2023-07-20 15:29:38 [Parachain] 〽️ Prometheus exporter started at 127.0.0.1:9615 2023-07-20 15:29:38 [Parachain] Running JSON-RPC HTTP server: addr=0.0.0.0:9933, allowed origins=["*"] 2023-07-20 15:29:38 [Parachain] Running JSON-RPC WS server: addr=0.0.0.0:9944, allowed origins=["*"] 2023-07-20 15:29:38 [Parachain] 🏁 CPU score: 1.27 GiBs 2023-07-20 15:29:38 [Parachain] 🏁 Memory score: 14.10 GiBs 2023-07-20 15:29:38 [Parachain] 🏁 Disk score (seq. writes): 733.15 MiBs 2023-07-20 15:29:38 [Parachain] 🏁 Disk score (rand. writes): 315.71 MiBs 2023-07-20 15:29:38 [Parachain] discovered: 12D3KooWFAFRHRmM3ARmKYdjKr5jzgu9HGiYi2kPW2Nh1hosmdQN /ip4/192.168.31.52/tcp/30334/ws 2023-07-20 15:29:38 [Relaychain] discovered: 12D3KooWMNkSu3SFJSaSYkjTwzBU2CtCvsMrAwkFMWRoiSwDDrTe /ip4/192.168.31.52/tcp/30333/ws 2023-07-20 15:29:43 [Relaychain] 💤 Idle (0 peers), best: #0 (0x6408…063e), finalized #0 (0x6408…063e), ⬇ 0 ⬆ 0 2023-07-20 15:29:43 [Parachain] 💤 Idle (0 peers), best: #0 (0xb067…6b70), finalized #0 (0xb067…6b70), ⬇ 0 ⬆ 0 2023-07-20 15:29:48 [Relaychain] 💤 Idle (0 peers), best: #0 (0x6408…063e), finalized #0 (0x6408…063e), ⬇ 0 ⬆ 0