Skip to content

Commit 0fe8591

Browse files
doc: berachain node (#1396)
Co-authored-by: kowshikvajrala <[email protected]>
1 parent 60ff674 commit 0fe8591

File tree

2 files changed

+244
-0
lines changed

2 files changed

+244
-0
lines changed
Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
# Berachain
2+
3+
import { Callout } from "/src/components/callout";
4+
5+
Set up your Berachain Mainnet or Testnet node
6+
7+
## Prerequisites
8+
9+
- [Setup your Axelar validator](/validator/setup/overview/)
10+
- [Minimum hardware requirements](https://docs.berachain.com/nodes/quickstart#hardware-requirements-%F0%9F%92%BB):
11+
- Memory: 48 GB RAM
12+
- CPU: 8 Physical Cores
13+
- Disk: 4TB of SSD storage
14+
- [Official Documentation](https://docs.berachain.com/nodes/quickstart)
15+
16+
## Download clients
17+
18+
Download berachain consensus client from [here](https://github.com/berachain/beacon-kit/releases).
19+
20+
```bash
21+
wget https://github.com/berachain/beacon-kit/releases/download/v1.2.0/beacond-v1.2.0-linux-amd64.tar.gz
22+
tar -xzvf beacond-v1.2.0-linux-amd64.tar.gz
23+
mv beacond-v1.2.0-linux-amd64 beacond
24+
```
25+
26+
Download any execution client recommended from [here](https://docs.berachain.com/nodes/evm-execution).
27+
28+
```bash
29+
wget https://github.com/NethermindEth/nethermind/releases/download/1.31.11/nethermind-1.31.11-2be1890e-linux-x64.zip
30+
unzip nethermind-1.31.11-2be1890e-linux-x64.zip
31+
```
32+
33+
## Fetch Scripts
34+
35+
```bash
36+
mkdir beranode
37+
cd beranode
38+
git clone https://github.com/berachain/guides
39+
mv guides/apps/node-scripts/* ./
40+
rm -r guides
41+
```
42+
43+
## Configure env variables
44+
45+
```bash
46+
nano env.sh
47+
```
48+
49+
The file env.sh contains environment variables used in the other scripts.
50+
51+
52+
<tabs>
53+
<tab-item title="Mainnet">
54+
```bash
55+
#!/bin/bash
56+
57+
# CHANGE THESE VALUES
58+
export CHAIN_SPEC=mainnet
59+
export MONIKER_NAME=camembera # name of your choice
60+
export WALLET_ADDRESS_FEE_RECIPIENT=0x9BcaA41DC32627776b1A4D714Eef627E640b3EF5
61+
export EL_ARCHIVE_NODE=false # set to true if you want to run an archive node on CL and EL
62+
export MY_IP=`curl -s canhazip.com`. # your node ip address
63+
64+
# VALUES YOU MIGHT WANT TO CHANGE
65+
export LOG_DIR=$(pwd)/logs
66+
export JWT_PATH=$BEACOND_CONFIG/jwt.hex
67+
export BEACOND_BIN=$(command -v beacond || echo $(pwd)/beacond) # set path to beacond binary
68+
export BEACOND_DATA=$(pwd)/var/beacond
69+
export RETH_BIN=$(command -v reth || echo $(pwd)/reth) # set path to the reth binary
70+
export GETH_BIN=$(command -v geth || echo $(pwd)/geth) # set path to the geth binary
71+
export NETHERMIND_BIN=$(command -v Nethermind.Runner || echo $(pwd)/Nethermind.Runner) # set path to nethermind binary
72+
export ERIGON_BIN=$(command -v erigon || echo $(pwd)/erigon) # set path to erigon binary
73+
```
74+
</tab-item>
75+
<tab-item title="Testnet">
76+
```bash
77+
#!/bin/bash
78+
79+
# CHANGE THESE VALUES
80+
export CHAIN_SPEC=testnet
81+
export MONIKER_NAME=camembera # name of your choice
82+
export WALLET_ADDRESS_FEE_RECIPIENT=0x9BcaA41DC32627776b1A4D714Eef627E640b3EF5
83+
export EL_ARCHIVE_NODE=false # set to true if you want to run an archive node on CL and EL
84+
export MY_IP=`curl -s canhazip.com` # your node ip address
85+
86+
# VALUES YOU MIGHT WANT TO CHANGE
87+
export LOG_DIR=$(pwd)/logs
88+
export JWT_PATH=$BEACOND_CONFIG/jwt.hex
89+
export BEACOND_BIN=$(command -v beacond || echo $(pwd)/beacond) # set path to beacond binary
90+
export BEACOND_DATA=$(pwd)/var/beacond
91+
export RETH_BIN=$(command -v reth || echo $(pwd)/reth) # set path to the reth binary
92+
export GETH_BIN=$(command -v geth || echo $(pwd)/geth) # set path to the geth binary
93+
export NETHERMIND_BIN=$(command -v Nethermind.Runner || echo $(pwd)/Nethermind.Runner) # set path to nethermind binary
94+
export ERIGON_BIN=$(command -v erigon || echo $(pwd)/erigon) # set path to erigon binary
95+
```
96+
</tab-item>
97+
</tabs>
98+
99+
100+
## Fetch Parameters
101+
102+
The `fetch-berachain-params.sh` script downloads the key network parameters for Berachain.
103+
104+
```bash
105+
./fetch-berachain-params.sh
106+
```
107+
108+
## Set up the Consensus Client
109+
110+
The script `setup-beacond.sh` invokes `beacond init` and `beacond jwt generate`.
111+
112+
```bash
113+
./setup-beacond.sh
114+
```
115+
116+
## Set up the Execution Client
117+
118+
The `setup-reth`, `setup-geth`, and `setup-nether` scripts create a runtime directory and configuration for their respective chain clients.
119+
120+
```bash
121+
./setup-nether.sh
122+
```
123+
124+
## Run Both Clients
125+
126+
Create systemd service file for nethermind:
127+
128+
```bash
129+
sudo tee <<EOF >/dev/null /etc/systemd/system/nethermind.service
130+
[Unit]
131+
Description=Nethermind Client
132+
After=network.target
133+
134+
[Service]
135+
User=$USER
136+
Type=simple
137+
ExecStart=/path/to/the/$NETHERMIND_BINARY --config $NETHERMIND_CONFIG_DIR/nethermind.cfg
138+
Restart=on-failure
139+
LimitNOFILE=65535
140+
141+
[Install]
142+
WantedBy=multi-user.target
143+
EOF
144+
```
145+
146+
Create systemd service file for beacond:
147+
148+
```bash
149+
sudo tee <<EOF >/dev/null /etc/systemd/system/beacond.service
150+
[Unit]
151+
Description=Beacond Client
152+
After=network.target
153+
154+
[Service]
155+
User=$USER
156+
Type=simple
157+
ExecStart=/path/to/the/$BEACOND_BINARY start --home $BEACOND_DATA
158+
Restart=on-failure
159+
LimitNOFILE=65535
160+
161+
[Install]
162+
WantedBy=multi-user.target
163+
EOF
164+
```
165+
166+
### Start Clients
167+
168+
You can start the clients using snapshots by following the [guide](https://docs.berachain.com/nodes/quickstart#fetch-snapshots-optional).
169+
170+
```bash
171+
# Reload systemd
172+
sudo systemctl daemon-reload
173+
174+
# Enable Nethermind and Beacon Chain services to start on b
175+
sudo systemctl enable nethermind
176+
sudo systemctl enable beacond
177+
178+
# Start the services
179+
sudo systemctl start nethermind
180+
sudo systemctl start beacond
181+
```
182+
183+
If everything was set-up correctly, your Clients should now be starting the process of synchronization. This will take several hours, depending on your hardware. To check the status of the running service or to follow the logs, you can use:
184+
185+
Check Status:
186+
187+
```bash
188+
sudo systemctl status nethermind
189+
sudo systemctl status beacond
190+
```
191+
192+
Check Logs:
193+
194+
```bash
195+
sudo journalctl -u nethermind -f
196+
sudo journalctl -u beacond -f
197+
```
198+
199+
## Verify sync status
200+
201+
Get current execution block number:
202+
203+
```bash
204+
curl --location 'http://localhost:8545' \
205+
--header 'Content-Type: application/json' \
206+
--data '{
207+
"jsonrpc":"2.0",
208+
"method":"eth_blockNumber",
209+
"params":[],
210+
"id":420
211+
}'
212+
```
213+
214+
Get current Consensus Block Number:
215+
216+
```bash
217+
curl -s http://localhost:26657/status | jq '.result.sync_info.latest_block_height'
218+
```
219+
220+
## Ampd Configuration
221+
222+
Once your node is up and running, you need to add the `Berachain` chain to your [ampd daemon's](https://github.com/axelarnetwork/axelar-amplifier/tree/main/ampd) `config.toml`file. This can be done by adding in the following configuration:
223+
224+
<tabs>
225+
<tab-item title="Mainnet">
226+
```toml
227+
TBA
228+
```
229+
</tab-item>
230+
<tab-item title="Testnet">
231+
```toml
232+
TBA
233+
```
234+
</tab-item>
235+
</tabs>
236+
237+
## Chain Registration
238+
239+
For your node to be recognized by the Axelar Network, you need to register your verifier's support for the chain with the `ampd` daemon. This can be done by running:
240+
241+
```bash
242+
TBA
243+
```

src/layouts/navigation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ export const getNavigation = (section) => {
509509
href: "/validator/external-chains/avalanche/",
510510
},
511511
{ title: "Base", href: "/validator/external-chains/base/" },
512+
{ title: "Berachain", href: "/validator/external-chains/berachain/" },
512513
{ title: "Binance", href: "/validator/external-chains/binance/" },
513514
{ title: "Blast", href: "/validator/external-chains/blast/" },
514515
{ title: "Celo", href: "/validator/external-chains/celo/" },

0 commit comments

Comments
 (0)