Author Topic: How to setup LNDHUB  (Read 331 times)

Offline jackielove4u

  • Administrator
  • Sr. Member
  • *****
  • Posts: 458
  • Groestlcoin
    • View Profile
How to setup LNDHUB
« on: May 15, 2020, 05:06:12 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
    • 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
      externalip=YourIpAddressHere
      deprecatedrpc=accounts
      minrelaytxfee=0.00000000
      incrementalrelayfee=0.00000010
      zmqpubrawblock=tcp://127.0.0.1:21441
      zmqpubrawtx=tcp://127.0.0.1:21331
      rpcport=1441
    • Crtl+o enter, ctrl X
    • groestlcoind
    • Let it sync (can take up to 2 hours), verify with groestlcoin-cli -getinfo
    • wget https://github.com/Groestlcoin/lnd/releases/download/v0.10.0-grs/lnd-linux-amd64-v0.10.0-grs.tar.gz
    • tar -zxvf lnd-linux-amd64-v0.10.0-grs.tar.gz
    • cd lnd-linux-amd64-v0.10.0-grs
    • mkdir ~/.lnd-grs/
    • nano ~/.lnd-grs/lnd.conf
    • write:
      [Application Options]
      ; set external IP if not using NAT
      externalip=YourIpAddressHere
      ; set node alias (seen in explorers)
      alias=LNDHUB
      restlisten=localhost:8080

      [Groestlcoin]
      groestlcoin.active=1
      groestlcoin.mainnet=1
      groestlcoin.node=groestlcoind

      [Groestlcoind]
      groestlcoind.rpcuser=yourusernamehere
      groestlcoind.rpcpass=yourpasswordhere
      groestlcoind.zmqpubrawblock=tcp://127.0.0.1:21441
      groestlcoind.zmqpubrawtx=tcp://127.0.0.1:21331
    • Crtl+o enter, ctrl X
    • screen
    • ./lnd
    • ctrl+d and ctrl+a
    • ./lncli create
    • ./lncli unlock
    • sudo apt install redis-server -y
    • sudo nano /etc/redis/redis.conf
    • change `supervised no` to `supervised systemd`
    • change `appendonly no` to `appendonly yes`
    • Crtl+o enter, ctrl X
    • cd\
    • sudo apt install nodejs npm
    • git clone https://github.com/Groestlcoin/LndHub
    • cp .lnd-grs/data/chain/groestlcoin/mainnet/admin.macaroon LndHub/
    • cp .lnd-grs/tls.cert LndHub/
    • sudo nano config.js
    • delete all and paste:
      let config = {
        bitcoind: {
          rpc: 'http://yourusernamehere:yourpasswordhere@127.0.0.1:1441',
        },
        redis: {
          port: 6379,
          host: '127.0.0.1',
          family: 4,
          password: 'password',
          db: 0,
        },
        lnd: {
          url: '127.0.0.1:10009',
          password: '',
        },
      };

      if (process.env.CONFIG) {
        console.log('using config from env');
        config = JSON.parse(process.env.CONFIG);
      }

      module.exports = config;
    • Crtl+o enter, ctrl X
    • npm install
    • npm install -g babel-cli
    • mkdir build
    • babel ./ --out-dir ./build --copy-files --ignore node_modules
    • screen
    • node build/index.js
    • ctrl+d and ctrl+a
    • cd ..
    • sudo add-apt-repository ppa:certbot/certbot
    • sudo apt-get update
    • sudo apt-get install certbot
    • certbot certonly --standalone -d lndhub.groestlcoin.org
    • crontab -e
    • Add end of file:
      15 3 * * * /usr/bin/certbot renew --quiet
    • Crtl+o enter, ctrl X
    • 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/lndhub.groestlcoin.org/fullchain.pem;
          ssl_certificate_key /etc/letsencrypt/live/lndhub.groestlcoin.org/privkey.pem;
         
          server_name lndhub.groestlcoin.org;

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

          location / {
              proxy_pass http://localhost:3000;
              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;
          }
      }
    • service nginx restart
« Last Edit: July 15, 2020, 10:19:21 am by jackielove4u »

 

anything