Skip to content

40acres/40swap

Repository files navigation

40swap logo


Local dev environment

Pre-requisites

  1. node 22.x (and npm)
  2. docker
  3. docker compose

Instructions

  1. Install all the dependencies from the root folder
npm install --workspaces
  1. Start services with docker compose
cd server-backend/dev
docker compose up
  1. Initialize blockchain and lightning nodes
server-backend/dev/lightning-setup.sh
  1. Build shared module
cd shared
npm run build
  1. Start backend
cd server-backend
npm run start:dev
  1. Start frontend
cd swap-frontend
npm run start:dev
  1. Open http://localhost:7080 in your browser
  2. You can check the API's' Swagger at http://localhost:7081/docs

Testing

By sourcing server-backend/dev/dev-aliases.sh you can get access to some useful commands, e.g.:

source server-backend/dev/dev-aliases.sh
# mine N blocks
40swap-bitcoin-cli -generate $N
# pay lightning invoice from user node      
40swap-user-lncli payinvoice $INVOICE
# send bitcoins to adddress
40swap-bitcoin-cli -named sendtoaddress address=$ADDR amount=$AMOUNT fee_rate=25