2

Author Topic: How to setup Blockbook for testnet  (Read 57 times)

Offline jackielove4u

  • Administrator
  • Sr. Member
  • *****
  • Posts: 360
  • Groestlcoin
    • View Profile
How to setup Blockbook for testnet
« on: October 18, 2018, 10:39:55 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
    • git clone https://github.com/groestlcoin/groestlcoin
    • cd groestlcoin
    • ./autogen.sh
    • ./configure
    • make
    • strip src/groestlcoind src/groestlcoin-cli src/groestlcoin-tx
    • sudo mv src/groestlcoind src/groestlcoin-cli src/groestlcoin-tx /usr/bin
    • mkdir ~/.groestlcoin
    • nano ~/.groestlcoin/groestlcoin.conf
    • write:
      listen=1
      server=1
      maxconnections=865
      daemon=1
      txindex=1
      rpcuser=yourusernamehere
      rpcpassword=yourpasswordhere
    • Crtl+o enter, ctrl X
    • groestlcoind -testnet
    • Let it sync (can take up to 1 hour), verify with groestlcoin-cli -testnet -getinfo
    • cd ~
    • 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 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 /
    • 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 /
    • 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
    • cp /etc/letsencrypt/live/blockbook-test.groestlcoin.org/privkey.pem /opt/coins/blockbook/groestlcoin_testnet/cert/blockbook.key
    • cp /etc/letsencrypt/live/blockbook-test.groestlcoin.org/cert.pem /opt/coins/blockbook/groestlcoin_testnet/cert/blockbook.crt
    • crontab -e
    • Add end of file:
      15 3 * * * /usr/bin/certbot renew --quiet
    • 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 /opt/coins/blockbook/groestlcoin_testnet/cert/blockbook.crt;
          ssl_certificate_key /opt/coins/blockbook/groestlcoin_testnet/cert/blockbook.key;

          server_name blockbook-test.groestlcoin.org;

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

          location / {
              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