Comment on page
Sepolia Testnet
This guide is a recommended way of running your node, specifically as a systemd service on a Linux-based machine (be it virtual, or bare metal) and is complementary to the official documentation available here. You could also start your node as a Docker container, but we would recommend using this option only if you are familiar with container technologies and we strongly encourage leveraging the power of containers with an orchestration software such as Kubernetes.
AWS:
m5.xlarge
or any equivalent instance type
Bare Metal:
- 16GB RAM
- 4 vCPUs
- At least 1.2TB SSD of storage - make sure it's extendable (~3GB daily storage growth)
We're going to assume you are already logged into your Virtual Machine as a privileged user or as the root user.
After making sure your operating system is up to date we will need to install a couple of packages before actually getting the node started.
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install git curl wget cmake build-essential clang ufw jq net-tools lz4 -y
The easiest way to get the
nitro
binary is to copy it directly from the latest official Docker image.# install Docker
sudo apt-get remove docker docker-engine docker.io containerd runc -y
sudo apt-get install ca-certificates curl gnupg lsb-release -y
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io -y
# pull latest Nitro image
LATEST_RELEASE="v2.0.14-2baa834"
docker pull offchainlabs/nitro-node:${LATEST_RELEASE}
# copy binary from image
docker cp $(docker run -it -d offchainlabs/nitro-node:${LATEST_RELEASE}):/usr/local/bin/nitro /usr/local/bin/nitro
The next step is to create the systemd configuration file:
sudo touch /etc/systemd/system/arbitrum.service # create the file
sudo vi /etc/systemd/system/arbitrum.service # open the file for writing - we prefer vi as our text editor, but feel free to use what suits you best
The contents of the systemd configuration file should be:
[Unit]
Description=Arbitrum Node Service
[Service]
Type=simple
User=<USER> # replace <USER> with your user
ExecStart=/usr/local/bin/nitro \
--l1.url <YOUR_ETHEREUM_ENDPOINT_URL> # e.g. https://eth-sepolia.blastapi.io/<UUID>
--l2.chain-id 421614 # Arbitrum Nova chain ID
--node.rpc.evm-timeout=10s
--http.api=net,web3,eth
--http.corsdomain=*
--http.addr=0.0.0.0
--http.port=8545
--http.vhosts=*
--ws.addr=0.0.0.0
--ws.api=net,web3,eth
--ws.port=8546
--ws.origins=*
--metrics
--metrics-server.addr 0.0.0.0
--metrics-server.port 6070
LimitNOFILE=65536
Restart=on-failure
RestartSec=30
TimeoutStopSec=45
[Install]
WantedBy=multi-user.target
Please make sure that the RPC and WS ports are accessible (in this case - 8545 for RPC & 8546 for WS).
That's pretty much it. We can now start the service, and implicitly the node.
sudo systemctl daemon-reload
sudo systemctl enable arbitrum.service
sudo systemctl start arbitrum.service
You can check if the service is running properly as follows:
sudo systemctl status arbitrum.service # check if the service is active and running
sudo journalctl -f -u arbitrum.service # check the logs of the node
The node should now be syncing with the network. If you do not wish to sync from scratch (which should take a few days), you can use the Arbitrum Snapshots provided by the Arbitrum Foundation, which we've successfully used in the past for various use cases. It is important to know that your node should be stopped while downloading the snapshots and it is important that the database files are cleaned up before downloading to ensure data integrity. You should also check the official docs for more details regarding the database snapshots here.
You can check if the node is synced by running the RPC call listed below from inside your environment. You are going to need to have the
curl
package installed for this, so make sure to install it beforehand.curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "eth_blockNumber","params": []}' localhost:8545
The result should be a hex number (i.e
0x10c5815
). If you convert it to a decimal number, you can compare it to the latest block listed on the explorer.In order to test the WS endpoint, we will need to install a package called
node-ws
.An example WS call would look like this:
wscat --connect ws://localhost:8546
> {"id":1, "jsonrpc":"2.0", "method": "eth_blockNumber","params": []}
In order to maintain a healthy node that passes the Integrity Protocol's checks, you should have a monitoring system in place. Blockchain nodes usually offer metrics regarding the node's behaviour and health - a popular way to offer these metrics is Prometheus-like metrics. The most popular monitoring stack, which is also open source, consists of:
- Prometheus - scrapes and stores metrics as time series data (blockchain nodes cand send the metrics to it);
- Grafana - allows querying, visualization and alerting based on metrics (can use Prometheus as a data source);
We will assume that Prometheus/Grafana/Alertmanager are already installed (we will provide a detailed guide of how to set up monitoring and alerting with the Prometheus + Grafana stack at a later time; for now, if you do not have the stack already installed, please follow this official basic guide here).
We recommend installing the Node Exporter utilitary since it offers valuable information regarding CPU, RAM & storage. This way, you will be able to monitor possible hardware bottlenecks, or to check if your node is underutilized - you could use these valuable insights to take decisions regarding scaling up/down the allocated hardware resources.
Below, you can find a script that installs Node Exporter as a systemd service.
#!/bin/bash
# set the latest version
VERSION=1.6.1
# download and untar the binary
wget https://github.com/prometheus/node_exporter/releases/download/v${VERSION}/node_exporter-${VERSION}.linux-amd64.tar.gz
tar xvf node_exporter-*.tar.gz
sudo cp ./node_exporter-${VERSION}.linux-amd64/node_exporter /usr/local/bin/
# create system user
sudo useradd --no-create-home --shell /usr/sbin/nologin node_exporter