# Setting Up an Arbitrum Full Node
In this post, I share my own journey of setting up and running an Arbitrum full node in December. This process requires setting up an Ethereum full node as a prerequisite. In order to interact between L1 and L2, we need to run an L2 node as well as an Ethereum full node. As a result, I also set up and run an Ethereum full node from scratch. The entire post consists of four parts:
- [Setup and run an Ethereum full node](#part-i-setup-and-run-an-ethereum-full-node)
- [Hardware](#hardware)
- [Software](#software)
- [OS Installation](#os-installation)
- [Ethereum Node Clients Installation](#ethereum-node-slients-installation)
- [Setup and run a Docker engine](#part-ii-setup-and-run-a-docker-engine)
- [Setup and run an Arbitrum node](#part-iii-setup-and-run-an-arbitrum-node)
- [Monitor the Ethereum node](#part-iv-monitor-the-ethereum-node)
I describe each part in detail below. Along the way, I also explain the relevant concepts by referencing official documents.
## PART I - Setup and Run an Ethereum Full Node
So, what does it mean to "run your own node"? In my view, the [official document](https://ethereum.org/en/run-a-node) describes it succintly:
> It is to run software with hardware while online.
The most important benefit of running your own node is to have full control over it. Yes, it takes time/effort, and costs money to set everything up but you will be happy with what you have access to at the end. First thing first, let's start with hardware.
### Hardware
Hardware requirements:
1. Desktop Computer
Spec requirements:
- *Processor:* 6667+ on cpubenchmark.net
- *RAM:* minimum of 16 GB, 32 GB is better.
- *SSD Storage:* At least 1TB
2. NUCs or Mini PCs
Spec requirements:
- *Processors:* 8th gen or higher Intel NUC
- *RAM:* 16 GB or 32 GB
- *SSD Storage:* 1TB-2TB SSD Drive
I decided to go with NUCs. This is just personal preference. You can totally choose any of those two options for hardware. Here is the list of what I got for hardware from [newegg](https://www.newegg.ca/):

The first step is to set up Intel NUC. I found this [video](https://www.youtube.com/watch?v=ZDADwYwzPAo) and [this one](https://www.intel.com/content/www/us/en/support/articles/000005522/intel-nuc.html) to be particularly useful. My background is not in computer science, so it was a trial and error process.
### Software
For someone who started from scratch on a new brand new machine, there are two aspects of software installation:
1. *Operating system:* Recommended to use Ubuntu Linux.
2. *Ethereum Node Software:* In order to run an ethereum full node, two different types of software need to be installed. One is execution client and the other one is consensus client. I will explain those in detail shortly.
### OS Installation
First step in OS installation is to download Ubuntu Desktop image [here](https://ubuntu.com/download/desktop). I downloaded Ubuntu 22.04.1 LTS.
I installed LTS Ubuntu following the instructions in the two links below.
https://ubuntu.com/tutorials/install-ubuntu-desktop#1-overview
https://ubuntu.com/download/intel-nuc-desktop
Step by step instructions are as follows:
>1. Dwonload Ubuntu desktop image.
>2. Download and install [balenaEcher](https://www.balena.io/etcher/) software for creating an installation media. Other options include [Rufus](https://ubuntu.com/tutorials/create-a-usb-stick-on-windows#1-overview) on Windows, Etcher on Mac OS and Startup Disk Creator on Ubuntu.
>3. Create a bootable USB stick using balenaEcher. This is not the same as simply copying Ubuntu ISO, That's why we need a third-party software balenaEcher.
>4. Insert the bootable USB flash drive from step 3 to the Intel NUC.
>5. Start the NUC and once you see "Intel NUC" on the screen, press F10 to enter the boot menu.
>6. Select the USB flash drive as a boot option. For this part, you can reference second half of [this video](https://www.youtube.com/watch?v=ZDADwYwzPAo).
>7. The rest is simply to follow instructions on the screen duting the installation process.
>8. Ubuntu is now installed. Use your account and password to log in.
### Ethereum Node Clients Installation
Next, we build a node that hosts three main components in two layers. Let's first talk about these two layers.
- *[Execution layer](https://ethereum.org/en/glossary/#execution-layer):* The execution layer handles transactions and execution. It is formerly as 'Eth1'. It is the network of execution clients (https://ethereum.org/en/glossary/#execution-client). Execution clients are tasked with processing and broadcasting transactions and managing Ethereum's states. They run computations for each transaction using the EVM to ensure that the rules of the protocol are followed. It is similar to someone who writes all those transactions on a sheet. When the sheet is full, someone needs to be selected to add this full sheet to a pile of sheets that have been written in the past. This is where consensus layer comes into play. Main Ethereum [excution clients](https://ethereum.org/en/developers/docs/nodes-and-clients/) are:
- Geth
- Nethermind
- Besu
- Erigon
- *[Consensus layer](https://ethereum.org/en/glossary/#consensus-layer):* The consensus layer handles [proof-of-stake](https://ethereum.org/en/developers/docs/consensus-mechanisms/) consensus tasks, formerly 'Eth2' or 'Ethereum 2.0'. It is the network of consensus clients. [Consensus clients](https://ethereum.org/en/glossary/#consensus-client) run Ethereum's proof-of-stake consensus algorithm allowing the network to reach agreement about the head of the beacon chain. Consensus clients do not participate in validating/broadcasting transactions or executing state transitions. [Main consensus clients](https://ethereum.org/en/developers/docs/nodes-and-clients/) are:
- Lighthouse (Rust)
- Lodestar (Typescript)
- Nimbus (Nim)
- Prysm (Go)
- Teku (Java)
- **Validator client**: Consensus layer consists of a consensus client, also knownn as a validator client with a beacon chian client. The validator client is responsible for porposing blocks and attestations in the beaconchain and shared chains.
- **Beacon chain client**: Responsible for managing the state of the beacon chain, validator shuffling, and more.
For my own full node setup, I chose Geth for execution client and Teku for consensus client (beacon chain and validator). It is a Java-based Ethereum 2.0 client. I chose this combination because I found good instructions online about how to set up those client softwares.
A quick note on the ethereum node types before we move to next item on the list.
>There are [three types of nodes] on Ethereum Beacon chain (extracted from Ethereum [official document](https://ethereum.org/en/developers/docs/nodes-and-clients/)):
>- ***Full node.*** A full node stores full blockchain data (not precisely true because this is periodically pruned so a full node does not store all state data back to Genesis). Full node participates in block validation, verifies all blocks and states. In theory, all states can be derived from a full node. But in reality, since the blockchain data is periodically pruned, states prior to a certain timestamp are reconstructed from requests made to archive nodes. Finally, full nodes serve the network and provides data on request.
>- ***Light node.*** As its name entails, light nodes just download block headers. These headers only contain summary information about the contents of the blocks. Light nodes cannot participate in consensus, but they can access the Ethereum blockchain with the same functionality and security gusrantess as a full node.
>- ***Archive node.*** Archive nodes store everything kept in the full node and build an archive of historical states. This archive includes massive amount of data, representing units of terabytes, which make archive nodes less attractive for average users since the storate requirement is very high. However, archive nodes can be handy for users and services like block explorers, wallet vendors and chain analytics.
Syncing clients in full-node or light-node mode results in pruned blockchain data, i.e., there is no archive of all historical states but the full node is able to build them om demand.
Next task is to setup execusion client `Geth`, validator client and beacon-chain client `Teku`. For this setup. I followed along [this](https://mkoz.notion.site/Geth-Teku-Setup-Ubuntu-86bcdcbe82e54e20a3056285f1900bcb) excellent note and my entire setup was really smooth.[^1] Thus, I won't document this part. The above note has everything you need to install both clients and start syncing Ethereum blockchain. The total time it takes to sync the entire blockchain depends on your internet bandwidth. In my case, it took about 24 hours.
## PART II - Setup and Run Docker Engine[^2]
In order to run an Arbitrum node in our local machine, we need to have [Docker](https://docs.docker.com/get-started/overview/) installed (I know I know. I also ask myself why, but haven't been able to look into why this is a prerequisite.). We can install Dcoker engine or Dcoker desktop. Dcoker desktop comes with Dcoker engine. Another benefit of installing docker desktop instead of docker engine is that I can interact docker with NUC GUI I have. Docker page has detailed instructions on how to install Docker desktop on Linux. Users can follow that instruction.
Source: https://docs.docker.com/engine/install/ubuntu/#set-up-the-repository
Source: https://mkoz.notion.site/Installing-Docker-On-NUC-978c1a9f79d14191bd027ef68fa330d5
One important note here is that when running the command `sudo apt-get install ./docker-desktop-<version>-<arch>.deb`, there are two things you have to careful:
1. Usually the DEB package is downloaded to `Dowloads` folder. So you might want to change the file location to `./Downloads/docker-desktop-<version>-<arch>.deb`.
2. `-<version>-<arch>` corresponds to the release version you downloaded from the docker site. You can just check the file name to get the version and architecture. In my case, the downloaded file has the name `docker-desktop-4.15.0-amd64.deb`. Thus, the version is `4.15.0` and the architecture is `amd64`.
Okay, we finally get to Arbitrum part.
## PART III - Setup and Run an Arbitrum Full Node
Setting up Arbitrum node had not been smooth for me, compared to my ethereum node setup. I guess this is understandable since layer 2 solutions were introduced not long ago. [Arbitrum Dev Center](https://developer.arbitrum.io/node-running/running-a-node) has a rather detailed instruction on how to setup an Arbitrum node. I first attemped to follow this instruction, but somehow my arbitrum node kept failing to connect to my local ethereum L1 node. When I was about to give up and instead use Infura endpoint, I found [this](https://mirror.xyz/0xf3bF9DDbA413825E5DdF92D15b09C2AbD8d190dd/i4OnpBFIJUKA6z_pqN2gu2zst2MUaHOqrxSX4vCW9cM) post and it worked like a charm. Thus, a million thanks to whoever wrote it. And of course, if you have faced any problems during the Arbitrum node setup process, you can always seek help on Arbitrum Discord. They have been very responsive to my various questions.
One more thing. There are three types of validators on Arbitrum:
- *Active validator*. A party who stakes. This party will propose state updates or challenging the validity of assertions. Note that this entity is different from the sequencer.
- *Defensive validator*. A validator that watches the Arbitrum chain and takes action (i.e., stake and challenges) only when and if an invalid assertion occurs.
- *Watchtower validator*. A validator that never stakes / never taken on-chain action. This validator might raise an alarm if an invalid assertion takes place.
Currently on Arbitrum chain, the ability to post assertions on-chain is whitelisted, which means not anyone can become active or defensive validator. As a result, someone who wants to observe the chain can run a validator in `watchtower` mode.
Next item I am trying to get it right is to extract data from Arbitrum network using my own node. I haven't figured that out yet and would love to get help here.
## PART IV - Monitor Your Ethereum Infrastructure
The last part (optional) is to monitor your Ethereum full node by checking various metrics. I am in the process of setting this up. Once I finish it, I will add this part in the post. One useful reference here is the speak below:
Reference: https://archive.devcon.org/archive/watch/5/monitoring-an-ethereum-infrastructure/
[^1]: One Ethereum Foundation developer pointed out that this instruction gave advice to do a pretty dangerous privileges escalation and then in systemd services keeps the same user to run clients. He suggested users to be careful with this and ideally services should be separated using their own users with minimum privileges. Users can also use systemd security features to harden it https://www.redhat.com/sysadmin/systemd-secure-services
[^2]: It is worth looking into https://stereum.net/, a simple way of setting up clients on an Ubuntu server. There is also https://eth-docker.net/ which makes it easy using CLI but is more focused on stakers.