Skip to content

BrantaOps/btcpay

Repository files navigation

Branta

Branta BTCPay Plugin

A template for your own BTCPay Server plugin.

Learn more in our plugin documentation.

Local Development

Dependencies

Project Setup

git clone git@github.com:BrantaOps/btcpay.git --recurse-submodules btcpayserver-plugin-branta

Folder structure should look like

branta-btcpayserver # (root)
|_ btcpayserver
|_ btcpayserver-plugin-branta
  |_ btcpayserver
  |_ BTCPayServer.Plugins.Branta

Migrations

  • Set Branta.Migrations project as the Startup Project (not in source control)
  • Set BTCPayServer.Plugins.Branta as the Default Project
  • Run migration Add-Migration -c BrantaDbContext "<Migration-Name-Here>"

Install Plugin

To install the plugin you can either Reference in Project or Generate .btcpay File

Reference in Project

  1. Reference plugin project
# Enter the forked BTCPay Server repository
cd btcpayserver

# Add your plugin to the solution
dotnet sln add ../btcpayserver-plugin-branta/BTCPayServer.Plugins.Branta -s Plugins
  1. Create appsettings.dev.json file

Path: branta-btcpayserver/btcpayserver/BTCPayServer/appsettings.dev.json

{
  "DEBUG_PLUGINS": "/absolute/path/btcpayserver-plugin-branta/BTCPay.Plugins.Branta/bin/Debug/net6.0/BTCPayServer.Plugins.Branta.dll"
}

Generate .btcpay File

  1. Follow commands in BTCPayServer.Plugins.Branta/Makefile for your operating system to generate .btcpay file
  2. When running BTCPayServer project on the left nav click the "Manage Plugins" link
  3. Scroll to the bottom you will see "Upload Plugin" option

Run the project

  1. Run docker
cd btcpayserver/BTCPayServer.Tests
docker-compose up dev
  1. Run the application in Debug
cd btcpayserver/BTCPayServer
dotnet run -c Debug