Running a Node
This section teaches you how to run a Moca Chain Node.
⚠️ This section may change without prior notice
Critical information in this section may be subject to change given we are currently in private mainnet.
🔓 Public Repository
The Moca Chain source code is publicly available on GitHub: mocachain/moca.
Network Information
| Network | Chain ID | EVM Chain ID | RPC (Tendermint) |
|---|---|---|---|
| Mainnet | moca_2288-1 | 2288 | https://tm-rpc.mocachain.dev |
| Testnet | moca_222888-1 | 222888 | https://testnet-lcd.mocachain.org |
Mainnet Access
Mainnet RPC access requires an API key. Contact the Moca Chain team to obtain your key.
Node Information
Minimum System Requirements
| Component | Requirement |
|---|---|
| OS | Desktop or laptop running recent versions of Mac OS X or Linux |
| Storage | 1 TB free disk space, minimum read/write speed of 100 MB/s |
| CPU | 4 cores |
| Memory (RAM) | 12 GB |
| Network | Broadband connection, upload/download at least 1 MB/s |
Recommended System Requirements
| Component | Recommended Specification |
|---|---|
| Processor (CPU) | 16-core CPU |
| Memory (RAM) | 64 GB |
| Storage | 3 TB SSD |
| Network | Stable high-speed internet, minimum 5 MB/s |
Setting Up a New Node
Prerequisites
For Docker (Option A):
- Docker
- jq
For Manual Cosmovisor (Option B):
- Git
- Go 1.23+
- jq
- macOS or Linux
1. Clone the Repo (Option B only)
TIP
Skip this step if using the Docker image (Option A).
Clone the repository and checkout the latest stable version:
git clone https://github.com/mocachain/moca.git
cd moca
# checkout latest stable version
git checkout tags/v1.1.22. Install Cosmovisor
Cosmovisor is a process manager for Cosmos SDK nodes that automatically handles chain upgrades. It is the recommended way to run a Moca Chain node.
Option A: Official moca-cosmovisor Docker Image (Recommended)
The official Docker image is available on GitHub Container Registry. This image comes with the genesis binary preinstalled and runs mocad with Cosmovisor.
# Pull the latest image
docker pull ghcr.io/mocachain/mocad:v1.1.2
# For specific architecture
# linux/amd64
docker pull ghcr.io/mocachain/mocad:v1.1.2-amd64
# linux/arm64
docker pull ghcr.io/mocachain/mocad:v1.1.2-arm64Option B: Manual Cosmovisor Setup
If you prefer to run Cosmovisor manually without Docker, follow these steps.
Install Cosmovisor
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latestBuild or Download the Binary
You can either build from source or download pre-compiled binaries from GitHub Releases.
# Option 1: Build from source
make build
# Option 2: Download pre-compiled binary (Linux arm64)
wget https://github.com/mocachain/moca/releases/download/v1.1.2/mocad_linux_arm64.tar.gz
tar -xzf mocad_linux_arm64.tar.gz
chmod +x mocad
mv mocad ./build/mocadSetup Cosmovisor Directory Structure
mkdir -p ~/.mocad/cosmovisor/genesis/bin
cp ./build/mocad ~/.mocad/cosmovisor/genesis/bin/mocad3. Initialize Node
This will initialize your local moca node home directory ~/.mocad containing chain data configuration.
Using Docker (Option A)
docker run --rm -v ~/.mocad:/root/.mocad ghcr.io/mocachain/mocad:v1.1.2 \
mocad init mynode --chain-id moca_2288-1 --default-denom amocadocker run --rm -v ~/.mocad:/root/.mocad ghcr.io/mocachain/mocad:v1.1.2 \
mocad init mynode --chain-id moca_222888-1 --default-denom amocaUsing Manual Cosmovisor (Option B)
~/.mocad/cosmovisor/genesis/bin/mocad init mynode --chain-id moca_2288-1 --default-denom amoca~/.mocad/cosmovisor/genesis/bin/mocad init mynode --chain-id moca_222888-1 --default-denom amoca4. Pull Live genesis file
Fetch the genesis file for your target network.
RPC=https://tm-rpc.mocachain.dev
curl -s "$RPC/genesis?key=<YOUR_ACCESS_KEY>" | jq -r '.result.genesis' > ~/.mocad/config/genesis.jsonRPC=https://testnet-lcd.mocachain.org
curl -s "$RPC/genesis" | jq -r '.result.genesis' > ~/.mocad/config/genesis.json5. Add peers
Fetch and configure peers from the network:
PEERS=$(curl -s "$RPC/net_info" | jq -r '.result.peers[] | select(.node_info.id and .remote_ip) | "\(.node_info.id)@\(.remote_ip):26656"' | paste -sd, -)
# Update config with peers
[ -n "$PEERS" ] && \
sed -i '' 's/seeds = ".*"/seeds = ""/' ~/.mocad/config/config.toml && \
sed -i '' "s/persistent_peers = \".*\"/persistent_peers = \"$PEERS\"/" ~/.mocad/config/config.toml && \
sed -i '' 's/addr_book_strict = true/addr_book_strict = false/' ~/.mocad/config/config.tomlAlternatively you can provide your own list of peers.
6. Fast sync state
State sync quickly bootstraps your node by trusting a recent block header (light client verification) and downloading a snapshot of the application state at that height, instead of replaying all historical blocks.
# Get current height
HEIGHT=$(($(curl -s "$RPC/block" | jq -r '.result.block.header.height') - 1000))
HASH=$(curl -s "$RPC/block?height=$HEIGHT" | jq -r '.result.block_id.hash')
# Set trusted height and hash to sync from in your node configuration files
sed -i '' 's/^enable *= *.*/enable = true/' ~/.mocad/config/config.toml
sed -i '' "s|^rpc_servers *= *.*|rpc_servers = \"$RPC,$RPC\"|" ~/.mocad/config/config.toml
sed -i '' "s/^trust_height *= *.*/trust_height = $HEIGHT/" ~/.mocad/config/config.toml
sed -i '' "s/^trust_hash *= *.*/trust_hash = \"$HASH\"/" ~/.mocad/config/config.toml
sed -i '' 's/^trust_period *= *.*/trust_period = "168h0m0s"/' ~/.mocad/config/config.toml7. Run the node
Using Docker (Option A)
Run the Docker container with a mounted volume for persistent data:
docker run -d \
--name mocad \
-v ~/.mocad:/root/.mocad \
-p 26656:26656 \
-p 26657:26657 \
-p 1317:1317 \
-p 8545:8545 \
ghcr.io/mocachain/mocad:v1.1.2docker run -d \
--name mocad \
-v ~/.mocad:/root/.mocad \
-p 26656:26656 \
-p 26657:26657 \
-p 1317:1317 \
-p 8545:8545 \
ghcr.io/mocachain/mocad:v1.1.2Using Manual Cosmovisor (Option B)
export DAEMON_NAME=mocad
export DAEMON_HOME=$HOME/.mocad
cosmovisor run start --chain-id=moca_2288-1export DAEMON_NAME=mocad
export DAEMON_HOME=$HOME/.mocad
cosmovisor run start --chain-id=moca_222888-1The node will take some time to fully sync up to the current chain height.
Verify Syncing
You can verify if state sync is done by curl localhost:26657/status several times and see whether latest_block_height is increasing in response.
curl -s http://127.0.0.1:26657/status | jq -r ".result.sync_info.latest_block_height"
# Expect block height greater than 0