# \[ARCHIVE] Mainnet Setup

{% hint style="info" %}
**Currently on MAINNET**
{% endhint %}

We have our pre-built binaries in form of container images hosted on docker hub. The following is a quick start guide on running the same for a node operator who is interested to setup a diligence watchtower on the **Ethereum Mainnet chain**

## Stages of Mainnet

| Stage 1 | <ul><li>Operator Whitelisting</li><li>Operator Registration on L1</li><li>Start with Operator Watchtower Client Setup              </li></ul> | From Apr 11 onwards                             |
| ------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
| Stage 2 | <ul><li>Operator Proof Submissions</li></ul>                                                                                                  | Tentative date : 2 weeks from Stage 1           |
| Stage 3 | <ul><li>Aggregator Settlement</li></ul>                                                                                                       | Tentative date : 1 week from Stage 2 completion |

## Prerequisites

* Read the [Node Requirements](https://docs.witnesschain.com/archive/for-the-node-operators/node-requirements), if you haven't
* Access
  * Watchtower Node Operator should be a registered EigenLayer Node Operator.&#x20;
    * [Formal guide to register](https://docs.eigenlayer.xyz/operator-guides/operator-introduction)
  * Registered [EL Operator ](https://docs.eigenlayer.xyz/operator-guides/operator-introduction)needs to be whitelisted on Witness Chain Network. Whitelisting will be done with the help of the Witness Chain team through a whitelisting process.  If you are not sure how, [Steps for setup](#steps-for-setup) will guide you through it.&#x20;
* Software
  * Docker client, engine and container runtime installed (version 23.0.0 or above, refer: <https://docs.docker.com/desktop/install/linux-install/>)
* Hardware
  * Hardware requirements for the watchtower node can accessed [here](https://docs.witnesschain.com/archive/for-the-node-operators/node-requirements)
  * One of the node configurations as described in the [Node Types](#node-types) section below. Don't worry about how to configure right now ! As long as you have access to one of the configurations, we are good. We have you covered in the [Steps for setup](#steps-for-setup) section !

## Node Types

The node operator is expected to deploy the watchtower container alongside both L1 and L2 Archived nodes in the ideal scenario. But, we offer a few more configurations if you would like to re-use some of your existing infrastructure or setup. The configuration parameters for the L1 and L2 Archived nodes may belong to one of the following distinct categories.

| Configuration Type                                                                                                                                    | L1 Node                           | L2 Node                                                            |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | ------------------------------------------------------------------ |
| [Light](https://docs.witnesschain.com/archive/for-the-node-operators/holesky-setup/l2-archive-node-setup-guide#light-configuration-for-l2-node-setup) | Use a Hosted L1 Node RPC Provider | Use Witness Chain provided L2 Node snapshot  to bootstrap the node |
| Medium                                                                                                                                                | Use a Hosted L1 Node RPC Provider | Run an L2 Archive Node synced from a public checkpoint             |
| Full                                                                                                                                                  | Run an L1 full Node               | Run an L2 Archive Node synced from a public checkpoint             |

## Steps for setup

{% hint style="danger" %}
**Note:** Make sure there aren't any older version of watchtower images or containers. Use the below command to remove older/stale images

`docker rm <stale_container_id>`

`docker rmi -f <stale_image_name>`
{% endhint %}

### **Step 1: Register with EigenLayer as an Operator**&#x20;

{% hint style="info" %}
ONLY If you aren't yet an EigenLayer Operator yet, HOW TO can be found [here](https://docs.eigenlayer.xyz/operator-guides/operator-introduction)
{% endhint %}

### **Step 2: Get whitelisted on the Watchtower Network**.&#x20;

The Witness Chain watchtower network is a permissioned network currently.  Please connect with us on our [Discord](https://discord.gg/7hRNBDeY5e), if you want to become a watchtower operator

### Step 3: Register the operator on the Witness Chain Watchtower Network&#x20;

{% hint style="info" %}
Before you start any activity on this network, ensure your operator address is sufficiently funded to cover the gas costs for registration
{% endhint %}

Register your EL operator address on the  WitnessChain **OperatorRegistry** contract. You can do so with the help of our CLI utility.&#x20;

#### Prerequisites

The CLI tool expects Ubuntu 22.04 (if you are running on linux) or if you are running on Ubuntu 20.04, ensure the glibc version is 2.34+&#x20;

```bash
# Run ldd --version to get the GLIBC version
ldd --version
```

#### Step 3.1 : Installation and Running the CLI

1. Installation:

   ```bash
   curl -sSfL https://witnesschain-com.github.io/install-operator-cli | bash
   ```

2. Running:

   <pre class="language-bash"><code class="lang-bash"><strong>export PATH="$PATH:~/.witnesschain/cli/"
   </strong>watchtower-operator --version

   Expected VERSION:
      v0.3.0 and higher
   </code></pre>

{% hint style="warning" %}
If you are facing the following error, please upgrade to Ubuntu 22.04

$ watchtower-operator --version

watchtower-operator: /lib/x86\_64-linux-gnu/libc.so.6: version \`GLIBC\_2.32' not found (required by watchtower-operator)

watchtower-operator: /lib/x86\_64-linux-gnu/libc.so.6: version \`GLIBC\_2.34' not found (required by watchtower-operator)
{% endhint %}

#### Step 3.2 : Registering the operator and the watchtowers on Ethereum Mainnet (L1)

Once you've ensured the tool is installed correctly, run the below commands to register the operator with our AVS and associate the watchtowers to the operator.

{% hint style="info" %}
**Note:** Refer to our [FAQs](https://docs.witnesschain.com/proof-of-diligence-watchtower-protocol/faqs#how-is-a-watchtower-address-different-from-operator-address) to understand the difference between watchtower addresses and operator addresses
{% endhint %}

**Setup the configuration files for the OPERATOR CLI**

#### operator-config.json

```
# Set of watchtower private keys that will sign the Diligence Proofs. 
# This is used for registration purposes
# Registration will happen both on L1 and L2 simultaneously
```

```json
{
  "watchtower_private_keys": [
    "<raw-watchtower-private-key e.g. 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef>"
  ],
  "operator_private_key": "<raw-watchtower-private-key e.g. 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef>",
  "eth_rpc_url": "https://eth.llamarpc.com", 
  "proof_submission_rpc_url": "https://rpc.witnesschain.com"
}
```

{% hint style="danger" %}

<pre><code>If your operator address is already registered on L1, set

<strong>"eth_rpc_url": ""
</strong>
This will register the Operator EoA only on L2.
</code></pre>

{% endhint %}

```sh
# Registers the Operator to WitnessHub AVS on EigenLayer 
# This is required for the Operator to be listed on EigenLayer's App

# Witnesschain Txns can be monitored via Blockscout at 

# Feel free to skip if this step is already carried out

$ watchtower-operator registerOperatorToAVS --config-file <path to L1 config file>
```

```bash
# Registers the Operator's watchtower to WitnessHub AVS on Layer 1
# This registration is required for operators to be associated with the 
# points awarded as a result of diligently watching the chains.
# To understand what are watchtowers, please read the FAQs

watchtower-operator registerWatchtower --config-file <path to L1 config file>
```

### Step 4: Submitting the bounties

1. Post the registrations are complet&#x65;**, install the watchtower client**, by running the following command.

```sh
curl https://witnesschain-com.github.io/install-watchtower | sh
```

The above command will guide you through the rest of installation process.
