Skip to content

Instantly share code, notes, and snippets.

@jackpang960
Last active June 3, 2021 11:58
Show Gist options
  • Select an option

  • Save jackpang960/c2ae83571e402157ff4c4b3d1ad4909d to your computer and use it in GitHub Desktop.

Select an option

Save jackpang960/c2ae83571e402157ff4c4b3d1ad4909d to your computer and use it in GitHub Desktop.
Update and upgrade the system
> sudo apt-get update -y && sudo apt-get upgrade -y
Security
> sudo ufw allow 22/tcp
> sudo ufw allow 8545/tcp
> sudo ufw allow 8545/udp
> sudo ufw allow 8546/tcp
> sudo ufw allow 8546/udp
> sudo ufw allow 30303/tcp
> sudo ufw allow 30303/udp
> sudo ufw enable
> sudo ufw status numbered
Install Go Ethereum
> sudo add-apt-repository -y ppa:ethereum/ethereum
> sudo apt-get update
> sudo apt-get install ethereum
Run Go Ethereum as a Background Service
> sudo useradd --no-create-home --shell /bin/false goerli
> sudo mkdir -p /var/lib/goethereum
> sudo chown -R goerli:goerli /var/lib/goethereum
> sudo nano /etc/systemd/system/geth.service
[Unit]
Description=Ethereum go client
After=network.target
Wants=network.target
[Service]
User=goerli
Group=goerli
Type=simple
Restart=always
RestartSec=5
ExecStart=/usr/bin/geth --goerli --syncmode "light" --cache 4096 --http --http.corsdomain "*" --http.vhosts "*" --http.addr "0.0.0.0" --ws --ws.addr "0.0.0.0" --datadir /var/lib/goethereum
[Install]
WantedBy=default.target
> sudo systemctl daemon-reload
> sudo systemctl start geth
> sudo systemctl status geth
Check the logs
> journalctl -f -u geth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment