- node 22.x (and npm)
- docker
- docker compose
- Install all the dependencies from t 9618 he root folder
npm install --workspaces
- Start services with docker compose
cd server-backend/dev
docker compose up
- Initialize blockchain and lightning nodes
server-backend/dev/nodes-setup.sh
- Build shared module
cd shared
npm run build
- Start backend
cd server-backend
npm run start:dev
- Start frontend
cd swap-frontend
npm run start:dev
- Open http://localhost:7080 in your browser
- You can check the API's' Swagger at http://localhost:7081/docs
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
This project uses Prettier and ESLint for consistent code formatting and linting.
You can use the following npm scripts from the root directory:
# Format all code
npm run format
# Check code formatting without making changes
npm run format:check
# Run linting
npm run lint
# Automatically fix linting issues
npm run lint:fix
Alternatively, you can use the Just commands:
# Format code
just format
# Check code formatting
just check-format
# Run linter
just lint
# Check linting
just check-lint
VS Code will also respect our formatting settings if you're using the editor's built-in formatting capabilities.