Run Local Validium Node
Setting Up a Validium on Lumia L2
This quick start guide will walk you through the process of setting up a CDK validium on your local machine for the Lumia L2 network. The setup includes the following components:
Lumia zkEVM databases:
data node, event, explorer L1 and L2, pool, state, and bridge service
Lumia zkEVM node components:
aggregator, approve service, sequencer and sequence sender, synchronizer
L1 network (mock)
Prover
Explorers L1, L2
JSON RPC explorer
L2 gas pricer
DAC:
data availability service, DAC setup committee
Lumia zkEVM bridge service and UI
Note: The documentation describes standard deployments. You can edit the configuration files to implement your own custom setups.
Prerequisites Hardware Requirements:
A Linux-based OS (e.g., Ubuntu Server 22.04 LTS)
At least 16GB RAM with a 4-core CPU
An AMD64 architecture system
Note: CDK does not support ARM-based Macs.
Software Requirements:
Go
Docker and Docker Compose
Note: This document uses Docker Compose v2.
Installing Make on Ubuntu:
Cloning the Repository:
Testnet and Mainnet zkNode Config files required can be downloaded using IPFS links below.
Testnet: ipfs://QmNMnawxoSo7N1xFB73Ygw571T3Cj67Rqg2edsUCNob9h3/lumia-testnet-node-config.zip
Mainnet: ipfs://QmfNFzWVJxiu9JHHAS7rFnnUVCvdVTfrtF6TtmVKkcf1xA/prism-mainnet-node-config.zip
Create the .env
file by copying the example:
.env
file by copying the example:Launching Validium Locally
Pull the required Docker images from Docker Hub:
Start your local CDK validium:
Check the status of each container:
You may see errors related to amd64
such as:
zkevm-prover no matching manifest for linux/arm64/v8 in the manifest list entries
make: *** [run] Error 18
If so, go to the docker-compose.yml,
search for the component details - in this case zkevm-prover
, and add the platform: linux/amd64
environment variable under the environment
variable (which you should also add if it is not there):
You may find the explorer components affected similarly.
If you receive any errors such as below, make sure your Docker has SUDO rights.
error getting credentials - err: exit status 1
You should see an output similar to the provided container status details.
If a service isn't running (i.e., it is in Exit1 state), investigate further using the logs:
Note: This local deployment runs on an L1 Geth instance.
Testing Validium
Verify the block explorer is running by navigating to localhost.
Add the network to a Web3 wallet (e.g., MetaMask) by following the instructions on how to set up a network manually.
Set the chain ID to 1001 and use "POL" as the currency symbol. The RPC node and block explorer containers can be found at ports 8123 and 80, respectively.
Switch to the new network in MetaMask.
Important: An account with test funds is available with the private key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
.
NEVER transfer real assets to the address associated with this private key.
Import the account to MetaMask. The balance should show up as 100000 POL
Transfer some tokens to another account and confirm the transaction. Check the updated balances.
View the transaction details in the block explorer by clicking on the transaction details in MetaMask.
Troubleshooting Stuck Transactions with MetaMask: If you encounter a stuck transaction, it is likely due to an incorrect nonce setting. To resolve this issue:
Open MetaMask and navigate to your account.
Click on Settings > Advanced.
Locate the option "Clear activity and nonce data" and click on it. This resets the nonce data associated with the account, which often resolves transaction-related issues.
Testing the Bridge
Lumia L2 has a native bridge portal with UI that allows you to transfer funds between the L1 and the L2 validium.
L1 to L2:
Add the L1 RPC to MetaMask and switch to the L1 network. You will see the previously imported account with ~999 POL on the L1 chain.
Verify the bridge UI by navigating to localhost:8088. Click on "Connect a wallet" > "MetaMask" and select the previously imported account.
Enter the amount to bridge (e.g., 5) and click "Continue". After confirming that you understand what you're doing, you will see the "Confirm Bridge" page.
Click "Bridge" and approve the transaction on the MetaMask pop-up. Once bridging is complete, you should see the "Activity" page.
L2 to L1:
Switch the network on MetaMask to your validium chain and navigate back to localhost:8088. You should see both the updated L1 and L2 balances.
Enter an amount and follow the same process to bridge the funds back to L1.
Note: You cannot bridge back funds more than what you have previously bridged from L1 to L2.
The L2->L1 bridging process is slightly different from L1->L2. After the transaction is executed, you will see the "Activity" page.
Click "Finalise" and approve the transaction. MetaMask will pop up a window asking you to switch to the L1 network first. Once the bridging is complete, you will see the confirmation page.
Last updated