Begin with a new Ubuntu 20.04 system and update
sudo apt update && sudo apt upgrade -y
Install make, gcc , and jq
sudo apt install jq make gcc -y
Install Go
wget https://go.dev/dl/go1.21.0.linux-amd64.tar.gz -O /tmp/go1.21.0.linux-amd64.tar.gz && rm -rf /usr/local/go && tar -C /usr/local -xzf /tmp/go1.21.0.linux-amd64.tar.gz && rm /tmp/go1.21.0.linux-amd64.tar.gz
Download wasm file
wget https://github.com/CosmWasm/wasmvm/releases/download/v0.13.0/libwasmvm_muslc.a -O /lib/libwasmvm_muslc.a
Setup the systemd service
cat <<EOF >> /etc/systemd/system/oraid.service
[Unit]
Description=ORAI
After=network.target
StartLimitIntervalSec=60
StartLimitBurst=3
[Service]
User=orai
Type=simple
Restart=always
RestartSec=30
ExecStart=/home/orai/go/bin/oraid start --home /home/orai/.oraid
[Install]
WantedBy=default.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable oraid
Create a new user account
useradd -U -s /bin/bash -m -d /home/orai orai
usermod -a -G sudo orai
passwd orai
Add go to the users environment and log in
echo "export PATH=$PATH:/usr/local/go/bin:/home/orai/go/bin" >> /home/orai/.bashrc
su orai
cd ~
Compile the binary
git clone https://github.com/oraichain/orai.git && cd orai
git checkout v0.41.3
go get ./...
make build && make install
Set your Moniker and initialize the node
MONIKER=demo
oraid init $MONIKER --chain-id=Oraichain --home "$HOME"/.oraid
Update the genesis.json file
wget -O "$HOME"/.oraid/config/genesis.json https://raw.githubusercontent.com/oraichain/oraichain-static-files/master/genesis.json
Update the config.toml file
SEEDS="0baa806b3a4dd17be6e06369d899f140c3897d6e@18.223.242.70:26656,9749da4a81526266d7b8fe9a03d260cd3db241ad@18.116.209.76:26656,35c1f999d67de56736b412a1325370a8e2fdb34a@5.189.169.99:26656,5ad3b29bf56b9ba95c67f282aa281b6f0903e921@64.225.53.108:26656,d091cabe3584cb32043cc0c9199b0c7a5b68ddcb@seed.orai.synergynodes.com:26656,f223f1be06ef35a6dfe54995f05daeb1897d94d7@seed-node.mms.team:42656"
PERSISTENT="4d0f2d042405abbcac5193206642e1456fe89963@3.134.19.98:26656,24631e98a167492fd4c92c582cee5fd6fcd8ad59@162.55.253.58:26656,bf083c57ed53a53ccd31dc160d69063c73b340e9@3.17.175.62:26656,35c1f999d67de56736b412a1325370a8e2fdb34a@5.189.169.99:26656,5ad3b29bf56b9ba95c67f282aa281b6f0903e921@64.225.53.108:26656,d091cabe3584cb32043cc0c9199b0c7a5b68ddcb@seed.orai.synergynodes.com:26656"
STATE_SYNC_RPC=https://rpc.orai.io:443
STATE_SYNC_RPC1=https://rpc-oraichain.mms.team:443
LATEST_HEIGHT=$(curl -s "$STATE_SYNC_RPC"/block | jq -r .result.block.header.height)
SYNC_BLOCK_HEIGHT=$(($LATEST_HEIGHT - 2000))
SYNC_BLOCK_HASH=$(curl -s "$STATE_SYNC_RPC"/block?height="$SYNC_BLOCK_HEIGHT" | jq -r .result.block_id.hash)
sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|1true| ;
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|1"$STATE_SYNC_RPC,$STATE_SYNC_RPC1"| ;
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|1$SYNC_BLOCK_HEIGHT| ;
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|1"$SYNC_BLOCK_HASH"| ;
s|^(persistent_peers[[:space:]]+=[[:space:]]+).*$|1"$PERSISTENT"| ;
s|^(seeds[[:space:]]+=[[:space:]]+).*$|1"$SEEDS"|" $HOME/.oraid/config/config.toml
Start the service and verify it is working
sudo systemctl start oraid
sleep 5 && sudo systemctl status oraid
Recent Comments