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 Boltz

Started by jackielove4u, July 15, 2020, 10:18:32 AM

Previous topic - Next topic

jackielove4u

The following were tested in Ubuntu 18.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 jq -y
    • 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 src/groestlcoin-util
    • sudo mv src/groestlcoind src/groestlcoin-cli src/groestlcoin-tx src/groestlcoin-wallet src/groestlcoin-util /usr/bin
    • mkdir ~/.groestlcoin
    • nano ~/.groestlcoin/groestlcoin.conf
    • write:
      listen=1
      server=1
      maxconnections=863
      daemon=1
      txindex=1
      blockfilterindex=1
      coinstatsindex=1
      rpcuser=yourusernamehere
      rpcpassword=yourpasswordhere
      rest=1
      rpcallowip=0.0.0.0/0
      zmqpubrawblock=tcp://127.0.0.1:21441
      zmqpubrawtx=tcp://127.0.0.1:21331
    • 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=Boltz
      restlisten=127.0.0.1:8080
      listen=0.0.0.0:9735

      [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
    • cd\
    • apt install curl -y
    • curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
    • sudo apt-get install nodejs -y
    • sudo apt-get install rsync grsync -y
    • git clone https://github.com/Groestlcoin/boltz-backend
    • cd boltz-backend
    • npm install
    • npm run compile
    • mkdir ~/.boltz
    • nano ~/.boltz/boltz.conf
    • write:
      configpath = "/root/.boltz/boltz.conf"
      dbpath = "/root/.boltz/boltz.db"
      logpath = "/root/.boltz/boltz.log"
      datadir = "/root/.boltz"

      # This mnemonic is not for the wallet that holds the onchain coins
      # but the claim and refund keys are derived from it
      mnemonicpath = "/root/.boltz/seed.dat"

      # Possible values are: error, warning, info, verbose, debug, silly
      loglevel = "debug"

      # This value configures the type of the lockup address of normal Submarine Swaps:
      #   - false: P2SH nested P2WSH
      #   - true: P2WSH
      swapwitnessaddress = true

      # Enables the prepay minerfee Reverse Swap procotol
      # If this value is "true", an invoice for the miner fee has to be paid
      # before hold invoice of the Revese Swap
      prepayminerfee = true

      # This is the REST API that should be exposed to the public
      # It does not support HTTPS but only plaintext HTTP. A reverse
      # proxy should be setup with a web server like Nginx
      [api]
      host = "127.0.0.1"
      port = 9_001

      # And this the gRPC API that is used by the boltz-cli executable
      [grpc]
      host = "127.0.0.1"
      port = 9_000
      certpath = "/root/.boltz/tls.cert"
      keypath = "/root/.boltz/tls.key"

      # The interval in seconds at which new rates for pairs that
      # do not have a hardcoded rate should be updates
      [rates]
      interval = 1

      # The Boltz Backend allows for backing up the LND channel backups and
      # the database to a Google Cloud Storage Bucket
      [backup]
      email = ""
      privatekeypath = ""
      bucketname = ""
      # Cron interval at which a new backup should be uploaded. The default value is daily
      interval = "0 0 * * *"

      # The Boltz backend supports sending messages to Discord after successful and failed
      # Swaps and if the wallet or channel balance is underneath a configurable threshold
      [notification]
      token = ""
      channel = ""
      prefix = ""
      # Interval in minutes at which the wallet and channel balances should be checked
      interval = 1
      # Some Discord commands (like withdraw) require a TOTP token
      # This is the path to the secret of that TOTP token
      otpsecretpath = "/root/.boltz/otpSecret.dat"

      # The array "pairs" configures the trading pairs that Boltz should support
      # A pair can have the following options:
      # - "base" (required): base currency
      # - "quote" (required): quote currency
      # - "timeoutDelta": after how many minutes a Swap of that pair should timeout
      # - "rate": the rate for a pair can be hardcoded (only sensible for same currency pairs); 
      #           if the rate is not hardcoded the mean value from these exchanges will be used:
      #             - Binance
      #             - Bitfinex
      #             - Coinbase Pro
      #             - Kraken
      #             - Poloniex
      # - "fee": percentage of the swapped amount that should be charged as fee

      [[pairs]]
      base = "GRS"
      quote = "GRS"
      rate = 1
      timeoutDelta = 400
      fee = 0

      # The array "currencies" configures the chain and LND clients for the "pairs"
      # Not configuring the LND client is possible but will cause that chain not to support Lightning
      # The values are pretty self explainatory apart from: "minWalletBalance" and "minChannelBalance" which trigger
      # a Discord notification

      [[currencies]]
      symbol = "GRS"
      network = "bitcoinMainnet"
      minWalletBalance = 10_000_000
      minChannelBalance = 10_000_000
      maxSwapAmount = 10_000_000
      minSwapAmount = 10_000
      maxZeroConfAmount = 10_000_000

        [currencies.chain]
        host = "127.0.0.1"
        port = 14_41
        rpcuser = "yourusernamehere"
        rpcpass = "yourpasswordhere"

        [currencies.lnd]
        host = "127.0.0.1"
        port = 10_009
        certpath = "/root/.lnd-grs/tls.cert"
        macaroonpath = "/root/.lnd-grs/data/chain/groestlcoin/mainnet/admin.macaroon"
    • screen
    • npm run start
    • 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 swaps.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/swaps.groestlcoin.org/fullchain.pem;
          ssl_certificate_key /etc/letsencrypt/live/swaps.groestlcoin.org/privkey.pem;
         
          server_name swaps.groestlcoin.org;

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

          location / {
              proxy_pass http://localhost:9001;
              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;
          }
      }
    • Crtl+o enter, ctrl X
    • service nginx restart
    • nano /etc/letsencrypt/cli.ini
    • Add:
      deploy-hook = systemctl reload nginx
    • Crtl+o enter, ctrl X