login

Author Topic: How to setup Groestlcoin Esplora  (Read 550 times)

Offline jackielove4u

  • Administrator
  • Sr. Member
  • *****
  • Posts: 458
  • Groestlcoin
    • View Profile
How to setup Groestlcoin Esplora
« on: March 23, 2020, 03:59:10 pm »
The following were tested in Ubuntu 16.04 and Ubuntu 18.04, some dependencies can be different in other distros.
    • aptitude update -y && aptitude upgrade -y && apt-get update -y && apt-get upgrade -y && apt-get dist-upgrade -y
    • dd if=/dev/zero of=/swapfile bs=1M count=4096
    • mkswap /swapfile
    • swapon /swapfile
    • echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
    • sudo apt-get install build-essential libssl-dev libboost-all-dev libdb5.3 libdb5.3-dev libdb5.3++-dev libtool automake libevent-dev bsdmainutils -y
    • sudo apt-get install git ntp make g++ gcc autoconf cpp ngrep iftop sysstat autotools-dev pkg-config libminiupnpc-dev libzmq3-dev -y
    • sudo apt-get install libgmp-dev libsqlite3-dev python python3 net-tools zlib1g-dev gettext
    • git clone https://github.com/groestlcoin/groestlcoin
    • cd groestlcoin
    • ./autogen.sh
    • ./configure
    • make
    • strip src/groestlcoind src/groestlcoin-cli src/groestlcoin-tx src/groestlcoin-wallet
    • sudo mv src/groestlcoind src/groestlcoin-cli src/groestlcoin-tx src/groestlcoin-wallet /usr/bin
    • mkdir ~/.groestlcoin
    • nano ~/.groestlcoin/groestlcoin.conf
    • write:
      listen=1
      server=1
      maxconnections=865
      daemon=1
      txindex=1
      rpcuser=yourusernamehere
      rpcpassword=yourpasswordhere
      whitelist=127.0.0.1
    • Crtl+o enter, ctrl X
    • groestlcoind
    • Let it sync (can take up to 2 hours), verify with groestlcoin-cli -getinfo
    • curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    • sudo apt install clang cmake -y
    • apt install cargo -y
    • git clone https://github.com/Groestlcoin/electrs/
    • cd electrs
    • git checkout blockstream
    • cargo build --release
    • screen
    • cargo run --release --bin electrs -- -vvvv --timestamp --index-batch-size=10 --jsonrpc-import --db-dir ./db --electrum-rpc-addr="127.0.0.1:50001" --cookie="yourusernamehere:yourpasswordhere" --cors '*'
    • Crtl+A, ctrl+D
    • cd ..
    • curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
    • sudo apt-get install -y nodejs
    • git clone https://github.com/Groestlcoin/esplora && cd esplora
    • npm install --unsafe-perm
    • npm run postinstall
    • NOSCRIPT_REDIR=1 CORS_ALLOW=* API_URL=https://esplora.groestlcoin.org/api/ DEST=/var/www/html npm run dist
    • screen
    • BASE_HREF=/nojs/ STATIC_ROOT=/ API_URL=http://localhost:3000/ npm run prerender-server
    • Crtl+A, ctrl+D
    • apt-get install nginx
    • nano /etc/nginx/sites-available/default
    • delete all and paste:
      upstream backend {
          server 127.0.0.1:3000;
          keepalive 300;
      }

      upstream prerenderer {
          server 127.0.0.1:5001;
          keepalive 300;
      }

      server {
          listen 80;
          server_name esplora.groestlcoin.org;
          keepalive_requests 100000;
          gzip on;
          gzip_types application/json text/plain application/xml application/javascript;
          gzip_proxied any;
          sendfile on;
          tcp_nopush on;
          tcp_nodelay on;
          keepalive_timeout 15;
          access_log off;
          root /var/www/html;
          server_tokens off;
          add_header X-Frame-Options SAMEORIGIN always;
          add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; object-src 'none'" always;
          add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
          add_header X-XSS-Protection "1; mode=block" always;
          add_header X-Content-Type-Options "nosniff" always;
          add_header Referrer-Policy "no-referrer" always;

          location /api/ {
              proxy_pass http://backend/;
              proxy_set_header Access-Control-Allow-Origin '*';
          }
          location /nojs/ {
              proxy_pass http://prerenderer/;
          }
          location = /nojs {
              return 301 " /nojs/";
          }
          location  ~ ^/((tx|block|block-height|address|assets?)/|[a-zA-Z0-9]+$) {
              expires 60m;
              if ($args = "nojs") {
              return 301 " /nojs$uri";
              }
              try_files $uri /index.html;
          }
          location = /"unused" {
              return 301 " /";
          }
          error_page 404 /notfound.html;
          location = /notfound.html {
              internal;
          }
      }
    • service nginx restart
    • sudo add-apt-repository ppa:certbot/certbot
    • sudo apt-get update
    • sudo apt-get install certbot python-certbot-nginx -y
    • certbot --nginx -d esplora.groestlcoin.org
    • crontab -e
    • Add end of file:
      15 3 * * * /usr/bin/certbot renew --quiet --nginx
    • Crtl+o enter, ctrl X
« Last Edit: July 04, 2020, 07:43:55 pm by jackielove4u »

 

anything