Git Product home page Git Product logo

geth-nginx's Introduction

go-ethereum mode

A small NGINX recipe that makes Geth’s RPC and Websocket interface remotely accessible on a node. With this config RPC becomes remotely accessible at http://{SERVER_IP}/rpc and websockets at http://{SERVER_IP}/ws.

First start and sync a node on the device with the RPC and websocket endpoints opened, you can use the following command:

./geth --cache 4096 --rpc --rpcaddr "127.0.0.1" --rpccorsdomain "*" --rpcport "8545" --rpcapi "db, eth, net, web3, personal" --ws --wsport 8546 --wsaddr "127.0.0.1" --wsorigins "*" --wsapi "web3, eth" --maxpeers=100

see more details in the /geth directory

Install

#!/bin/bash
#Navigate to your NGINX configuration directory on your server:
cd /etc/nginx

#Create a backup of your current NGINX configuration:
tar -czvf nginx_$(date +'%F_%H-%M-%S').tar.gz nginx.conf sites-available/ sites-enabled/ www/

#Extract the new compressed configuration archive using tar:
tar -xzvf www-backbonecabal.net.tar.gz

#Create a common ACME-challenge directory (for Let's Encrypt):
mkdir -p /var/www/_letsencrypt
chown nginx /var/www/_letsencrypt

#Comment out SSL related directives in the configuration:

sed -i -r 's/(listen .*443)/\1;#/g; s/(ssl_(certificate|certificate_key|trusted_certificate) )/#;#\1/g' /etc/nginx/sites-available/backbonecabal.net.conf
#Reload your NGINX server:

sudo nginx -t && sudo systemctl reload nginx
#Obtain SSL certificates from Let's Encrypt using Certbot:

certbot certonly --webroot -d backbonecabal.net -d www.backbonecabal.net -d cdn.backbonecabal.net --email [email protected] -w /var/www/_letsencrypt -n --agree-tos --force-renewal
#Uncomment SSL related directives in the configuration:

sed -i -r 's/#?;#//g' /etc/nginx/sites-available/backbonecabal.net.conf
#Reload your NGINX server:

sudo nginx -t && sudo systemctl reload nginx
#Configure Certbot to reload NGINX when it successfully renews certificates:
echo -e '#!/bin/bash\nnginx -t && systemctl reload nginx' | sudo tee /etc/letsencrypt/renewal-hooks/post/nginx-reload.sh
sudo chmod a+x /etc/letsencrypt/renewal-hooks/post/nginx-reload.sh
sudo nginx -t && sudo systemctl reload nginx

geth-nginx's People

Contributors

renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jtrag

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.