Skip to content

Instantly share code, notes, and snippets.

@rahulrumalla
Last active January 24, 2019 23:37
Show Gist options
  • Save rahulrumalla/24ef4513c660708476a38fd7122e5642 to your computer and use it in GitHub Desktop.
Save rahulrumalla/24ef4513c660708476a38fd7122e5642 to your computer and use it in GitHub Desktop.
Geth on Digital Ocean

Run node

geth --syncmode light --rpc --rpcapi db,eth,net,web3 --rpcaddr "0.0.0.0" --rpcport "8545"

Setup geth as a service

Create geth.service in /etc/systemd/system

Contents

[Unit]
Description=Ethereum go client

[Service]
Type=simple
ExecStart=geth --syncmode light --rpc --rpcapi db,eth,net,web3 --rpcaddr "0.0.0.0" --rpcport "8545"

[Install]
WantedBy=default.target

Run following commands to run geth as a systemd service

systemctl daemon-reload
systemctl enable geth.service
systemctl start geth.service

Validate (on server)

netstat -plnt

Make sure Foreign Address allows :::*

RPC

curl http://207.154.217.157:8545 -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment