Skip to content

Commit

Permalink
feat: new node guide
Browse files Browse the repository at this point in the history
  • Loading branch information
0xPenryn committed Jan 9, 2025
1 parent 671c51f commit c094d3e
Showing 1 changed file with 67 additions and 54 deletions.
121 changes: 67 additions & 54 deletions src/pages/world-chain/reference/node-setup.mdx
Original file line number Diff line number Diff line change
@@ -1,73 +1,86 @@
# How to setup a World Chain node
# How to set up a World Chain node

Follow this guide to setup your own World Chain node.
Follow this guide to set up your own World Chain node.

## Overview

World Chain mainnet and testnet run on the OP Stack as part of the Superchain. Multiple docs are available for configuring and running nodes built from source and via Docker containers. Review the relevant documentation and select the approach that best meets your specific needs. For further information, please see the Optimism [node operator tutorials](https://docs.optimism.io/builders/node-operators/tutorials) and the [release images](https://docs.optimism.io/builders/node-operators/releases).
World Chain mainnet and testnet run on the OP Stack as part of the Superchain. We provide a simple Docker Compose configuration for running World Chain nodes, [simple-worldchain-node](https://github.com/worldcoin/simple-worldchain-node). If you're interested in building a node from source, see the [documentation from Optimism](https://docs.optimism.io/builders/node-operators/tutorials/node-from-souce).

## Running World Chain Mainnet
## Using `simple-worldchain-node`

The following configuration information will help you spin up a World Chain Mainnet node. You will need the [Genesis](https://github.com/worldcoin/world-id-docs/tree/main/public/code/world-chain/genesis.json) and [Rollup](https://github.com/worldcoin/world-id-docs/tree/main/public/code/world-chain/rollup.json) JSON files for World Chain mainnet.
`simple-worldchain-node` supports World Chain Mainnet and Sepolia, full nodes and archive nodes, and two execution clients: [op-geth](https://github.com/ethereum-optimism/op-geth) and [op-reth](https://github.com/paradigmxyz/reth).

The following is a sample set of flags for running both op-geth and op-node. Please note the hard fork activation heights.
### Installation

```bash {{ title: "op-geth"}}
# use the latest image according to OP docs
op-geth
--nodiscover
--maxpeers=0
--rollup.disabletxpoolgossip=true
--rollup.sequencerhttp=https://worldchain-mainnet-sequencer.g.alchemy.com
--override.fjord=1721826000
--override.granite=1727780400
--override.ecotone=0
--override.canyon=0
First, download [`simple-worldchain-node`](https://github.com/worldcoin/simple-worldchain-node) and create your `.env` file.

```bash {{ title: "Download simple-worldchain-node"}}
git clone https://github.com/worldcoin/simple-worldchain-node.git
cd simple-worldchain-node
cp .env.example .env
```

```bash {{ title: "op-node"}}
# use the latest image according to OP docs
op-node
--p2p.bootnodes=enode://dd4e44e87d68dd43bfc16d4fd5d9a6a2cd428986f75ddf15c8a72add0ad425852b9c36b6c5999ab7a37cc64d9bc1b68d549bc088dfa728e84dea7ae617f64e04@107.22.23.212:0?discport=30301,enode://47bd99d0bc393c6ca5569058b2d031067a3df5d05214036a5b88c9b817d52e08d7514d452b1aa623cfb3dd415136dcaf90c962e62d9337ff511fee0e9d1c8b28@18.207.96.148:0?discport=30301
--override.fjord=1721826000
--override.granite=1727780400
--override.ecotone=0
--override.canyon=0
Ensure you have installed Docker and Docker Compose by following [this guide](https://docs.docker.com/compose/install/#scenario-three-install-the-docker-compose-standalone).

### Configuration

Open your `.env` file in an editor of your choice. The following values must be configured before starting your node.

<Properties>
<Property name="NETWORK_NAME" type="worldchain-mainnet | worldchain-sepolia" required={true}>
Used to select which network the node connects to, either `worldchain-mainnet` or `worldchain-sepolia`.
</Property>
<Property name="COMPOSE_PROFILES" type="geth | reth" required={true}>
Used to select your execution client, either `geth` (default) or `reth` (experimental).
</Property>
<Property name="NODE_TYPE" type="full | archive" required={true}>
When using `op-geth`, determines which type of node to run. Either `full` (less storage, but only recent history) or `archive` (more storage, all history).
</Property>
<Property name="OP_NODE__RPC_ENDPOINT" type="URL" required={true}>
An L1 (Ethereum) RPC endpoint. We recommend using [Alchemy](https://www.alchemy.com/), but any Ethereum RPC provider or archive node will work.
</Property>
<Property name="OP_NODE__L1_BEACON" type="URL" required={true}>
An L1 Beacon Archive RPC endpoint. Note that this is not the same as a standard RPC endpoint, as this is used to retrieve Blobs from the Ethereum Beacon Chain. We recommend using [QuickNode](https://www.quicknode.com/).
</Property>
<Property name="OP_NODE__RPC_TYPE" type="string" required={true}>
Selects which RPC provider is set in `OP_NODE__RPC_ENDPOINT`. This allows for more efficient syncing given different RPC capabilities. Choose from `alchemy`, `quicknode`, `erigon`, or `basic` for other RPC providers.
</Property>
</Properties>

For details on optional settings, see the `simple-worldchain-node` [README](https://github.com/0xPenryn/simple-worldchain-node?tab=readme-ov-file#optional-configurations).

### Running your node

To start your node in the background, run the following command from the `simple-worldchain-node` folder:

```bash
docker compose up -d --build
```

## Running World Chain Sepolia
To view logs for your node, run the following command:

```bash
docker compose logs -f --tail 10
```

To shut down your node:
```bash
docker compose down
```

### Monitoring your node

The following configuration information will help you spin up a World Chain Sepolia node. You will need the [Genesis](https://github.com/worldcoin/world-id-docs/tree/main/public/code/world-chain-sepolia/testnet_genesis.json) and [Rollup](https://github.com/worldcoin/world-id-docs/tree/main/public/code/world-chain-sepolia/testnet_rollup.json) JSON files for World Chain Sepolia.
A Grafana dashboard is included to monitor your node. Access it by visiting [http://localhost:3000](http://localhost:3000) and logging in with these credentials:

```bash {{ title: "op-geth"}}
# use latest image according to OP docs
op-geth
--nodiscover
--maxpeers=0
--rollup.disabletxpoolgossip=true
--rollup.sequencerhttp=https://worldchain-mainnet-sequencer.g.alchemy.com
--override.fjord=1721826000
--override.granite=1727780400
--override.ecotone=0
--override.canyon=0
```
- Username: `admin`
- Password: `worldchain`

```bash {{ title: "op-node"}}
# use latest image according to OP docs
op-node
--p2p.bootnodes=enode://10b8de7f6a76c4fdadcf479c7ff16cbadefae98046287eb38a8759960714050d2892d98f31b060d1fd72b3fd584558699aa2caa238318bd7c471957e7e2652f0@3.91.92.199:0?discport=30301,enode://c939580fbd433bacaa947a2c89fd7af059f9da77c0b3c77e93d6688908745b1668a1393d353ade83e7fcf8c4cffa2021d20a700e0bc4318ea303062700d0abce@18.209.12.245:0?discport=30301
--override.fjord=1721739600
--override.granite=1726570800
--override.ecotone=0
--override.canyon=0
```
### Upgrading your Node

Sepolia-specific flags (use the correct activation heights): <br />
`fjord_activation_time: 1721739600`
`granite_activation_time: 1726570800`
When new versions of `op-geth`, `op-reth`, or `op-node` are released, we will update the `simple-worldchain-node` repository to use these new versions. You can then update your node to use these versions with the following commands:

Other considerations:
- Other activation times like ecotone_activation_time are 0.
- `op-geth` and `op-node` versions are the same as mainnet
```bash
git pull
docker compose pull
docker compose up -d --build
```

0 comments on commit c094d3e

Please sign in to comment.