This detailed guide will walk you through the process of installing and running a Unichain node using Docker and Docker Compose.
The instructions are designed for beginners, with all commands provided for easy copy-paste execution. Prerequisites Before you begin, ensure that your system meets the following requirements:
Operating System: Ubuntu 20.04 LTS or later (other Linux distributions are also compatible)
User Privileges: A user account with sudo privileges
Hardware Requirements:
CPU: 4-core processor or higher.
RAM: 8 GB or more.
Storage: At least 100 GB free space (SSD recommended).
Network: Stable internet connection.
Docker: Installed on your system (instructions provided) .
Ethereum L1 Full Node.
RPC Endpoint: Access to an Ethereum Layer 1 node RPC URL (setup included).
Step 1: Update System Packages
To ensure that your system is up-to-date, start by updating your system’s package list and upgrading existing packages to the latest versions.
# Unichain Node Installation Guide## Step 1: Update System Packages**Explanation:** This command updates your system's package list and upgrades existing packages to the latest versions.```bashsudo apt update && sudo apt upgrade -y
Console Output:
Explanation: The output shows that the package list has been updated and all packages are already up to date.
Step 2: Install Docker and Docker Compose
Install Required Packages
Explanation: This command installs the required packages for Docker installation.
Console Output:
Explanation: The output shows that the required packages have been installed successfully.
Add Docker’s Official GPG Key
Explanation: This command adds Docker's official GPG key to your system.
Console Output:
Explanation: The output shows that Docker's official GPG key has been imported successfully.
Set Up the Stable Repository
Explanation: This command sets up the stable repository for Docker.
Console Output:
Explanation: The output shows that the stable repository for Docker has been set up.
Install Docker Engine
Explanation: This command installs Docker Engine, Docker CLI, and containerd.
Console Output:
Explanation: The output shows that Docker Engine, Docker CLI, and containerd have been installed successfully.
Add Your User to the Docker Group
Explanation: This command adds your user to the Docker group to avoid using sudo for Docker commands.
Console Output:
Explanation: The output shows that your user has been added to the Docker group.
Install Docker Compose
Explanation: Docker Compose is included in the Docker installation as docker compose. This command verifies the installation.
Console Output:
Explanation: The output shows the version of Docker Compose installed on your system.
Step 3: Clone the Unichain Node Repository
Explanation: This command clones the Unichain Node repository from GitHub.
Console Output:
Explanation: The output shows that the Unichain Node repository has been cloned successfully.
Step 4: Set Up Environment Variables
Explanation: This command sets up the environment variables for the Unichain node.
Console Output: (No output for cp command)
Explanation: The cp command copies the example environment file to create your own .env file. There is no output for this command. The nano command opens the .env file in a text editor, and the output is not shown here.
Set Environment Variables in .env File
Explanation: The output shows the environment variables that have been set up for the Unichain node.
Step 5: Configure the Unichain Node
Explanation: This command creates the data directories for the Unichain node.
Console Output: (No output for mkdir commands)
Explanation: The mkdir commands create the data directories for the Unichain node. There is no output for these commands.
Check the docker-compose.yml File (Optional)
Console Output: (No output for nano command)
Explanation: The nano command opens the docker-compose.yml file in a text editor, and the output is not shown here.
Ensure that the volume mappings use the environment variables correctly
Explanation: The output shows the volume mappings in the docker-compose.yml file, which use the environment variables correctly.
Step 6: Run the Unichain Node
Explanation: This command starts the Unichain node using Docker Compose.
Console Output:
Explanation: The output shows that the Unichain node has been started successfully using Docker Compose.
Verify the Containers Are Running
Explanation: This command checks if the containers are running.
Console Output:
Explanation: The output shows the running containers for the Unichain node.
Step 7: Verify Node Operation
Explanation: This command tests the JSON-RPC endpoint of the Unichain node.
Console Output:
Explanation: The output shows the result of the JSON-RPC request to the Unichain node, which returns the block number.
Step 8: Monitor Synchronization Progress
Explanation: This command checks the block number to monitor the synchronization progress of the Unichain node.
Console Output:
Explanation: The output shows the block number of the Unichain node, which can be used to monitor the synchronization progress.
View Container Logs (Optional)
Explanation: These commands show the logs for the execution client and OP node containers.
Console Output:
Explanation: The output shows the logs for the execution client and OP node containers, which can be used for debugging and monitoring purposes.
Step 9: Use Test Nodes for Deploying Unichain Nodes
By visiting the Test Nodes website, you can explore the available options for deploying Unichain nodes. The platform provides a user-friendly interface to configure and deploy nodes without the need for manual setup.
Choose the desired time period for your node, such as 1, 3 and 6 months.
Follow the on-screen instructions to complete the deployment process.
Test Nodes will handle the setup and configuration of your Unichain node, allowing you to focus on other aspects of your project or development work.
Note: Test Nodes may have different pricing plans and terms of service, so be sure to review the details before proceeding with the deployment.
By using Test Nodes, you can save time and effort in setting up and configuring Unichain nodes, making it easier to get started with the Unichain network and decentralized applications (dApps) development.
Do not forget to use your referral code with your friends to earn rewards:
Conclusion
Congratulations! You have successfully installed and run a Unichain node on your system using Docker. Your node is now participating in the Unichain network, contributing to its security and decentralization. You can interact with your node programmatically or use it as a backend for decentralized applications (dApps) on the Unichain network.
Stay Connected
If you have any additional questions or would like to discuss further, feel free to find us on Discord or X platform.
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
The following additional packages will be installed:
apt-utils gnupg-agent
Suggested packages:
apt-transport-https-doc
The following NEW packages will be installed:
apt-transport-https apt-utils gnupg-agent
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,114 kB of archives.
After this operation, 5,084 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 apt-utils all 2.18 [1,014 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal/main amd64 gnupg-agent amd64 2.2.20-1ubuntu1.1 [100 kB]
Fetched 1,114 kB in 0s (1,901 kB/s)
Selecting previously unselected package apt-transport-https.
(Reading database ... 111440 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_0.8.12_all.deb ...
Unpacking apt-transport-https (0.8.12) ...
Selecting previously unselected package apt-utils.
Preparing to unpack .../apt-utils_2.18_all.deb ...
Unpacking apt-utils (2.18) ...
Selecting previously unselected package gnupg-agent.
Preparing to unpack .../gnupg-agent_2.2.20-1ubuntu1.1_amd64.deb ...
Unpacking gnupg-agent (2.2.20-1ubuntu1.1) ...
Setting up apt-transport-https (0.8.12) ...
Setting up apt-utils (2.18) ...
Setting up gnupg-agent (2.2.20-1ubuntu1.1) ...
Processing triggers for man-db (2.9.1-1) ...
gpg: keyring `/tmp/tmp.1000000000.gpg' created
gpg: /tmp/tmp.1000000000.gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
gpg: key 7EA8A75628BB82EA: public key "Docker Release (Docker Release) <docker@docker.com>" imported
gpg: Total number processed: 1
gpg: imported: 1
The following additional packages will be installed:
containerd.io docker-ce-cli
Suggested packages:
bridge-utils iproute2 iputils-ping
The following NEW packages will be installed:
containerd.io docker-ce docker-ce-cli
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 104 MB of archives.
After this operation, 344 MB of additional disk space will be used.
Get:1 https://download.docker.com/linux/ubuntu focal/stable amd64 containerd.io amd64 1.6.10-3 [10.5 MB]
Get:2 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-ce-cli amd64 5:20.10.17~3-0~ubuntu-focal [32.7 MB]
Get:3 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-ce amd64 5:20.10.17~3-0~ubuntu-focal [61.1 MB]
Fetched 104 MB in 10s (10.1 MB/s)
Selecting previously unselected package containerd.io.
(Reading database ... 111440 files and directories currently installed.)
Preparing to unpack .../containerd.io_1.6.10-3_amd64.deb ...
Unpacking containerd.io (1.6.10-3) ...
Selecting previously unselected package docker-ce-cli.
Preparing to unpack .../docker-ce-cli_5%3a20.10.17~3-0~ubuntu-focal_amd64.deb ...
Unpacking docker-ce-cli (5:20.10.17~3-0~ubuntu-focal) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../docker-ce_5%3a20.10.17~3-0~ubuntu-focal_amd64.deb ...
Unpacking docker-ce (5:20.10.17~3-0~ubuntu-focal) ...
Setting up containerd.io (1.6.10-3) ...
Setting up docker-ce-cli (5:20.10.17~3-0~ubuntu-focal) ...
Setting up docker-ce (5:20.10.17~3-0~ubuntu-focal) ...
Processing triggers for man-db (2.9.1-1) ...
sudo usermod -aG docker $USER
Adding user `yourusername' to group `docker'
Adding yourusername to group docker
docker compose version
docker compose version, version v2.15.1, build unknown
sudo apt install -y git
git clone https://github.com/Uniswap/unichain-node.git
cd unichain-node
Creating network "unichain-node_default" with the default driver
Creating unichain-node_execution-client ... done
Creating unichain-node_op-node ... done
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
567890123456 unichain/op-node:latest "/entrypoint.sh op-n…" 10 seconds ago Up 9 seconds 0.0.0.0:8545->8545/tcp unichain-node_op-node
123456789012 unichain/execution-client "/entrypoint.sh exec…" 10 seconds ago Up 9 seconds 0.0.0.0:8546->8546/tcp unichain-node_execution-client