-
Notifications
You must be signed in to change notification settings - Fork 18
Feat/btcpay support #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
d4rp4t
wants to merge
27
commits into
cashubtc:main
Choose a base branch
from
d4rp4t:feat/btcpay-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feat/btcpay support #167
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
1c93d37
interfaces, move cdk to interfaces.
d4rp4t a2e3d32
add basic btcpayserver support
d4rp4t e28c900
logs and invoice details
d4rp4t da88ff0
test: Add integration tests and infrastructure for BTCPay Server
a1denvalu3 ad98a25
ci: Add BTCPay integration workflow
a1denvalu3 41e7793
feat: Add NUT-18 POST redemption support for BTCPay
a1denvalu3 c51ba1a
handle missing cashu payment prompt
d4rp4t 4e816d4
fix rebase problems
d4rp4t feda354
change test connection uri to require read_invoice permission
d4rp4t 88fa06d
lock non-used settings while connected to btcpay
d4rp4t 4a867c6
handle expired btcpay invoices
d4rp4t 1d033a4
add more tests
d4rp4t 188db24
fix tests
d4rp4t 23255e6
fix payment state
d4rp4t 5bbaf33
add logs to btcpayserver
d4rp4t 35c11fc
fix nfc failing
d4rp4t af38859
fix btcpay invoice spam
d4rp4t 7637805
fix btcpay invoices
d4rp4t e118840
fix btcpay invoices, rebase and debug
d4rp4t e2da5ec
fix: invoice id persistence, json error handling, polling job cancel…
d4rp4t d9d59f9
fix: btcpay polling - backoff, timeout, safe resume
d4rp4t 512ae26
chore: cleanup
d4rp4t 1c359a8
fix: migrate to cdk bindings in CdkWalletProvider
d4rp4t d301411
chore: add more integration tests to btcpayserver integration
d4rp4t e9a2f8d
feat: e2e tests with cdk mint
d4rp4t 1a4e6fb
fix: CI channel setup
d4rp4t 8aeb833
fix: remove useless tests in CI
d4rp4t File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| name: BTCPay Integration Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main", "master", "feat/*", "fix/*" ] | ||
| pull_request: | ||
| branches: [ "main", "master" ] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Set up JDK 21 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '21' | ||
| distribution: 'temurin' | ||
| cache: 'gradle' | ||
|
|
||
| - name: Start BTCPay + CDK mint stack | ||
| working-directory: integration-tests/btcpay | ||
| run: docker compose up -d | ||
|
|
||
| - name: Wait for Lightning channel setup | ||
| working-directory: integration-tests/btcpay | ||
| run: | | ||
| echo "Waiting for channel-setup to complete (up to 300 s)..." | ||
| if ! timeout 300 docker compose wait channel-setup; then | ||
| echo "channel-setup failed or timed out" | ||
| docker compose logs channel-setup | ||
| docker compose logs mint_lnd | ||
| docker compose logs lnd_bitcoin | ||
| exit 1 | ||
| fi | ||
| echo "Channel setup complete." | ||
|
|
||
| - name: Wait for CDK mint to be ready | ||
| run: | | ||
| echo "Waiting for CDK mint at localhost:3338..." | ||
| for i in $(seq 1 30); do | ||
| if curl -sf http://localhost:3338/v1/info >/dev/null 2>&1; then | ||
| echo "CDK mint ready." | ||
| curl -sf http://localhost:3338/v1/info | python3 -m json.tool | ||
| break | ||
| fi | ||
| sleep 3 | ||
| done | ||
|
|
||
| - name: Provision BTCPay Server | ||
| working-directory: integration-tests/btcpay | ||
| run: | | ||
| chmod +x provision.sh | ||
| ./provision.sh | ||
| cp btcpay_env.properties ../../btcpay_env.properties | ||
|
|
||
| - name: Run BTCPay integration tests | ||
| run: | | ||
| chmod +x gradlew | ||
| ./gradlew testDebugUnitTest \ | ||
| --tests "com.electricdreams.numo.core.payment.impl.BtcPayPaymentServiceIntegrationTest.*" \ | ||
| --no-daemon --console=plain | ||
|
|
||
| - name: Dump logs on failure | ||
| if: failure() | ||
| working-directory: integration-tests/btcpay | ||
| run: | | ||
| echo "=== cdk-mint ===" | ||
| docker compose logs cdk-mint | tail -100 | ||
| echo "=== mint_lnd ===" | ||
| docker compose logs mint_lnd | tail -50 | ||
| echo "=== customer_lnd ===" | ||
| docker compose logs customer_lnd | tail -50 | ||
| echo "=== channel-setup ===" | ||
| docker compose logs channel-setup | ||
| echo "=== btcpayserver ===" | ||
| docker compose logs btcpayserver | tail -100 | ||
|
|
||
| - name: Cleanup | ||
| if: always() | ||
| working-directory: integration-tests/btcpay | ||
| run: docker compose down -v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,3 +15,4 @@ release | |
| opencode.json | ||
| .kotlin/ | ||
| .opencode/ | ||
| btcpay_env.properties | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.