# Base (https://docs.axelar.dev/infrastructure/chain-nodes/base)



<Callout title="Consensus chain">
  This chain is verified by Axelar validators. Before setting up this node,
  [set up your Axelar validator](https://docs.axelar.dev/llms.mdx/infrastructure/validators/content.md).
  Once the node is running, connect it to `vald` as described in [Verify consensus
  chains](https://docs.axelar.dev/llms.mdx/infrastructure/verifiers/consensus-chains/content.md).
</Callout>

<Callout type="warn" title="Check the official documentation">
  The node setup steps below follow Base's own documentation at the time of
  writing and may be out of date. Check the [official
  documentation](https://github.com/base-org/node) before you start. The Axelar-specific steps (connecting
  the node to `vald` or `ampd`) are maintained here.
</Callout>

Instructions to set up your base node.

## Requirements [#requirements]

* [Setup your Axelar validator](https://docs.axelar.dev/llms.mdx/infrastructure/validators/content.md)
* Minimum hardware requirements: 8 AWS vCPU+, 8GB RAM, 512GB of SSD free storage space.
* MacOS or Ubuntu 22.04 (tested on 22.04)
* [Official Documentation](https://github.com/base-org/node)

## Prerequisites [#prerequisites]

* [Common Docker Compose Commands](https://docs.axelar.dev/llms.mdx/infrastructure/chain-nodes/optimism/content.md#common-node-operations)

```bash
sudo apt-get install jq -y
snap install docker
```

## Clone Repo [#clone-repo]

```bash
git clone https://github.com/base-org/node base-node
cd base-node
```

## Set node config [#set-node-config]

In docker-compose.yml, uncomment the right .env file according to the network you want to run it on

<Tabs items="[&#x22;Mainnet&#x22;,&#x22;Testnet&#x22;]">
  <Tab value="Mainnet">
    ```bash
    env_file:
    # select your network here:
    #      - .env.sepolia
          - .env.mainnet
    ```
  </Tab>

  <Tab value="Testnet">
    ```bash
    env_file:
    # select your network here:
          - .env.sepolia
    #      - .env.mainnet
    ```
  </Tab>
</Tabs>

Set the following config options in `base-node/.env.sepolia` or `base-node/.env`:

```bash
# [recommended] replace with your preferred L1 (Ethereum, not Base) node RPC URL:
OP_NODE_L1_ETH_RPC=https://rpc.sepolia.org

# [required] replace with your preferred L1 CL beacon endpoint:
OP_NODE_L1_BEACON=https://your.sepolia.beacon.node/endpoint-here
```

You can setup a beacon endpoint using the instructions [here](https://docs.axelar.dev/llms.mdx/infrastructure/chain-nodes/ethereum/content.md#install-a-consensus-layer-client), make sure to expose the endpoint to public
In lighthouse this needs passing of `--http-address 0.0.0.0` while starting the service

## Start the node [#start-the-node]

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

This should show an output like this:

```bash
[+] Running 3/3
 ✔ Network base-node_default   Created                                                                                                                       0.1s
 ✔ Container base-node-geth-1  Started                                                                                                                       0.4s
 ✔ Container base-node-node-1  Started                                                                                                                       0.8s                                                                                                       11.2s
```

After it is done, verify by listing the services and their status

```bash
docker compose ps
```

You should see these 2 services running

```bash
NAME                          IMAGE                                                                                                 COMMAND             SERVICE             CREATED             STATUS                    PORTS
NAME                IMAGE               COMMAND                  SERVICE             CREATED             STATUS              PORTS
base-node-geth-1    base-node-geth      "bash ./geth-entrypo…"   geth                16 seconds ago      Up 15 seconds       0.0.0.0:7308->6060/tcp, :::7308->6060/tcp, 0.0.0.0:8525->8545/tcp, :::8525->8545/tcp, 0.0.0.0:8526->8546/tcp, :::8526->8546/tcp, 0.0.0.0:30308->30303/tcp, 0.0.0.0:30308->30303/udp, :::30308->30303/tcp, :::30308->30303/udp
base-node-node-1    base-node-node      "bash ./op-node-entr…"   node                16 seconds ago      Up 15 seconds       0.0.0.0:6062->6060/tcp, :::6062->6060/tcp, 0.0.0.0:7320->7300/tcp, :::7320->7300/tcp, 0.0.0.0:7445->8545/tcp, :::7445->8545/tcp, 0.0.0.0:9242->9222/tcp, 0.0.0.0:9242->9222/udp, :::9242->9222/tcp, :::9242->9222/udp
```

## Check logs [#check-logs]

#### Verify OP geth logs [#verify-op-geth-logs]

```bash
docker compose  logs geth --since 20m -f
```

```bash
base-node-geth-1  | INFO [03-18|07:28:01.409] HTTP server started                      endpoint=[::]:8545 auth=false prefix= cors=* vhosts=*
base-node-geth-1  | INFO [03-18|07:28:01.409] WebSocket enabled                        url=ws://[::]:8546
base-node-geth-1  | INFO [03-18|07:28:01.409] WebSocket enabled                        url=ws://[::]:8551
base-node-geth-1  | INFO [03-18|07:28:01.409] HTTP server started                      endpoint=[::]:8551 auth=true  prefix= cors=localhost vhosts=*
base-node-geth-1  | INFO [03-18|07:28:11.610] Looking for peers                        peercount=0 tried=156 static=0
base-node-geth-1  | INFO [03-18|07:28:21.725] Looking for peers                        peercount=0 tried=122 static=0
base-node-geth-1  | INFO [03-18|11:32:45.773] Forkchoice requested sync to new head    number=11,986,109 hash=085c5c..61c7ca
base-node-geth-1  | INFO [03-18|11:32:47.466] Forkchoice requested sync to new head    number=11,986,110 hash=2f176f..8f3656
base-node-geth-1  | INFO [03-18|11:32:49.476] Forkchoice requested sync to new head    number=11,986,111 hash=e247cf..08c3fb
base-node-geth-1  | INFO [03-18|11:32:51.280] Forkchoice requested sync to new head    number=11,986,112 hash=b6c25a..b7a064
```

#### Verify OP node logs [#verify-op-node-logs]

```bash
docker compose  logs node --since 20m -f
```

You should see logs like

```bash
base-node-node-1  | t=2024-03-18T11:32:40+0000 lvl=info msg="Starting JSON-RPC server"
base-node-node-1  | t=2024-03-18T11:32:40+0000 lvl=info msg="started metrics server" addr=[::]:7300
base-node-node-1  | t=2024-03-18T11:32:40+0000 lvl=info msg="Starting execution engine driver"
base-node-node-1  | t=2024-03-18T11:32:40+0000 lvl=info msg="Starting driver" sequencerEnabled=false sequencerStopped=false
base-node-node-1  | t=2024-03-18T11:32:40+0000 lvl=info msg="Rollup node started"
base-node-node-1  | t=2024-03-18T11:32:40+0000 lvl=info msg="State loop started"
base-node-node-1  | t=2024-03-18T11:50:47+0000 lvl=info msg="Sync progress" reason="unsafe payload from sequencer while in EL sync" l2_finalized=0x0000000000000000000000000000000000000000000000000000000000000000:0 l2_safe=0x0000000000000000000000000000000000000000000000000000000000000000:0 l2_pending_safe=0x0000000000000000000000000000000000000000000000000000000000000000:0 l2_unsafe=0x6e8ea627774bbe62255b23938ea2639c251e5199cadc7eaee58412193423acfc:11986117 l2_time=1710761581 l1_derived=0x0000000000000000000000000000000000000000000000000000000000000000:0
base-node-node-1  | t=2024-03-18T11:50:49+0000 lvl=info msg="Received signed execution payload from p2p" id=0x17e27490a5845c45d656d2a464a0c9aa1c764cc286d96bc2d17a108e2cbe2737:11986651 peer=16Uiu2HAm5zCUPtJdtbGF7XLQ8fsmsgWP9656wmMTSnnp5FoDdxDD
base-node-node-1  | t=2024-03-18T11:50:49+0000 lvl=info msg="Optimistically inserting unsafe L2 execution payload to drive EL sync" id=0x17e27490a5845c45d656d2a464a0c9aa1c764cc286d96bc2d17a108e2cbe2737:11986651
```

## Verify node sync status [#verify-node-sync-status]

### RPC Endpoint [#rpc-endpoint]

```bash
echo "$(curl -4 ifconfig.co):8545"
```

#### Method: [#method]

Check your op node status at port 7545 by

```bash
curl -X POST -H "Content-Type: application/json" --data     '{"jsonrpc":"2.0","method":"optimism_syncStatus","params":[],"id":1}' [rpc] | jq
```

If you get something like this in response to the above rpc call, your node is setup correctly

```bash
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "current_l1": {
      "hash": "0x24f7d66e8c80d0c6a598e9206ba1abc81264c1cc68afc14d8eca3f04fa81f921",
      "number": 323360,
      "parentHash": "0x99ce84a2d455425f0c3a68b2b83a74301810fc8c726cba384b08d9a79d9381d1",
      "timestamp": 1700059308
    },
..........
..........
    "engine_sync_target": {
      "hash": "0x7b7ed381aac9cec2a43b37c30779832cb8a82e044e38b4ada0f1c90719bd3d50",
      "number": 30955,
      "parentHash": "0x882503037e902b2476e1d4c308a895cc3b936c5ee19b45361dc26c9631d29ae0",
      "timestamp": 1700059286,
      "l1origin": {
        "hash": "0x49ee7a7398bc5010b48de111fc0ebc99d63d38ac8233202c913646d901e15213",
        "number": 323353
      },
      "sequenceNumber": 2
    }
  }
}
```

You can compare the block height on your node with explorer ([mainnet](https://basescan.org/) or [testnet](https://goerli.basescan.org/)),
use your RPC node only when it has caught up with the latest block height.

#### Sync Status of Base optimism Execution Node [#sync-status-of-base-optimism-execution-node]

You can check your status by connecting to geth console

```bash
docker exec -it  base-node-geth-1 geth attach http://localhost:8545
> eth.blockNumber
94078 # it will show you the latest block - number here is just an example

> eth.syncing
true
```

## Configure vald [#configure-vald]

In order for `vald` to connect to your Base node, your `rpc_addr` should be exposed in
vald's `config.toml`

<Tabs items="[&#x22;Mainnet&#x22;,&#x22;Testnet&#x22;]">
  <Tab value="Mainnet">
    ```bash [[axelar_bridge_evm]] name = "base" rpc_addr = "http://IP:PORT"
    start-with-bridge = true 
    ```
  </Tab>

  <Tab value="Testnet">
    ```bash [[axelar_bridge_evm]] name = "base" rpc_addr = "http://IP:PORT"
    start-with-bridge = true 
    ```
  </Tab>
</Tabs>


---

All pages of these docs, as Markdown: https://docs.axelar.dev/llms.txt