geth --syncmode light --rpc --rpcapi db,eth,net,web3 --rpcaddr "0.0.0.0" --rpcport "8545"
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
netstat -plnt
Make sure Foreign Address allows :::*
curl http://207.154.217.157:8545 -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'