Skip to content

Latest commit

 

History

History
83 lines (55 loc) · 2.75 KB

README.md

File metadata and controls

83 lines (55 loc) · 2.75 KB

BTCPay App

Setup for development

Here's what needs to happen to run the app in the browser:

# Clone the app repo
git clone git@github.com:btcpayserver/app.git

# Switch to it
cd app

# Initialize the server submodule
git submodule init && git submodule update --recursive

# Install the workloads
dotnet workload restore

# Go to the server submodule
cd submodules/btcpayserver/BTCPayServer.Tests

# Verify you are on the `mobile-working-branch` branch
git branch --show current

# If not, check it out
git checkout mobile-working-branch

# Run the server
docker-compose up dev

Now you can open up the IDE and run DEV ALL profile which builds both the App and the BTCPay Server.

The app should open in the browser and you should see the Welcome screen. Click the Connect button, use http://localhost:14142 as the server URL and an existing account for the server.

Troubleshooting

After the first run of DEV ALL on a Linux machine with a new .NET setup, you may run into the dotnet dev-certs - Untrusted Root error, and you may find a solution at the following link

Missing dependencies in development environment

If BTCPay Server does nopt start up with the app and its dependencies, add the file submodules/btcpayserver/BTCPayServer/appsettings.dev.json with the following content:

{ "DEBUG_PLUGINS": "FULL_PATH_TO_PROJECT_DIRECTORY/BTCPayServer.Plugins.App/bin/Debug/net8.0/BTCPayServer.Plugins.App.dll" }

Note that you need to replace the FULL_PATH_TO_PROJECT_DIRECTORY.

cd BTCPayServer.Plugins.App
dotnet publish -o bin/Debug/net8.0/

Lightning Channels

To establish channels for local testing, you can use the Docker Lightning CLI scripts like this:

# The scripts are inside the submodule's test directory
cd submodules/btcpayserver/BTCPayServer.Tests

# Run the general channel setup for the BTCPay LN nodes
./docker-lightning-channel-setup.sh

Besides establishing channel connections between the various BTCPay LN testing nodes, this will also give you their node URIs.

Create channel

  • App: Go to the Lightning Channels view and connect to one of the peer node URIs from the comand above
  • App: Open Channel to that peer
  • CLI: Run ./docker-bitcoin-generate.sh 5
  • App: Refresh the Lightning Channels view and see if the channel got confirmed
  • App: Go to the Send view and see if your Lightning local/outbound capacity is present

Send payment

  • CLI: Generate an invoice with the peer script, e.g. ./docker-customer-lncli.sh addinvoice --amt 10000
  • App: Pay the Lightning invoice on the Send view