Skip to content

Commit 00a2239

Browse files
committed
Extract mempool_server
1 parent 4db8aec commit 00a2239

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/regtest-mine.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
description: Blocktank base URL
1010
required: true
1111
default: 'https://api.stag0.blocktank.to/blocktank/api/v2'
12+
mempool_server:
13+
description: Mempool API base URL
14+
required: true
15+
default: 'https://mempool.bitkit.stag0.blocktank.to'
1216
block_count:
1317
description: Number of regtest blocks to mine
1418
required: true
@@ -20,7 +24,7 @@ jobs:
2024
env:
2125
BLOCK_COUNT: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.block_count || '1' }}
2226
BLOCKTANK_SERVER: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.blocktank_server || 'https://api.stag0.blocktank.to/blocktank/api/v2' }}
23-
MEMPOOL_API: https://mempool.bitkit.stag0.blocktank.to/api/blocks/tip/height
27+
MEMPOOL_SERVER: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.mempool_server || 'https://mempool.bitkit.stag0.blocktank.to' }}
2428
steps:
2529
- name: Validate params
2630
run: |
@@ -40,8 +44,13 @@ jobs:
4044
echo "BLOCKTANK_SERVER is empty" >&2
4145
exit 1
4246
fi
47+
if [[ -z "${MEMPOOL_SERVER}" ]]; then
48+
echo "MEMPOOL_SERVER is empty" >&2
49+
exit 1
50+
fi
4351
- name: Capture initial tip height
4452
run: |
53+
MEMPOOL_API="${MEMPOOL_SERVER%/}/api/blocks/tip/height"
4554
TIP_BEFORE=$(curl -sS "${MEMPOOL_API}" | tr -dc '0-9')
4655
if [[ -z "${TIP_BEFORE}" ]]; then
4756
echo "Failed to obtain initial block height" >&2
@@ -59,6 +68,7 @@ jobs:
5968
-d "{\"count\": ${BLOCK_COUNT}}"
6069
- name: Verify new tip height
6170
run: |
71+
MEMPOOL_API="${MEMPOOL_SERVER%/}/api/blocks/tip/height"
6272
EXPECTED=$((TIP_BEFORE + BLOCK_COUNT))
6373
echo "Waiting up to 10 seconds for tip height to reach ${EXPECTED}..."
6474
END=$((SECONDS + 10))

0 commit comments

Comments
 (0)