Fetching latest version...
This setup targets a normal user with sudo privileges.
sudo apt update && sudo apt upgrade -y
sudo apt install git curl wget tar lz4 unzip jq build-essential pkg-config clang bsdmainutils make ncdu -y
Login as your user and install Go. If successful, go version
will print a version number.
cd
version="1.23.1"
wget "https://golang.org/dl/go$version.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$version.linux-amd64.tar.gz"
rm "go$version.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
go version
Clone and build Oraichain.
cd
git clone https://github.com/oraichain/orai orai
cd orai
git checkout v0.42.3
cd orai
go mod tidy
make install
Initialize your node and download the genesis.
cd
oraid init NodeName --chain-id Oraichain
wget -O $HOME/.oraid/config/genesis.json "https://raw.githubusercontent.com/oraichain/oraichain-static-files/master/genesis.json"
Set official seeds.
SEEDS="e18f82a6da3a9842fa55769955d694f62f7f48bd@seed1.orai.zone:26656,893f246ffdffae0a9ef127941379303531f50d5c@seed2.orai.zone:26656,4fa7895fc43f618b53cd314585b421ee47b75639@seed3.orai.zone:26656,defeea41a01b5afdb79ef2af155866e122797a9c@seed4.orai.zone:26656"
sed -i -e "s|^seeds *=.*|seeds = \"$SEEDS\"|" $HOME/.oraid/config/config.toml
Create the service unit file.
sudo nano /etc/systemd/system/oraid.service
Paste the following (replace USER
with your Linux username), then save.
[Unit]
Description=Oraid Daemon
#After=network.target
StartLimitInterval=350
StartLimitBurst=10
[Service]
Type=simple
User=USER
ExecStart=/home/USER/go/bin/oraid start --home /home/USER/.oraid
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target
[Service]
LimitNOFILE=1048576
This script sets StateSync parameters automatically.
sudo bash -c "cat > $HOME/ss.sh <<'EOF'
SNAP_RPC="https://orai-rpc.imdev.app:443"
LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height)
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000))
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)
echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH
sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.oraid/config/config.toml
grep 'rpc_servers\|trust_height\|trust_hash' $HOME/.oraid/config/config.toml
EOF"
sudo chmod +x ss.sh
./ss.sh
Start now and ensure it runs on boot.
sudo systemctl daemon-reload
sudo systemctl restart systemd-journald
sudo systemctl start oraid
sudo systemctl enable oraid
journalctl -fu oraid