Skip to content

dotbitHQ/das-pay

Repository files navigation

das-pay

Build & run with das-register. Support CKB, TRX, BNB, ETH and Matic to pay the registration fee.

Prerequisites

Install & Run

Source Compile

# get the code
git clone https://github.com/dotbitHQ/das-pay.git

# edit config/config.yaml and run das-database and init db of das-register before run das_pay_server

# compile and run
cd das-pay
make pay
./das_pay_server --config=config/config.yaml

Docker

  • docker >= 20.10
  • docker-compose >= 2.2.2
sudo curl -L "https://github.com/docker/compose/releases/download/v2.2.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose up -d

if you already have a mysql installed, just run

docker run -dv $PWD/config/config.yaml:/app/config/config.yaml --name das-pay-server dotbitteam/das-pay:latest

Usage

Set the gateway address of each chain in conf/config.yaml ( private, the private key of address, is for refund). The whole workflow as below:

                ┌───────┐
                │ start │
                └───┬───┘
                    │
                    │
                    │
        ┌───────────▼───────────┐
┌───────┤       sync block?     │◄─┬───┐
│       │ CKB/ETH/BSC/TRX/MATIC │  │   │
│       └───────────┬───────────┘  │   │
│                   │              │   │
│                   Y              │   │
│                   │              │   │
│         ┌─────────▼──────────┐   │   │
│         │ parse txs in block │   │   │
│         └─────────┬──────────┘   │   │
│                   │              │   │
│                   │              │   │
│                   │              N   │
N                   │              │   │
│         ┌─────────▼──────────┐   │   │
│         │ pay for the order? ├───┘   │
│         └─────────┬──────────┘       │
│                   │                  │
│                   Y                  │
│                   │                  │
│                   │                  │
│       ┌───────────▼─────────────┐    │
│       │ update the order status ├────┘
│       └─────────────────────────┘
│
│
│
│
│               ┌───────┐
└──────────────►│  end  │
                └───────┘

Documents