Skip to content

Commit 69f0d72

Browse files
committed
add new setup
1 parent a7f549c commit 69f0d72

29 files changed

+32597
-0
lines changed

.env.example

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
###############################################################################
2+
# ↓ REQUIRED ↓ #
3+
###############################################################################
4+
5+
# Network to run the node on ("ink-mainnet", "ink-sepolia", etc.)
6+
NETWORK_NAME=ink-mainnet
7+
8+
# Type of node to run ("full" or "archive"), note that "archive" is 10x bigger
9+
NODE_TYPE=archive
10+
11+
# L1 node that the op-node (Bedrock) will get chain data from
12+
OP_NODE__RPC_ENDPOINT=
13+
14+
# L1 beacon endpoint, you can setup your own or use Quicknode
15+
OP_NODE__L1_BEACON=
16+
17+
# Type of RPC that op-node is connected to, see README
18+
OP_NODE__RPC_TYPE=quicknode
19+
20+
# L2 RPC to compare your local node against (https://rpc-gel-sepolia.inkonchain.com for ink-sepolia or https://rpc-gel.inkonchain.com for ink-mainnet)
21+
HEALTHCHECK__REFERENCE_RPC_PROVIDER=https://rpc-gel.inkonchain.com
22+
23+
24+
###############################################################################
25+
# ↓ OPTIONAL ↓ #
26+
###############################################################################
27+
28+
# Set to "full" to force op-geth to use --syncmode=full
29+
OP_GETH__SYNCMODE=
30+
31+
# Feel free to customize your image tag if you want, uses "latest" by default
32+
# See here for all available images: https://hub.docker.com/u/ethereumoptimism
33+
IMAGE_TAG__DTL=
34+
IMAGE_TAG__HEALTCHECK=
35+
IMAGE_TAG__PROMETHEUS=
36+
IMAGE_TAG__GRAFANA=
37+
IMAGE_TAG__INFLUXDB=
38+
IMAGE_TAG__OP_GETH=
39+
IMAGE_TAG__OP_NODE=
40+
41+
# Exposed server ports (must be unique)
42+
# See docker-compose.yml for default values
43+
PORT__DTL=
44+
PORT__HEALTHCHECK_METRICS=
45+
PORT__PROMETHEUS=
46+
PORT__GRAFANA=
47+
PORT__INFLUXDB=
48+
PORT__TORRENT_UI=
49+
PORT__TORRENT=
50+
PORT__OP_GETH_HTTP=
51+
PORT__OP_GETH_WS=
52+
PORT__OP_GETH_P2P=
53+
PORT__OP_NODE_P2P=
54+
PORT__OP_NODE_HTTP=

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.env
2+
.env.sepolia
3+
.env.mainnet

LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
(The MIT License)
2+
3+
Copyright 2020-2022 Optimism
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
"Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+214
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
# Ink Node
2+
3+
> Forked and customized from https://github.com/smartcontracts/simple-optimism-node
4+
5+
A simple docker compose script for launching full / archive node for the Ink chain.
6+
7+
## Recommended Hardware
8+
9+
### Mainnet
10+
11+
- 16GB+ RAM
12+
- 2 TB SSD (NVME Recommended)
13+
- 100mb/s+ Download
14+
15+
### Testnet
16+
17+
- 16GB+ RAM
18+
- 500 GB SSD (NVME Recommended)
19+
- 100mb/s+ Download
20+
21+
## Installation and Configuration
22+
23+
### Install docker and docker compose
24+
25+
> Note: If you're not logged in as root, you'll need to log out and log in again after installation to complete the docker installation.
26+
27+
Note: This command install docker and docker compose for Ubuntu. For windows and mac desktop or laptop, please use Docker Desktop. For other OS, please find instruction in Google.
28+
29+
```sh
30+
# Update and upgrade packages
31+
sudo apt-get update
32+
sudo apt-get upgrade -y
33+
34+
### Docker and docker compose prerequisites
35+
sudo apt-get install -y curl
36+
sudo apt-get install -y gnupg
37+
sudo apt-get install -y ca-certificates
38+
sudo apt-get install -y lsb-release
39+
40+
### Download the docker gpg file to Ubuntu
41+
sudo mkdir -p /etc/apt/keyrings
42+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
43+
44+
### Add Docker and docker compose support to the Ubuntu's packages list
45+
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
46+
47+
sudo apt-get update
48+
49+
### Install docker and docker compose on Ubuntu
50+
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
51+
52+
sudo usermod -aG docker $(whoami)
53+
54+
### Verify the Docker and docker compose install on Ubuntu
55+
sudo docker run hello-world
56+
```
57+
58+
(For non-root user) After logged out and logged back in, test if docker is working by running.
59+
60+
```sh
61+
docker ps
62+
```
63+
64+
It should returns an empty container list without having any error. Otherwise, restart your machine if there are errors.
65+
66+
### Clone the Repository
67+
68+
```sh
69+
git clone https://github.com/inkonchain/node
70+
cd node
71+
```
72+
73+
### Copy .env.example to .env
74+
75+
Make a copy of `.env.example` named `.env`.
76+
77+
```sh
78+
cp .env.example .env
79+
```
80+
81+
Open `.env` with your editor of choice
82+
83+
### Mandatory configurations
84+
85+
- **NETWORK_NAME** - Choose which Optimism network layer you want to operate on:
86+
- `ink-sepolia` - Ink Sepolia (Testnet)
87+
- `ink-mainnet` - Ink (Mainnet)
88+
- **NODE_TYPE** - Choose the type of node you want to run:
89+
- `full` (Full node) - A Full node contains a few recent blocks without historical states.
90+
- `archive` (Archive node) - An Archive node stores the complete history of the blockchain, including historical states.
91+
- **OP_NODE\_\_RPC_ENDPOINT** - Specify the endpoint for the RPC of Layer 1 (e.g., Ethereum mainnet). For instance, you can use the free plan of Quicknode for the Ethereum mainnet.
92+
- **OP_NODE\_\_L1_BEACON** - Specify the beacon endpoint of Layer 1. You can use [QuickNode for the beacon endpoint](https://www.quicknode.com). For example: https://xxx-xxx-xxx.quiknode.pro/db55a3908ba7e4e5756319ffd71ec270b09a7dce
93+
- **OP_NODE\_\_RPC_TYPE** - Specify the service provider for the RPC endpoint you've chosen in the previous step. The available options are:
94+
- `alchemy` - Alchemy
95+
- `quicknode` - Quicknode (ETH only)
96+
- `erigon` - Erigon
97+
- `basic` - Other providers
98+
99+
### Optional configurations
100+
101+
- **OP_GETH\_\_SYNCMODE** - Specify sync mode for the execution client
102+
- Unspecified - Use default snap sync for full node and full sync for archive node
103+
- `snap` - Snap Sync (Default)
104+
- `full` - Full Sync (For archive node, not recommended for full node)
105+
- **IMAGE_TAG\_\_[...]** - Use custom docker image for specified components.
106+
- **PORT\_\_[...]** - Use custom port for specified components.
107+
108+
## Operating the Node
109+
110+
### Start
111+
112+
```sh
113+
docker compose up -d --build
114+
```
115+
116+
Will start the node in a detatched shell (`-d`), meaning the node will continue to run in the background. We recommended to add `--build` to make sure that latest changes are being applied.
117+
118+
### View logs
119+
120+
```sh
121+
docker compose logs -f --tail 10
122+
```
123+
124+
To view logs of all containers.
125+
126+
```sh
127+
docker compose logs <CONTAINER_NAME> -f --tail 10
128+
```
129+
130+
To view logs for a specific container. Most commonly used `<CONTAINER_NAME>` are:
131+
132+
- op-geth
133+
- op-node
134+
- bedrock-init
135+
136+
### Stop
137+
138+
```sh
139+
docker compose down
140+
```
141+
142+
Will shut down the node without wiping any volumes.
143+
You can safely run this command and then restart the node again.
144+
145+
### Restart
146+
147+
```sh
148+
docker compose restart
149+
```
150+
151+
Will restart the node safely with minimal downtime but without upgrading the node.
152+
153+
### Upgrade
154+
155+
Pull the latest updates from GitHub, and Docker Hub and rebuild the container.
156+
157+
```sh
158+
git pull
159+
docker compose pull
160+
docker compose up -d --build
161+
```
162+
163+
Will upgrade your node with minimal downtime.
164+
165+
### Wipe [DANGER]
166+
167+
```sh
168+
docker compose down -v
169+
```
170+
171+
Will shut down the node and WIPE ALL DATA. Proceed with caution!
172+
173+
## Monitoring
174+
175+
### Estimate remaining sync time
176+
177+
Run progress.sh to estimate remaining sync time and speed.
178+
179+
```sh
180+
./progress.sh
181+
```
182+
183+
This will show the sync speed in blocks per minute and the time until sync is completed.
184+
185+
```
186+
Chain ID: 57073
187+
Please wait
188+
Blocks per minute: ...
189+
Hours until sync completed: ...
190+
```
191+
192+
### Grafana dashboard
193+
194+
Grafana is exposed at [http://localhost:3000](http://localhost:3000) and comes with one pre-loaded dashboard ("Simple Node Dashboard").
195+
Simple Node Dashboard includes basic node information and will tell you if your node ever falls out of sync with the reference L2 node or if a state root fault is detected.
196+
197+
Use the following login details to access the dashboard:
198+
199+
- Username: `admin`
200+
- Password: `ink`
201+
202+
Navigate over to `Dashboards > Manage > Simple Node Dashboard` to see the dashboard, see the following gif if you need help:
203+
204+
![metrics dashboard gif](https://user-images.githubusercontent.com/14298799/171476634-0cb84efd-adbf-4732-9c1d-d737915e1fa7.gif)
205+
206+
## Troubleshooting
207+
208+
### Walking back L1Block with curr=0x0000...:0 next=0x0000...:0
209+
210+
If you experience "walking back L1Block with curr=0x0000...:0 next=0x0000...:0" for a long time after the Ecotone upgrade, consider these fixes:
211+
212+
1. Wait for a few minutes. This issue usually resolves itself after some time.
213+
2. Restart docker compose: `docker compose down` and `docker compose up -d --build`
214+
3. If it's still not working, try setting `OP_GETH__SYNCMODE=full` in .env and restart docker compose

0 commit comments

Comments
 (0)