XCH Payment Install

11 steps to set up a payment gateway in CHIA coins based on BTCPay server

So you already have access to a server with at least UBUNTU 20.4, 2 Gb of RAM and a 50 Gb drive.

Access your server via terminal: ssh root@YOUR_DOMAIN
For beginners: when entering your password, you may be surprised that the cursor stays in place and seems unresponsive. Ignore this, it should be.

Next, copy the command lines and run them one by one in the terminal.
Carefully wait for the previous process to complete before executing the following command

1. Install:
apt update; apt install -y screen vim curl software-properties-common

2. Docker install:
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh

add-apt-repository -y ppa:ondrej/nginx-mainline
apt install -y nginx certbot python3-certbot-nginx

3. Follow the instructions, get a certificate: replace YOUR_DOMAIN and start command:
certbot certonly --nginx -d YOUR_DOMAIN

4. Copy code in your text editor and replace your domain in 6 places:

server {
    listen 0.0.0.0:80;
    server_name YOUR_DOMAIN www.YOUR_DOMAIN;
    access_log off;
    error_log off;
    return 301 https://YOUR_DOMAIN$request_uri;
} # server domain return.

server {
    listen                     443 ssl;
    http2 on;
    ssl_certificate            /etc/letsencrypt/live/YOUR_DOMAIN/fullchain.pem;
    ssl_certificate_key        /etc/letsencrypt/live/YOUR_DOMAIN/privkey.pem;

    root                       /var/www;
    index                      index.html index.htm index.nginx-debian.html;
    server_name                YOUR_DOMAIN;

    location / {
        proxy_pass             http://localhost:11800;
        proxy_set_header       Host $host;
        proxy_set_header       X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header       X-Real-IP $remote_addr;
        proxy_set_header       X-Forwarded-Proto $scheme;
    }
    location ~ /.well-known {
        allow                  all;
    }
}


5. Use the vim editor to modify the contents of the configuration file.
You need to remove the code completely or replace it with comments, and then insert our code:

sudo vim /etc/nginx/sites-enabled/default

Edit by vim:
By double pressing the “d” key, you can delete an entire line.
dd – delete line
To save the file and close the editor, use the following keys:
esc :wq! ENTER – save & exit
or esc :q! Enter to escape without save

6. Make reboot ngonx:
systemctl restart nginx

6a. you can check if there is an error in the code:
sudo nginx -t

7. xhc-docker install:
git clone https://github.com/mintgarden-io/btcpayserver-docker
cd btcpayserver-docker

8. Replace with your domain name, copy, paste and confirm the command with the Enter key.
Do the same with all other lines. You do not need to change anything in them

export BTCPAY_HOST="YOUR_DOMAIN" # replace to YOUR DOMAIN
export BTCPAY_IMAGE="ghcr.io/mintgarden-io/btcpayserver:master"
export NBITCOIN_NETWORK="mainnet"
export BTCPAYGEN_CRYPTO1="xch"
export BTCPAYGEN_ADDITIONAL_FRAGMENTS="chia"
export BTCPAYGEN_EXCLUDE_FRAGMENTS="opt-add-tor;bitcoin"
export BTCPAYGEN_REVERSEPROXY="nginx"
export REVERSEPROXY_HTTPS_PORT="14443"
export REVERSEPROXY_HTTP_PORT="11800"
export BTCPAY_ENABLE_SSH=false

9. Start Install:
. ./btcpay-setup.sh -i

10. CHIA wallet add:

cd btcpayserver-docker

docker-compose -f Generated/docker-compose.generated.yml exec chia chia keys add

Take 24 mnemonic words out of your NEW wallet

11. Restart:
./btcpay-restart.sh

XCH payment is Ready!

Did you do well? As a token of gratitude, buy us a cup of coffee. At the same time, check out the principle of paying with chia coins: