Below is the step-by-step installation of the node with comments in English:
git clone https://github.com/Layer-Edge/light-node.git
cd light-node
Comment: First, clone the repository containing the node's source code. Then navigate to the
light-node
directory to proceed with the setup.
Ensure the following dependencies are installed:
Go: Version 1.18 or higher
Comment: Go is used to build and run the node. Check the version using the command
go version
.
Rust: Version 1.81.0 or higher
Comment: Rust is required for working with the Risc0 Toolchain. Check the version using the command
rustc --version
.
Risc0 Toolchain: If not installed, run:
curl -L https://risczero.com/install | bash && rzup install
Comment: This utility is used for working with Zero-Knowledge Proofs (ZK Proofs).
LayerEdge gRPC Endpoint: Ensure you have access to a LayerEdge node for communication via gRPC.
Create a .env
file in the root directory of the project and add the following variables:
GRPC_URL=34.31.74.109:9090
CONTRACT_ADDR=cosmos1ufs3tlq4umljk0qfe8k5ya0x6hpavn897u2cnf9k0en9jr7qarqqt56709
ZK_PROVER_URL=http://127.0.0.1:3001
# Alternatively:
ZK_PROVER_URL=https://layeredge.mintair.xyz/
API_REQUEST_TIMEOUT=100
POINTS_API=https://light-node.layeredge.io
PRIVATE_KEY='cli-node-private-key'
Comment:
GRPC_URL
: The address of the LayerEdge gRPC server.
CONTRACT_ADDR
: The smart contract address in the Cosmos network.
ZK_PROVER_URL
: The URL of the service for generating ZK proofs.
API_REQUEST_TIMEOUT
: API request timeout.
POINTS_API
: URL for retrieving points data.
PRIVATE_KEY
: Your CLI node's private key.
Important: Ensure that
ZK_PROVER_URL
matches the address where the Merkle service is running.
Before running the Light Node, start the Merkle service:
cd risc0-merkle-service
cargo build && cargo run
Comment: This service handles Merkle trees. Wait for the service to fully initialize before proceeding to the next step.
In a new terminal, navigate to the root directory of the project and execute:
go build
./light-node
Comment:
The
go build
command compiles the node executable.
./light-node
starts the node. Ensure it is successfully connected to the Merkle service.
Use the following URL to fetch points:
https://light-node.layeredge.io/api/cli-node/points/{walletAddress}
Comment: Replace
{walletAddress}
with your CLI wallet address.
Navigate to dashboard.layeredge.io.
Connect your wallet.
Link your CLI node's public key to the wallet.
Important:
One CLI wallet can only be linked to one dashboard wallet.
Linking is mandatory, even if the CLI and dashboard wallets are identical.
The dashboard provides the following features:
Node status (Active/Inactive).
Points tracking and detailed analytics.
Logs and performance monitoring.
The node provides logs for:
Merkle tree discovery.
ZK proof generation and verification.
Data submission status.
Performance optimizations (e.g., tree sleep state).
Comment: Use the logs to diagnose issues.
Store keys, mnemonics, and AUTHKEY offline.
Configure a firewall and secure SSH connections.
Regularly update the node from official LayerEdge sources.
Issue: gRPC connection is inactive.Solution: Verify gRPC settings (GRPC_URL
).
Issue: Risc0 Prover service is not running.Solution: Restart the service and check the logs.
Issue: Incorrect wallet or signature configurations.Solution: Double-check the wallet address and environment variables.
Comment: For more precise diagnostics, use the node logs.
PS. HELP
Yes, you need to specify the Cosmos wallet address and private key for the Light Node to function correctly. Let's break this down in detail:
Why is it needed?
The wallet address is used for:
Identifying your node in the network.
Linking your CLI node to the Dashboard for status and points tracking.
Receiving rewards (if provided by the project).
Where to get the wallet address?
If you already have a Cosmos wallet (e.g., created via keplr
, cosmos-sdk
, or another tool), use its address.
If you don’t have a wallet, you can create one using the following command:
echo "your_mnemonic_phrase" | cosmos-cashd keys add <wallet_name> --recover
Comment: Replace
your_mnemonic_phrase
with your mnemonic phrase if you have one.
After creating the wallet, you will receive an address in the format cosmos1...
.
Why is it needed?
Where to get the private key?
If you created the wallet via keplr
or another tool, you can export the private key from that application.
If you created the wallet via the command line (e.g., cosmos-cashd
), you can retrieve the private key using:
cosmos-cashd keys export <wallet_name>
Comment: This command will output an encrypted private key. Decrypt it if necessary.
How to add the private key to .env
?
In the .env
file, locate the line:
PRIVATE_KEY='cli-node-private-key'
cli-node-private-key
with your actual private key.Security:
Never share your private key with anyone.
Store it in a secure location (e.g., offline).
If you are using a .env
file, ensure it is protected from unauthorized access.
Linking with Dashboard:
After launching the node, you can link it to the Dashboard using your wallet’s public address (cosmos1...
).
The private key is not required for the Dashboard but is essential for the node to operate.
.env
ConfigurationSuppose you have:
Wallet address: cosmos1abcde...
Private key: my_private_key_123...
Your .env
file will look like this:
GRPC_URL=34.31.74.109:9090
CONTRACT_ADDR=cosmos1ufs3tlq4umljk0qfe8k5ya0x6hpavn897u2cnf9k0en9jr7qarqqt56709
ZK_PROVER_URL=http://127.0.0.1:3001
API_REQUEST_TIMEOUT=100
POINTS_API=https://light-node.layeredge.io
PRIVATE_KEY='my_private_key_123...'
Ensure that you have correctly specified the wallet address and private key.
Start the Merkle service:
cd risc0-merkle-service
cargo build && cargo run
Start the node:
go build
./light-node
Check the logs to ensure the node is running correctly.
Now you are ready to launch and configure your LayerEdge node!