Actions

Arbitrum RPC endpoint

From Chainlink Community Wiki

Revision as of 15:57, 4 August 2022 by Devtrace (talk | contribs)
Arbitrum Logo.png

Arbitrum RPC endpoint details

This is a general guide on deploying an Arbitrum RPC endpoint for your Chainlink Node(s).
Official Arbitrum Docs are available here

NOTE

This document assumes base operating system is Debian 10

Arbitrum RPC endpoints:

You Chainlink node has two connections methods. Websocket and HTTP.

As these can vary between networks, the default values for an Arbitrum node are:

Websocket ws://<your_ip_address>:8548


HTTPhttp://<your_ip_address>:8547


Install Docker-CE

Install dependencies first.

sudo apt update && sudo apt upgrade && sudo apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common


Now, we'll need to get our aptitude sources updated to include the Docker-CE repository.

These commands must be run as root.

sudo su


curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -


add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"


Once we have added the repo and the necessary key, we want to exit the root user. exit


NOTE

You should see your shell prompt displaying a $ if you're a non-root user. If you're in an elevated (root) TTY session, your shell prompt will display a #


Since we've modified our aptitude sources, we'll need to update them before we can install docker-ce

sudo apt update && sudo apt install docker-ce


Now that we have Docker-CE installed, we'll need to add our user to the docker group.

(The prevents us from having to run docker commands with elevated (root) permissions)

sudo usermod -aG docker $USER


Next, we'll get our Arbitrum RPC And Relay nodes deployed and synced, but we'll create a docker network for the containers first.

Crate a Docker Network

docker network create --driver bridge --subnet 192.168.1.0/24 --gateway 192.168.1.1 arbitrum-network

The above will create a docker network that we will use for our containers. This enables the traffic between the containers to stay within the host.

Deploy Arbitrum Relay Node

First, we'll need to create a new directory house the containers volumes.

mkdir -p ~/.arbitrum-data/relay


Due to the fact that the arbitrum container uses a non-root UID 1000 user, we'll want to open the permissions on that newly created directory

chmod 777 -R ~/.arbitrum-data


Now that we have the host directory properly configured for the Arbitrum container's volume, we can deploy the containers.


docker run --name arbitrum-mainnet-relay --net arbitrum-network --link arbitrum-mainnet-rpc --ip 192.168.1.24 --restart unless-stopped -it -v ~/arbitrum-mainnet/relay:/home/user/.arbitrum/mainnet -p 0.0.0.0:9642:9642 --entrypoint /home/user/go/bin/arb-relay offchainlabs/arb-node:v1.4.0-f4bbe91 --feed.input.url wss://arb1.arbitrum.io/feed


Deploy Arbitrum RPC Node

Be sure to modify the command; replace <L1_ETH_RPC> with your Ethereum Mainnet RPC endpoint.

For example, if your local ETH Mainnet RPC endpoint was at http://10.10.10.111:8545, you'd adjust that part of the command to

--l1.url=http://10.10.10.111:8545.


docker run --name arbitrum-rpc --net arbitrum-network --link arbitrum-mainnet-relay --ip 192.168.1.42 --restart unless-stopped -d -v ~/.arbitrum-data/:/home/user/.arbitrum/mainnet -p 8547:8547 -p 8548:8548 offchainlabs/arb-node:v1.2.0-9214e38 --feed.input.url=wss://arb1.arbitrum.io/feed --l1.url=<L1_ETH_RPC>


Possible Error Messages

Depending on your hypervisor/environment, your logging may throw an exit code 132, if this happens, you will need to enable Advanced Vector Extensions (AVX), or pass CPU flags to the guest OS.

You can check.confirm that this is your issue by running the command sudo cat /proc/cpuinfo | grep avx If you see that command return an empty line, then this is your issue.