News:

Be careful when downloading software.
Make sure to download only from official sources:
Official Groestlcoin Clients for Win, Mac, Linux

Main Menu

How to setup Blockbook for testnet

Started by jackielove4u, October 18, 2018, 10:39:55 PM

Previous topic - Next topic

jackielove4u

The following were tested in Debian 11, 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
    • apt-get install build-essential libssl-dev libboost-all-dev libdb5.3 libdb5.3-dev libdb5.3++-dev libtool automake libevent-dev bsdmainutils -y
    • 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 screen -y
    • 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 deb-backend-groestlcoin_testnet deb-blockbook-groestlcoin_testnet
    • cd build
    • apt install ./blockbook-g*deb ./backend-g*deb -y
    • systemctl start backend-groestlcoin-testnet
    • cd /opt/coins/data/groestlcoin_testnet/backend/testnet3
    • wait till deamon is synced (check with: tail debug.log)
    • systemctl restart backend-groestlcoin-testnet
    • systemctl enable backend-groestlcoin-testnet
    • systemctl start blockbook-groestlcoin-testnet
    • cd /opt/coins/blockbook/groestlcoin_testnet/logs/
    • wait till blockbook is synced (check with: tail blockbook.INFO)
    • systemctl enable blockbook-groestlcoin-testnet
    • sudo apt-get install certbot
    • certbot certonly --standalone -d blockbook-test.groestlcoin.org
    • crontab -e
    • Add end of file:
      14 3 * * * /usr/sbin/service nginx stop
      15 3 * * * /usr/bin/certbot renew --quiet
      16 3 * * * /usr/sbin/service nginx start
    • Crtl+o enter, ctrl X
    • systemctl restart blockbook-groestlcoin-testnet
    • 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-test.groestlcoin.org/fullchain.pem;
          ssl_certificate_key /etc/letsencrypt/live/blockbook-test.groestlcoin.org/privkey.pem;

          server_name blockbook-test.groestlcoin.org;

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

          location / {
              add_header Access-Control-Allow-Origin '*' always;
              proxy_pass https://localhost:19145;
              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