0G Labs
Step 3a: Preparations — Update Packages
To continue, we can update the packages by running the following commands in the terminal. The first part of the command updates the package lists for upgrades, and the second part actually performs the upgrades with the “-y” flag allowing for automatic confirmation of prompts during the upgrade process:
sudo apt update && sudo apt upgrade -y
Step 3b: Preparations — Install Build Tools
In this step, we’re preparing the system by installing essential build tools. Specifically, curl and git are used for downloading and managing code repositories, jq for processing JSON data, lz4 for compression and decompression, and build-essential for compiling software from source etc.
sudo apt install curl git wget htop tmux build-essential liblz4-tool jq make lz4 gcc unzip -y
Step 4: Install GO
Make sure you install the latest version of GO, whether it’s a fresh installation or an update:
ver="1.22.2" wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" sudo rm -rf /usr/local/go sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" rm "go$ver.linux-amd64.tar.gz" echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile source $HOME/.bash_profile
Step 5: Download And Build Binaries
To install the latest version of the 0G-evmosd project from 0G Labs, you’ll first need to download the project’s source code from GitHub and then compile it:
# Clone the project repository: cd $HOME git clone https://github.com/0glabs/0g-evmos.git cd 0g-evmos
Check the releases page to see if there is a newer version than v1.0.0-testnet. If there is, replace v1.0.0-testnet with the latest version in the following command:
# Checkout version: git checkout v1.0.0-testnet # Build the Binaries: make build
Step 6: Organize the Build for Deployment
Once you’ve built the binaries for the 0G-evmosd project, you’ll need to organize them for use with Cosmovisor, a process manager for Cosmos SDK applications:
# Create the directory structure: mkdir -p $HOME/.evmosd/cosmovisor/genesis/bin # Move the compiled evmosd binary into the directory: mv build/evmosd $HOME/.evmosd/cosmovisor/genesis/bin/ # After moving the binary, clean up the build directory: rm -rf build
These steps ensure that your0G-evmosd binary is properly stored and managed for easy upgrades and maintenance using Cosmovisor. This setup helps in simplifying the update process and keeping your node operational with minimal downtime.
Step 7: Set Up Symbolic Links for Easy Access
To ensure the 0G-evmosd binary is easily accessible and managed effectively with Cosmovisor, we will create symlinks. These links will help in switching versions and managing the binary execution paths more efficiently:
# Link the Genesis to Current Directory: sudo ln -s $HOME/.evmosd/cosmovisor/genesis $HOME/.evmosd/cosmovisor/current -f # Link the Binary to System Path sudo ln -s $HOME/.evmosd/cosmovisor/current/bin/evmosd /usr/local/bin/evmosd -f
Step 8: Install Cosmovisor
Cosmovisor is a important tool for managing updates and processes for Cosmos SDK applications like 0G-evmosd. It ensures seamless upgrades by automatically restarting the application with the new version without manual intervention:
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest
Step 9: Configure System Service for 0G-evmosd
To ensure that your0G-evmosd node runs as a resilient and automatically restarting service, it's effective to configure it using systemd, a system and service manager for Linux operating systems. This setup allows the 0G-evmosd node to start at boot and keep running even if it encounters errors:
sudo tee /etc/systemd/system/evmosd.service > /dev/null << EOF [Unit] Description=evmosd node service After=network-online.target [Service] User=$USER ExecStart=$(which cosmovisor) run start Restart=on-failure RestartSec=10 LimitNOFILE=65535 Environment="DAEMON_HOME=$HOME/.evmosd" Environment="DAEMON_NAME=evmosd" Environment="UNSAFE_SKIP_BACKUP=true" Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:$HOME/.evmosd/cosmovisor/current/bin" [Install] WantedBy=multi-user.target EOF
To finalize the setup and ensure your0G-evmosd node service is operational and configured to start automatically when your system boots, follow these steps:
sudo systemctl daemon-reload sudo systemctl enable evmosd.service
Step 10: Configuring Your Node
To configure your node for operation, you’ll need to set several parameters. This involves specifying the chain ID, keyring backend, and the node endpoint. These commands are important for properly configuring your node to interact with the network, manage keys securely, and communicate with other nodes effectively:
# Set the chain ID: evmosd config chain-id zgtendermint_9000-1 # Configure the keyring backend: evmosd config keyring-backend os # Set the node endpoint: evmosd config node tcp://localhost:16457
Step 11: Initializing Your Node
To start setting up your node, we need to initialize it with a specific node name and chain ID. Before running the command, decide on a unique name for your node. This name will identify your node within the network. Replace YOUR_NODE_NAME with the actual name you’ve chosen for your node:
evmosd init YOUR_NODE_NAME --chain-id zgtendermint_9000-1
This command sets up the basic configuration for your node, including generating the necessary directories and files for operation. The --chain-id parameter ensures that your node is set up to connect to the specific blockchain network identified as zgtendermint_9000-1.
Step 12: Downloading and Setting Up the Genesis File
The genesis file is a fundamental component of any blockchain network. It contains the initial configuration and state of the blockchain. For your node to correctly join and sync with the specified network, we need to download and place the genesis file in the correct directory:
curl -Ls https://github.com/0glabs/0g-evmos/releases/download/v1.0.0-testnet/genesis.json > $HOME/.evmosd/config/genesis.json
After downloading the genesis file, it’s good practice to check that the file is not corrupted and is correctly placed. If the genesis file has been downloaded correctly and is complete, you can exit the text editor by pressing CTRL + X:
nano $HOME/.evmosd/config/genesis.json
Step 13: Configuring Network Peers and Ports
To fully integrate your node into the network and configure it for proper communication, we’ll need to update its configuration with the correct peers, seeds, and port numbers:
- Set Peers and Seeds: To ensure your node can connect to and communicate with other nodes in the network, we’ll update the
config.tomlfile with the appropriate peer and seed information. Peers are nodes that your node will directly connect to for information and syncing. Seeds are special peers that provide information about other peers in the network to help your node find and connect to active peers.
PEERS="1248487ea585730cdf5d3c32e0c2a43ad0cda973@peer-zero-gravity-testnet.trusted-point.com:26326" SEEDS="8c01665f88896bca44e8902a30e4278bed08033f@54.241.167.190:26656,b288e8b37f4b0dbd9a03e8ce926cd9c801aacf27@54.176.175.48:26656,8e20e8e88d504e67c7a3a58c2ea31d965aa2a890@54.193.250.204:26656,e50ac888b35175bfd4f999697bdeb5b7b52bfc06@54.215.187.94:26656" sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.evmosd/config/config.toml
- Update Gas Prices: It’s essential to set the minimum gas prices to prioritize transactions during high network activity. Update this in the
app.tomlfile:
sed -i "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.00252aevmos\"/" $HOME/.evmosd/config/app.toml
- Modify Network Port Configurations: To customize or avoid port conflicts, you might need to change the default port settings in both
config.tomlandapp.toml. This includes ports for various services such as the RPC server, P2P layer, and Prometheus for monitoring:
sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:16458\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:16457\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:16460\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:16456\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":16466\"%" $HOME/.evmosd/config/config.toml sed -i -e "s%^address = \"tcp://localhost:1317\"%address = \"tcp://0.0.0.0:16417\"%; s%^address = \":8080\"%address = \":16480\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:16490\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:16491\"%; s%:8545%:16445%; s%:8546%:16446%; s%:6065%:16465%" $HOME/.evmosd/config/app.toml
Step 14: Backing up Important Data And Installing Necessary Tools
Before making changes like a reset, it’s important to backup the validator state. This file contains the state of your node’s validator at the last block it signed:
# Stop sevrice: systemctl stop evmosd # Backup validator state: cp $HOME/.evmosd/data/priv_validator_state.json $HOME/.evmosd/priv_validator_state.json.backup # Clear all blockchain data except address book: evmosd tendermint unsafe-reset-all --home $HOME/.evmosd --keep-addr-book
Download the latest blockchain state from a snapshot to quickly sync your node up to a recent block. This command streams a compressed snapshot file and extracts it directly into your .evmosd directory:
curl -L http://37.120.189.81/0g_testnet/0g_snap.tar.lz4 | tar -I lz4 -xf - -C $HOME/.evmosd
After the snapshot is extracted and your node data is essentially reset, restore your original validator state to avoid any potential issues with block signing:
mv $HOME/.evmosd/priv_validator_state.json.backup $HOME/.evmosd/data/priv_validator_state.json
To make sure that your service is updated with any configuration changes and is running smoothly, follow these steps:
sudo systemctl daemon-reload sudo systemctl restart evmosd
Many thanks to the Core Node Team for providing this snapshot. Their support has significantly reduced our setup time. Check them out on Twitter.
Step 15: Check The System Logs
To monitor the real-time logs of your service, you can use the journalctl command. This tool is part of the systemd suite and provides a powerful interface for querying and displaying logs from systemd and the services it manages, which is useful for troubleshooting and ensuring that your node is operating as expected:
sudo journalctl -u evmosd.service -f --no-hostname -o cat
Step 16: Creating a Wallet on Your Node
To create a new wallet on your node, you will need to use the following command. Replace YOUR_WALLET_NAME with your chosen wallet name in the command below. Decide on a name for your new wallet. For this example, I suggest using “wallet” as the name to keep things straightforward:
evmosd keys add YOUR_WALLET_NAME
This command generates a new wallet including a public/private key pair and gives you access to the associated address on the blockchain network.

After you define a keyring passphrase, make sure to securely store the output, especially your mnemonic phrase, as it is essential for recovering your wallet if needed:

To extract and convert your wallet address to the Ethereum hex format, you can use a combination of evmosd commands and shell utilities. If your wallet name is "wallet", here’s how you should format your command:
echo "0x$(evmosd debug addr $(evmosd keys show wallet -a) | grep hex | awk '{print $3}')"
To export your wallet’s Ethereum-compatible private key from the node, you’ll need to use the unsafe-export-eth-key command. This command extracts the Ethereum private key from your Evmos wallet in an unencrypted format. Make sure you handle and store any output securely:
evmosd keys unsafe-export-eth-key wallet
Step 17: Request Testnet Token
To obtain testnet tokens, access the Faucet Page. Now, input your wallet address in the Ethereum hex format that you prepared earlier and complete the captcha. Next, click on the “Request A0GI Token” button to initiate the token transfer.

Once the transaction is processed, you should see a “Transaction Successful” message indicating that the tokens have been transferred to your wallet:

Step 18: Create Your Validator
Check the Sync Status: To verify if your node has completed syncing with the blockchain, use this command:
evmosd status | jq
When catching_up is false, your node is fully synced and ready for the next steps. This indicates that your node is up-to-date with the latest blockchain state and can participate in the network. The output will look like this:

