8000 GitHub - 40acres/40swap
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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 t 9618 he 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/nodes-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

Code Formatting

This project uses Prettier and ESLint for consistent code formatting and linting.

Available Commands

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.

Releases

No releases published

Packages

No packages published

Contributors 8

0