login

Author Topic: How to setup Blockbook  (Read 195 times)

Offline jackielove4u

  • Administrator
  • Sr. Member
  • *****
  • Posts: 373
  • Groestlcoin
    • View Profile
How to setup Blockbook
« on: October 18, 2018, 10:38:35 pm »
The following were tested in Debian 9, some dependencies can be different in other distros
    • 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
    • apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common git
    • curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
    • add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
    • apt-get update
    • apt-get install docker-ce -y
    • git clone https://github.com/trezor/blockbook
    • cd blockbook
    • make all-groestlcoin
    • cd build
    • apt install ./blockbook-g*deb ./backend-g*deb -y
    • systemctl start backend-groestlcoin
    • cd /
    • cd /opt/coins/data/groestlcoin/backend
    • wait till deamon is synced (check with: tail debug.log)
    • systemctl restart backend-groestlcoin
    • systemctl enable backend-groestlcoin
    • screen
    • while true; do date; systemctl restart blockbook-groestlcoin; sleep 60; done
    • Crtl+A, ctrl+D
    • cd /
    • cd /opt/coins/blockbook/groestlcoin/logs/
    • wait till blockbook is synced (check with: tail blockbook.INFO)
    • systemctl enable blockbook-groestlcoin
    • sudo apt-get install certbot
    • certbot certonly --standalone -d blockbook.groestlcoin.org
    • crontab -e
    • Add end of file:
      15 3 * * * /usr/bin/certbot renew --quiet
    • Crtl+o enter, ctrl X
    • systemctl restart blockbook-groestlcoin
    • apt-get install nginx
    • nano /etc/nginx/sites-available/default
    • delete all and paste:
      server {
          listen 80;
          listen 443 ssl;
          ssl_certificate /etc/letsencrypt/live/blockbook.groestlcoin.org/fullchain.pem;
          ssl_certificate_key /etc/letsencrypt/live/blockbook.groestlcoin.org/privkey.pem;

          server_name blockbook.groestlcoin.org;

          # force https-redirects
          if ($scheme = http) {
              return 301 https://blockbook.groestlcoin.org$request_uri;
          }

          location / {
              proxy_pass https://localhost:9145;
              proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header Host $http_host;
              proxy_set_header X-NginX-Proxy true;

              # Enables WS support
              proxy_http_version 1.1;
              proxy_set_header Upgrade $http_upgrade;
              proxy_set_header Connection "upgrade";
              proxy_redirect off;
          }
      }
    • systemctl reload nginx
« Last Edit: January 29, 2019, 02:29:07 pm by jackielove4u »