From a441d0aaf121b4e7e86eea47a9fd9e456c24439c Mon Sep 17 00:00:00 2001 From: gudnuf Date: Fri, 29 Aug 2025 18:56:07 -0700 Subject: [PATCH 1/7] start and stop cdk --- .github/workflows/ci.yml | 50 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 124420f00..37627e829 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,56 @@ jobs: - name: Run Unit Tests run: bun test + integration-tests: + name: "Integration Tests" + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Run cdk-mintd Docker Container + run: | + docker run -d --name cdk-mintd -p 8085:8085 \ + -e CDK_MINTD_LISTEN_HOST=0.0.0.0 \ + -e CDK_MINTD_LISTEN_PORT=8085 \ + -e CDK_MINTD_LN_BACKEND=fakewallet \ + cashubtc/mintd:latest-amd64 + + - name: Wait for Mint to Start + run: | + echo "Waiting for mint to start..." + for i in {1..30}; do + if curl -f -s http://localhost:8085/v1/info >/dev/null; then + echo "Mint is ready!" + break + fi + echo "Attempt $i: Mint not ready, waiting 2 seconds..." + sleep 2 + done + + - name: Test Mint Info Endpoint + run: | + echo "Testing mint /v1/info endpoint..." + response=$(curl -s http://localhost:8085/v1/info) + echo "Response: $response" + + # Verify the response contains expected fields + if echo "$response" | grep -q '"name"' && echo "$response" | grep -q '"version"'; then + echo "✅ Mint info endpoint is working correctly" + else + echo "❌ Mint info endpoint response is invalid" + exit 1 + fi + + - name: Cleanup + if: always() + run: | + docker stop cdk-mintd || true + docker rm cdk-mintd || true + # e2e-tests: # name: "E2E Tests" # timeout-minutes: 20 From 48ecd3d7c720f588427b765a2c265d886dee5a5f Mon Sep 17 00:00:00 2001 From: gudnuf Date: Fri, 29 Aug 2025 19:06:54 -0700 Subject: [PATCH 2/7] update ci --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37627e829..d7a6c7951 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,13 +50,40 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Create Mint Configuration + run: | + cat > config.toml << EOF + [info] + listen_host = "0.0.0.0" + listen_port = 8085 + + [ln] + ln_backend = "fakewallet" + + [fake_wallet] + supported_units = ["sat"] + fee_percent = 0.02 + reserve_fee_min = 1 + min_delay_time = 1 + max_delay_time = 3 + + [database] + engine = "sqlite" + EOF + - name: Run cdk-mintd Docker Container run: | docker run -d --name cdk-mintd -p 8085:8085 \ - -e CDK_MINTD_LISTEN_HOST=0.0.0.0 \ - -e CDK_MINTD_LISTEN_PORT=8085 \ - -e CDK_MINTD_LN_BACKEND=fakewallet \ - cashubtc/mintd:latest-amd64 + -v $(pwd)/config.toml:/config.toml \ + cashubtc/mintd:latest-amd64 \ + cdk-mintd --config /config.toml + + - name: Check Container Status and Logs + run: | + echo "Container status:" + docker ps -a --filter name=cdk-mintd + echo "Container logs:" + docker logs cdk-mintd - name: Wait for Mint to Start run: | @@ -69,6 +96,13 @@ jobs: echo "Attempt $i: Mint not ready, waiting 2 seconds..." sleep 2 done + + # If we get here and the mint still isn't ready, show final logs + if ! curl -f -s http://localhost:8085/v1/info >/dev/null; then + echo "Final container logs:" + docker logs cdk-mintd + exit 1 + fi - name: Test Mint Info Endpoint run: | From bbfe1ec24511cd8e651f416d89527b690d543664 Mon Sep 17 00:00:00 2001 From: gudnuf Date: Fri, 29 Aug 2025 19:28:25 -0700 Subject: [PATCH 3/7] update ci --- .github/workflows/ci.yml | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7a6c7951..de19923fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,21 +54,33 @@ jobs: run: | cat > config.toml << EOF [info] + url = "https://mint.thesimplekid.dev/" listen_host = "0.0.0.0" listen_port = 8085 + mnemonic = "inherit paddle hybrid panic inform best receive noise whale dizzy virtual west" - [ln] - ln_backend = "fakewallet" + [info.logging] + + [mint_management_rpc] + enabled = false + + [info.http_cache] + backend = "memory" + ttl = 60 + tti = 60 - [fake_wallet] - supported_units = ["sat"] - fee_percent = 0.02 - reserve_fee_min = 1 - min_delay_time = 1 - max_delay_time = 3 + [mint_info] [database] engine = "sqlite" + + [ln] + ln_backend = "fakewallet" + + [cln] + rpc_path = "" + fee_percent = 0.04 + reserve_fee_min = 4 EOF - name: Run cdk-mintd Docker Container From b40b59531045bf77ee748f926638e070ec05f05b Mon Sep 17 00:00:00 2001 From: gudnuf Date: Fri, 29 Aug 2025 19:32:44 -0700 Subject: [PATCH 4/7] update ci --- .github/workflows/ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de19923fc..fff19f2db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,10 +77,12 @@ jobs: [ln] ln_backend = "fakewallet" - [cln] - rpc_path = "" - fee_percent = 0.04 - reserve_fee_min = 4 + [fake_wallet] + supported_units = ["sat", "usd"] + fee_percent = 0.02 + reserve_fee_min = 1 + min_delay_time = 1 + max_delay_time = 3 EOF - name: Run cdk-mintd Docker Container From 8ad3f22aab1577064f464da1f6d139d1b9ffa63f Mon Sep 17 00:00:00 2001 From: gudnuf Date: Fri, 29 Aug 2025 19:42:40 -0700 Subject: [PATCH 5/7] update ci --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fff19f2db..e2fd27bac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,6 +60,9 @@ jobs: mnemonic = "inherit paddle hybrid panic inform best receive noise whale dizzy virtual west" [info.logging] + # Where to output logs: "stdout", "file", or "both" (default: "both") + output = "file" + file_level = "debug" [mint_management_rpc] enabled = false From 02fe014a771ea87f1194ad2a2eb4ea342a2523bf Mon Sep 17 00:00:00 2001 From: gudnuf Date: Fri, 29 Aug 2025 19:53:04 -0700 Subject: [PATCH 6/7] update ci --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2fd27bac..256d99b9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,6 @@ jobs: mnemonic = "inherit paddle hybrid panic inform best receive noise whale dizzy virtual west" [info.logging] - # Where to output logs: "stdout", "file", or "both" (default: "both") output = "file" file_level = "debug" From 47ffaf0eb7f4daf86f6e41acdc0d4dfc98af51f6 Mon Sep 17 00:00:00 2001 From: gudnuf Date: Fri, 29 Aug 2025 20:01:51 -0700 Subject: [PATCH 7/7] update ci --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 256d99b9a..bd8a9d467 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,8 +60,8 @@ jobs: mnemonic = "inherit paddle hybrid panic inform best receive noise whale dizzy virtual west" [info.logging] - output = "file" - file_level = "debug" + output = "stdout" + console_level = "debug" [mint_management_rpc] enabled = false