Before you proceed with creating your validator, make sure that you have received the testnet tokens in your account. You can check your wallet’s balance by using the following command:
evmosd q bank balances $(evmosd keys show wallet -a)
Expected output:

Now you’re set to run the create-validator command. Make sure to replace YOUR_MONIKER with your node’s name. If you have a website, replace YOUR_WEBSITE with its URL; if not, you can leave it empty. Then, replace YOUR_DETAILS with information about yourself as a node operator:
evmosd tx staking create-validator \ --amount=10000000000000000aevmos \ --pubkey=$(evmosd tendermint show-validator) \ --moniker=YOUR_MONIKER \ --chain-id=zgtendermint_9000-1 \ --commission-rate=0.05 \ --commission-max-rate=0.10 \ --commission-max-change-rate=0.01 \ --min-self-delegation=1 \ --from=wallet \ --website="YOUR_WEBSITE" \ --details="YOUR_DETAILS" \ --gas=500000 \ --gas-prices=99999aevmos \ -y
Expected output:

To delegate tokens to your node, use the command provided below. As of this writing, you must delegate a minimum of 1 aevmos to rank within the top 500. Your ranking is determined by the amount of aevmos you delegate.
evmosd tx staking delegate $(evmosd keys show wallet --bech val -a) 10000000000000000aevmos --from wallet --gas=500000 --gas-prices=99999aevmos -y
To check your validator status you can run this command, which will also display your operator address:
evmosd q staking validator $(evmosd keys show wallet --bech val -a)
Next, navigate to the ⚡┃node-status channel on the 0G Discord server and type !val followed by your operator address. For example:
!val evmosvaloper18d0wu8ks4ftwuadf1tr9vakxs4karr9vhqugqy
You should see an output similar to the example below. Please be aware that as of this writing, you need to delegate a minimum of 1 aevmos for your status to change to “active”:

Step 19: Import Your Wallet to Metamask and Upload a file
Next, import your wallet into Metamask by using the private key you exported earlier in Step 16. For detailed guidance on importing an account into Metamask, you can read the instructions here. Then, visit the 0G scan and connect your wallet. Ensure you add and switch to the 0G Chain Testnet.
For the following step, click on the “Add or drop files here” button, choose any image(s) you’d like to upload, and then click the “Upload” button. Confirm the transaction to proceed.

If the transaction is successful, your storage submissions will appear in the list below:

Step 20: Join 0G Discord Server and Get Roles
In the last step, join the 0G Discord server and obtain the @Node operators, @Developer, and @Testnet Validator roles. You can do this by going to the roles channel and clicking on the corresponding emojis to claim these roles:
