login

Author Topic: How to setup GRSPay  (Read 74 times)

Offline jackielove4u

  • Administrator
  • Sr. Member
  • *****
  • Posts: 343
  • Groestlcoin
    • View Profile
How to setup GRSPay
« on: June 24, 2018, 04:50:54 pm »
The following were tested in Ubuntu 14.04 and Ubuntu 16.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
    • 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
      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
    • wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
    • sudo dpkg -i packages-microsoft-prod.deb
    • sudo apt-get install apt-transport-https python3-pyasn1 -y
    • sudo apt-get update
    • sudo apt-get install dotnet-sdk-2.1 -y
    • git clone https://github.com/Groestlcoin/NBXplorer
    • cd NBXplorer
    • ./build.sh
    • screen
    • ./run.sh --chains=grs --grsrpcuser yourusernamehere --grsrpcpassword yourpasswordhere
    • Crtl+o enter, ctrl X
    • git clone https://github.com/Groestlcoin/btcpayserver
    • cd btcpayserver
    • ./build.sh
    • screen
    • ./run.sh --chains=grs --externalurl=https://grspay.groestlcoin.org/
    • Crtl+o enter, ctrl X
    • sudo apt-get install nginx
    • nano /etc/nginx/sites-available/default
    • delete all and paste:
      # If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the
      # scheme used to connect to this server
      map $http_x_forwarded_proto $proxy_x_forwarded_proto {
        default $http_x_forwarded_proto;
        ''      $scheme;
      }
      # If we receive X-Forwarded-Port, pass it through; otherwise, pass along the
      # server port the client connected to
      map $http_x_forwarded_port $proxy_x_forwarded_port {
        default $http_x_forwarded_port;
        ''      $server_port;
      }
      # If we receive Upgrade, set Connection to "upgrade"; otherwise, delete any
      # Connection header that may have been passed to this server
      map $http_upgrade $proxy_connection {
        default upgrade;
        '' close;
      }
      # Apply fix for very long server names
      server_names_hash_bucket_size 128;
      # Prevent Nginx Information Disclosure
      server_tokens off;
      # Default dhparam
      # Set appropriate X-Forwarded-Ssl header
      map $scheme $proxy_x_forwarded_ssl {
        default off;
        https on;
      }
      gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
      log_format vhost '$host $remote_addr - $remote_user [$time_local] '
                       '"$request" $status $body_bytes_sent '
                       '"$http_referer" "$http_user_agent"';
      access_log off;
      server {

          server_name grspay.com;

          location / {
              proxy_pass http://localhost:23000;
              # HTTP 1.1 support
              proxy_http_version 1.1;
              proxy_buffering off;
              proxy_set_header Host $http_host;
              proxy_set_header Upgrade $http_upgrade;
              proxy_set_header Connection $proxy_connection;
              proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
              proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl;
              proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;

          }

      }
      # Mitigate httpoxy attack (see README for details)
      proxy_set_header Proxy "";
      server {
              server_name _; # This is just an invalid value which will never trigger on a real hostname.
              listen 80;
              access_log /var/log/nginx/access.log vhost;
              return 503;
      }
    • service nginx restart
    • sudo add-apt-repository ppa:certbot/certbot
    • sudo apt-get update
    • sudo apt-get install python-certbot-nginx
    • sudo certbot --nginx -d grspay.com
    • crontab -e
    • Add end of file:
      15 3 * * * /usr/bin/certbot renew --quiet
    • Crtl+o enter, ctrl X