Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install IRIShub
#!/bin/bash
# Upgrade the system and install go
sudo apt update
sudo apt upgrade -y
sudo apt install gcc git make -y
sudo snap install --classic go
sudo mkdir -p /opt/go/bin
# Export environment variables
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$PATH
# Create a system user for running the service
sudo useradd -m -d /opt/iris --system --shell /usr/sbin/nologin iris
sudo -u iris mkdir -p /opt/iris/config
# Get IRIShub and build binaries
go get github.com/irisnet/irishub
cd $HOME/go/src/github.com/irisnet/irishub
git fetch --all
git checkout -f v0.13.1
make all
cd
# Copy the binaries to /opt/go/bin/
sudo cp $HOME/go/bin/iris* /opt/go/bin/
# Create systemd unit file
echo "[Unit]
Description=IRIShub Node
After=network-online.target
[Service]
User=iris
ExecStart=/opt/go/bin/iris start --home=/opt/iris/
Restart=always
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target" > iris.service
sudo mv iris.service /etc/systemd/system/
sudo systemctl enable iris.service
# Create the config skeleton as user iris
sudo -u iris /opt/go/bin/iris unsafe-reset-all --home=/opt/iris
echo "You can copy the genesis.json file to /opt/iris/config and edit the /opt/iris/config/config.toml."
echo "Run 'sudo service iris start' to start the service."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.