βοΈInstallation
sudo apt update
sudo apt-get install git curl build-essential make jq gcc snapd chrony lz4 tmux unzip bc -y
Install Go
# Install Go
cd $HOME
curl https://dl.google.com/go/go1.22.5.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf -
# Update environment variables to include go
cat <<'EOF' >>$HOME/.profile
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
EOF
source $HOME/.profile
# check go version
go version
Install the Node
# Install Sunrise node
cd $HOME
git clone https://github.com/sunriselayer/sunrise sunrise
cd sunrise
git checkout v1.1.0
make install
cd $HOME
sunrised version
Or use CLI
cd $HOME
wget -O sunrised https://github.com/sunriselayer/sunrise/releases/download/v1.1.0/sunrised-linux-amd64
chmod +x $HOME/sunrised
mv $HOME/sunrised $HOME/go/bin/sunrise
Initialize the Node
# Initialize Node
sunrised init <moniker> --chain-id=sunrise-1
sed -i "s/chain-id = .*/chain-id = \"sunrise-1\"/" $HOME/.sunrise/config/client.toml
sed -i "s/keyring-backend = .*/keyring-backend = \"os\"/" $HOME/.sunrise/config/client.toml
sed -i "s/node = .*/node = \"tcp:\/\/localhost:${SUNRISE_PORT}657\"/" $HOME/.sunrise/config/client.toml
sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.sunrise/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.sunrise/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"50\"/" $HOME/.sunrise/config/app.toml
Pruning:
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.sunrise/config/config.toml
Set indexer:
sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0.0025urise"|g' $HOME/.sunrise/config/app.toml
Set min gas:
sed -i.bak -e "s%:1317%:${SUNRISE_PORT}317%g;
s%:8080%:${SUNRISE_PORT}080%g;
s%:9090%:${SUNRISE_PORT}090%g;
s%:9091%:${SUNRISE_PORT}091%g;
s%:8545%:${SUNRISE_PORT}545%g;
s%:8546%:${SUNRISE_PORT}546%g;
s%:6065%:${SUNRISE_PORT}065%g" $HOME/.sunrise/config/app.toml
sed -i.bak -e "s%:26658%:${SUNRISE_PORT}658%g;
s%:26657%:${SUNRISE_PORT}657%g;
s%:6060%:${SUNRISE_PORT}060%g;
s%:26656%:${SUNRISE_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${SUNRISE_PORT}656\"%;
s%:26660%:${SUNRISE_PORT}660%g" $HOME/.sunrise/config/config.toml
Download Genesis file
curl -Ls https://support.synergynodes.com/genesis/sunrise_mainnet/genesis.json > $HOME/.sunrise/config/genesis.json
Download Addrbook file
curl -Ls https://support.synergynodes.com/addrbook/sunrise_mainnet/addrbook.json > $HOME/.sunrise/config/addrbook.json
Add / Update Persistent Peers
# Add / Update Peers
[email protected]:26656,[email protected]:28356,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:28356,[email protected]:26670,[email protected]:46656,[email protected]:11556,[email protected]:28356,[email protected]:26656,[email protected]:28356,[email protected]:26656,[email protected]:26776,[email protected]:26656,[email protected]:36156,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:28356,[email protected]:28356,[email protected]:21656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:36156,[email protected]:26656,[email protected]:28356,[email protected]:28356,[email protected]:21656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:56326,[email protected]:26656,[email protected]:56326
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = "$PEERS"/" $HOME/.sunrise/config/config.toml
Download & decompress Snapshot
# Follow these steps
cd $HOME
sudo systemctl stop sunrised
cp $HOME/.sunrise/data/priv_validator_state.json $HOME/.sunrise/priv_validator_state.json.backup
rm -rf $HOME/.sunrise/data
wget -O sunrise_mainnet_494085.tar.lz4 https://support.synergynodes.com/snapshots/sunrise_mainnet/sunrise_mainnet_494085.tar.lz4
lz4 -c -d sunrise_mainnet_494085.tar.lz4 | tar -x -C $HOME/.sunrise
mv $HOME/.sunrise/priv_validator_state.json.backup $HOME/.sunrise/data/priv_validator_state.json
sudo systemctl restart sunrised
Create Service File
# Create Service
sudo tee /etc/systemd/system/sunrised.service > /dev/null <<EOF
[Unit]
Description=sunrised Daemon
#After=network.target
StartLimitInterval=350
StartLimitBurst=10
[Service]
Type=simple
User=root
ExecStart=$(which sunrised) start
Restart=on-abort
RestartSec=30
[Install]
WantedBy=multi-user.target
[Service]
LimitNOFILE=1048576
EOF
Start the Node
# Enable service
sudo systemctl enable sunrised
# Start service
sudo service sunrised start
# Check logs
sudo journalctl -fu sunrised
Last updated
Was this helpful?