Skip to content

Latest commit

 

History

History
118 lines (84 loc) · 1.89 KB

README.md

File metadata and controls

118 lines (84 loc) · 1.89 KB

Welcome to ckBTC-PaymentConnector!

Hello There! ✌🏽 This project implements transactions in ckBTC, a cryptocurrency based on the Bitcoin blockchain. The goal of this project is to demonstrate how transactions can be implemented in a cryptocurrency in a secure and efficient manner.

Run Locally

Docker installation

At first rename the .env-example to .env, then:

Build the image:

  npm run docker:build

Start all services:

  npm run docker:up

or

Manual installation

  npm i

Install prisma-cli:

  npm i prisma -g

We have to create a mysql container, if you want to use another instance, just change the variables in the .env file.

  npm run docker:up:db

Run migrations:

  npx prisma migrate dev

Run seeders:

  npx prisma db seed

And finally:

  npm run start:dev

API Reference

We have two kinds of endpoints here public and private.

More details in: Postman Collection

Private endpoints

Get Balance

  GET app/user-balance/:uid

Get the user balance by ckBTC from network.

Get payment status

  GET app/payment-status

Get payment status from ckBTC Network.

Get payment received

  GET app/payment-received

Check if the payment has been received.

Get payment history

  GET app/payment-history

Retrieve the payment history by user.

Create payment request

  POST app/payment-status

Create payment request to another ckBTC address.

Public endpoints

Login

  POST /login

Register

  POST /refresh

Refresh

  POST /recover

Recover

  POST /register