> For the complete documentation index, see [llms.txt](https://docs.minervachain.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.minervachain.org/run-a-node/join-mainnet.md). Agents can also search and read this documentation through its [MCP server](https://docs.minervachain.org/~gitbook/mcp).

# Join the mainnet

A Minerva node is `minerva-geth`, a CoreGeth fork. This page takes you from nothing to a synced, verified mainnet peer. Mining is a flag on top of this, covered in [Run a miner](https://docs.minervachain.org/run-a-node/run-a-miner.md).

## Network facts

|                       |                                                                                                                                                                  |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Chain id / network id | `77139`                                                                                                                                                          |
| Genesis               | `https://mainnet.minervachain.org/genesis.json`                                                                                                                  |
| Genesis hash          | `0xc6c1ed201cf79b13116217843a4711628f02d58bedfa4100a7fb3b4385f7dd07`                                                                                             |
| Bootnode 1            | `enode://d2c423002b5fe7564791948210966b521434010ccf7041d31df0205ffe4a31223895974f1778ede6e742bea0ab4cb7f25f8833e2c7da5bde0d35d2ee0240aa17@40.160.80.95:30303`    |
| Bootnode 2            | `enode://78cf6e41f4c046cdbfce7b339f1ed4cbb54ff30660323e323fa12f9717bcd865aa4c5619aea0368e904e7b83e858c71f491eb6e1b0a3282a80d4ae0fb9ff0bd0@148.113.222.230:30303` |
| Ports                 | TCP and UDP 30303 inbound for peers; RPC on 8545 stays local                                                                                                     |
| Hardware              | 2+ cores, 4 GB RAM, 50 GB SSD is ample today; the chain is young and full sync is fast                                                                           |

Both facts files are also in the network repository under `clients/minerva-node/config/minerva-mainnet/`.

## Option A: Docker (recommended)

Build the node image from source. The build is reproducible, so the binary inside hashes like a published release of the same commit.

```sh
git clone https://github.com/MinervaQuantum/minerva-network network
cd network
docker build -f infra/Dockerfile.node -t minerva/minerva-geth:local .
```

Fetch the genesis and check its hash before trusting it:

```sh
mkdir -p ~/minerva-mainnet && cd ~/minerva-mainnet
curl -fsSLO https://mainnet.minervachain.org/genesis.json
docker run --rm -v "$PWD/genesis.json:/genesis.json:ro" --entrypoint minerva-geth \
  minerva/minerva-geth:local genesis-hash /genesis.json
# 0xc6c1ed201cf79b13116217843a4711628f02d58bedfa4100a7fb3b4385f7dd07
```

Start the node. The entrypoint initialises the data directory, refuses to start if the genesis hash differs from the pinned one, and runs `minerva-geth` with the Minerva RPC namespaces:

```sh
docker run -d --name minerva-node --restart unless-stopped \
  -e MINERVA_NETWORK=minerva-mainnet \
  -e MINERVA_NETWORK_ID=77139 \
  -e MINERVA_GENESIS_HASH=0xc6c1ed201cf79b13116217843a4711628f02d58bedfa4100a7fb3b4385f7dd07 \
  -e MINERVA_BOOTNODES="enode://d2c423002b5fe7564791948210966b521434010ccf7041d31df0205ffe4a31223895974f1778ede6e742bea0ab4cb7f25f8833e2c7da5bde0d35d2ee0240aa17@40.160.80.95:30303,enode://78cf6e41f4c046cdbfce7b339f1ed4cbb54ff30660323e323fa12f9717bcd865aa4c5619aea0368e904e7b83e858c71f491eb6e1b0a3282a80d4ae0fb9ff0bd0@148.113.222.230:30303" \
  -e MINERVA_P2P_NAT="extip:YOUR.PUBLIC.IP" \
  -v "$PWD/genesis.json:/genesis.json:ro" \
  -v minerva-mainnet-data:/data \
  -p 30303:30303/tcp -p 30303:30303/udp \
  -p 127.0.0.1:8545:8545 \
  minerva/minerva-geth:local
```

Replace `YOUR.PUBLIC.IP` with the address peers can reach you on, or drop the `MINERVA_P2P_NAT` line to let discovery work it out behind NAT. Watch it come up:

```sh
docker logs -f minerva-node
```

You should see the genesis hash check pass, `init` write the genesis, then peer connections and imported blocks.

### Docker Compose

The repository ships the compose file the public hosts use. For a plain peer, the single `minerva-node` service is enough:

```yaml
# docker-compose.yml
services:
  minerva-node:
    image: minerva/minerva-geth:local
    restart: unless-stopped
    environment:
      MINERVA_NETWORK: minerva-mainnet
      MINERVA_NETWORK_ID: "77139"
      MINERVA_GENESIS_HASH: "0xc6c1ed201cf79b13116217843a4711628f02d58bedfa4100a7fb3b4385f7dd07"
      MINERVA_BOOTNODES: "enode://d2c423002b5fe7564791948210966b521434010ccf7041d31df0205ffe4a31223895974f1778ede6e742bea0ab4cb7f25f8833e2c7da5bde0d35d2ee0240aa17@40.160.80.95:30303,enode://78cf6e41f4c046cdbfce7b339f1ed4cbb54ff30660323e323fa12f9717bcd865aa4c5619aea0368e904e7b83e858c71f491eb6e1b0a3282a80d4ae0fb9ff0bd0@148.113.222.230:30303"
      MINERVA_P2P_NAT: "extip:YOUR.PUBLIC.IP"
    volumes:
      - ./genesis.json:/genesis.json:ro
      - minerva-mainnet-data:/data
    ports:
      - "30303:30303/tcp"
      - "30303:30303/udp"
      - "127.0.0.1:8545:8545"
volumes:
  minerva-mainnet-data: {}
```

```sh
docker compose up -d && docker compose logs -f minerva-node
```

Environment variables the entrypoint understands: `MINERVA_GCMODE` (`full` or `archive`), `MINERVA_HTTP_API` (default `eth,net,web3,minerva,txpool`), `MINERVA_MAX_PEERS`, `MINERVA_DISCOVERY` (`0` disables), `MINERVA_NODEKEY_CONTAINER_FILE` (a persistent node key), and the miner variables on the next page.

## Option B: bare metal

Build the binary (Go 1.22 is pinned by the build script):

```sh
git clone https://github.com/MinervaQuantum/minerva-network network
cd network
pnpm install
pnpm coregeth:build               # → build/bin/minerva-geth
sudo install -m 0755 build/bin/minerva-geth /usr/local/bin/minerva-geth
```

Initialise and start:

```sh
mkdir -p ~/minerva-mainnet && cd ~/minerva-mainnet
curl -fsSLO https://mainnet.minervachain.org/genesis.json
minerva-geth genesis-hash genesis.json      # must print 0xc6c1ed20…7dd07
minerva-geth --datadir ~/minerva-mainnet/data init genesis.json

minerva-geth \
  --datadir ~/minerva-mainnet/data \
  --networkid 77139 \
  --port 30303 \
  --syncmode full --gcmode full \
  --http --http.addr 127.0.0.1 --http.port 8545 \
  --http.api eth,net,web3,minerva,txpool \
  --authrpc.addr 127.0.0.1 --authrpc.port 8551 \
  --nat extip:YOUR.PUBLIC.IP \
  --bootnodes "enode://d2c423002b5fe7564791948210966b521434010ccf7041d31df0205ffe4a31223895974f1778ede6e742bea0ab4cb7f25f8833e2c7da5bde0d35d2ee0240aa17@40.160.80.95:30303,enode://78cf6e41f4c046cdbfce7b339f1ed4cbb54ff30660323e323fa12f9717bcd865aa4c5619aea0368e904e7b83e858c71f491eb6e1b0a3282a80d4ae0fb9ff0bd0@148.113.222.230:30303"
```

Add `--authrpc.port <free port>` if another node on the host already holds 8551. A systemd unit that runs this command with `Restart=always` is all the supervision it needs.

## Verify

Run the doctor. It checks identity, forks, system contracts, genesis hash, head, clock, peers and disk:

```sh
minerva-geth doctor --rpc http://127.0.0.1:8545 --network minerva-mainnet --genesis genesis.json
# in Docker:
docker exec minerva-node minerva-geth doctor --rpc http://127.0.0.1:8545 --network minerva-mainnet --genesis /genesis.json
```

Expected: every check passes; "no peers" as a warning only in the first minute. A future head is a clock problem on your machine; a foreign genesis means the wrong file.

Then compare with the public RPC:

```sh
# chain id
curl -s -X POST http://127.0.0.1:8545 -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'
# → {"jsonrpc":"2.0","id":1,"result":"0x12d53"}

# peers
curl -s -X POST http://127.0.0.1:8545 -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"net_peerCount","params":[]}'
# → "result":"0x2" or more

# same block hash as the public node for a recent block
for RPC in http://127.0.0.1:8545 https://mainnet.minervachain.org/rpc; do
  curl -s -X POST $RPC -H 'content-type: application/json' \
    -d '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockByNumber","params":["0x2000",false]}' \
    | jq -r .result.hash
done
# both lines identical
```

`eth_syncing` returns `false` once you are at the head. The whole process takes minutes today.

## Expose RPC safely

The node's RPC is bound to localhost on purpose. To serve it publicly, put nginx or Caddy in front with TLS and a per-IP rate limit, allow POST only, and never expose `--authrpc`. The public hosts' nginx configuration is in `infra/nginx/` in the network repository.

## What a node does not need

No keys. A Minerva node has no accounts, no keystore and no gas payer. The only secret on a node host is the optional devp2p node key that keeps your enode stable across restarts.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.minervachain.org/run-a-node/join-mainnet.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
