Skip to content

Commit 36bab1b

Browse files
committed
Merge branch 'develop' of https://github.com/o1-labs/openmina into 1572-add-missing-database-setup-step-to-the-release-verification-process
2 parents 53d8ca4 + c45bdca commit 36bab1b

14 files changed

+411
-27
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/bash
2+
3+
# Test block producer node API capabilities
4+
# This corresponds to the test-docs-infrastructure.yaml workflow
5+
#
6+
# Usage:
7+
# ./test-block-producer-node-capabilities.sh
8+
#
9+
# This script tests API capabilities of o1Labs block producer nodes
10+
11+
echo "🔍 Testing block producer node API capabilities..."
12+
13+
# Read block producer nodes from file
14+
bp_nodes_file="website/docs/developers/scripts/infrastructure/block-producer-nodes.txt"
15+
bp_nodes=$(cat "$bp_nodes_file")
16+
17+
# Test with first available node
18+
for node_url in $bp_nodes; do
19+
graphql_url="${node_url}graphql"
20+
21+
echo "Testing API capabilities on: $graphql_url"
22+
23+
# Test network ID query using website script
24+
network_success=false
25+
if network_response=$(bash website/docs/developers/scripts/graphql-api/queries/curl/network-id.sh "$graphql_url" 2>&1); then
26+
if echo "$network_response" | jq -e '.data.networkID' > /dev/null 2>&1; then
27+
network_id=$(echo "$network_response" | jq -r '.data.networkID')
28+
echo "✅ Network ID query successful: $network_id"
29+
network_success=true
30+
else
31+
echo "⚠️ Network ID query failed or unexpected response"
32+
fi
33+
else
34+
echo "⚠️ Network ID query script failed"
35+
fi
36+
37+
# Test best chain query using website script
38+
chain_success=false
39+
if chain_response=$(bash website/docs/developers/scripts/graphql-api/queries/curl/best-chain.sh "$graphql_url" 2>&1); then
40+
if echo "$chain_response" | jq -e '.data.bestChain[0].stateHash' > /dev/null 2>&1; then
41+
state_hash=$(echo "$chain_response" | jq -r '.data.bestChain[0].stateHash')
42+
echo "✅ Best chain query successful: ${state_hash:0:16}..."
43+
chain_success=true
44+
else
45+
echo "⚠️ Best chain query failed or unexpected response"
46+
fi
47+
else
48+
echo "⚠️ Best chain query script failed"
49+
fi
50+
51+
# We only need to test one working node
52+
if [ "$network_success" = true ] && [ "$chain_success" = true ]; then
53+
echo "🎉 Block producer node API capabilities verified"
54+
break
55+
fi
56+
done
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/bin/bash
2+
3+
# Test block producer node GraphQL endpoints
4+
# This corresponds to the test-docs-infrastructure.yaml workflow
5+
#
6+
# Usage:
7+
# ./test-block-producer-node-connectivity.sh
8+
#
9+
# This script tests GraphQL connectivity to o1Labs block producer nodes
10+
11+
echo "🔍 Testing block producer node GraphQL connectivity..."
12+
13+
# Read block producer nodes from file
14+
bp_nodes_file="website/docs/developers/scripts/infrastructure/block-producer-nodes.txt"
15+
16+
if [ ! -f "$bp_nodes_file" ]; then
17+
echo "❌ Block producer nodes file not found: $bp_nodes_file"
18+
exit 1
19+
fi
20+
21+
bp_nodes=$(cat "$bp_nodes_file")
22+
failed=0
23+
24+
for node_url in $bp_nodes; do
25+
echo "Testing GraphQL endpoint: $node_url"
26+
27+
# Test basic HTTP connectivity
28+
if curl -s --connect-timeout 10 --max-time 30 "$node_url" > /dev/null 2>&1; then
29+
echo "$node_url is reachable via HTTP"
30+
else
31+
echo "$node_url is not reachable via HTTP"
32+
failed=$((failed + 1))
33+
continue
34+
fi
35+
36+
# Test GraphQL endpoint using website scripts
37+
graphql_url="${node_url}graphql"
38+
39+
# Test daemon status query using the website script
40+
if response=$(bash website/docs/developers/scripts/graphql-api/queries/curl/daemon-status.sh "$graphql_url" 2>&1); then
41+
# Check if it's valid JSON
42+
if echo "$response" | jq . > /dev/null 2>&1; then
43+
# Check for GraphQL errors
44+
if echo "$response" | jq -e '.errors' > /dev/null 2>&1; then
45+
echo "⚠️ $graphql_url returned GraphQL error:"
46+
echo "$response" | jq '.errors'
47+
# Check for valid data
48+
elif echo "$response" | jq -e '.data.daemonStatus' > /dev/null 2>&1; then
49+
echo "$graphql_url GraphQL query successful"
50+
sync_status=$(echo "$response" | jq -r '.data.daemonStatus.syncStatus // "unknown"')
51+
chain_id=$(echo "$response" | jq -r '.data.daemonStatus.chainId // "unknown"')
52+
echo " Sync Status: $sync_status, Chain ID: ${chain_id:0:16}..."
53+
else
54+
echo "⚠️ $graphql_url unexpected response format"
55+
fi
56+
else
57+
echo "⚠️ $graphql_url did not return valid JSON: $(echo "$response" | head -c 100)..."
58+
fi
59+
else
60+
echo "$graphql_url GraphQL query failed"
61+
failed=$((failed + 1))
62+
fi
63+
64+
echo "---"
65+
done
66+
67+
if [ $failed -gt 0 ]; then
68+
echo "💥 $failed block producer node tests failed"
69+
echo "Infrastructure issues detected. Please check block producer node status."
70+
exit 1
71+
else
72+
echo "🎉 All block producer nodes are healthy and responding"
73+
fi

.github/workflows/docker-heartbeats-processor.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
touch "/tmp/digests/${digest#sha256:}"
5757
5858
- name: Upload digest
59-
uses: actions/upload-artifact@v4
59+
uses: actions/upload-artifact@v5
6060
with:
6161
name: heartbeat-processor-digests-${{ env.PLATFORM_PAIR }}
6262
path: /tmp/digests/*
@@ -69,7 +69,7 @@ jobs:
6969
- build-heartbeat-processor-image
7070
steps:
7171
- name: Download digests
72-
uses: actions/download-artifact@v5
72+
uses: actions/download-artifact@v6
7373
with:
7474
path: /tmp/digests
7575
pattern: heartbeat-processor-digests-*

.github/workflows/docker.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
touch "/tmp/digests/${digest#sha256:}"
5959
6060
- name: Upload digest
61-
uses: actions/upload-artifact@v4
61+
uses: actions/upload-artifact@v5
6262
with:
6363
name: node-digests-${{ env.PLATFORM_PAIR }}
6464
path: /tmp/digests/*
@@ -119,7 +119,7 @@ jobs:
119119
touch "/tmp/digests/${digest#sha256:}"
120120
121121
- name: Upload digest
122-
uses: actions/upload-artifact@v4
122+
uses: actions/upload-artifact@v5
123123
with:
124124
name: frontend-digests-${{ env.PLATFORM_PAIR }}
125125
path: /tmp/digests/*
@@ -216,7 +216,7 @@ jobs:
216216
uses: actions/checkout@v5
217217

218218
- name: Download frontend digest artifacts
219-
uses: actions/download-artifact@v5
219+
uses: actions/download-artifact@v6
220220
with:
221221
path: /tmp/digests
222222
pattern: frontend-digests-*

.github/workflows/docs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
run: make docs-build
8181

8282
- name: Upload build artifacts for testing
83-
uses: actions/upload-artifact@v4
83+
uses: actions/upload-artifact@v5
8484
with:
8585
name: docs-build-test
8686
path: website/build
@@ -201,7 +201,7 @@ jobs:
201201
zip -r "mina-docs-${{ steps.version.outputs.version }}.zip" website/build
202202
203203
- name: Upload versioned documentation as release asset
204-
uses: actions/upload-artifact@v4
204+
uses: actions/upload-artifact@v5
205205
with:
206206
name: versioned-docs-${{ steps.version.outputs.version }}
207207
path: |

.github/workflows/test-docs-infrastructure.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ name: Test Documentation Scripts - Infrastructure
44
# This workflow validates:
55
# 1. Seed node connectivity and format verification
66
# 2. Plain node GraphQL endpoints and API capabilities
7-
# 3. Infrastructure script functionality
7+
# 3. Block producer node GraphQL endpoints and API capabilities
8+
# 4. Infrastructure script functionality
89
# Scripts can be run locally for development and debugging
910
on:
1011
schedule:
@@ -66,3 +67,21 @@ jobs:
6667
- name: Test infrastructure scripts
6768
run: ./.github/scripts/test-infrastructure-scripts.sh
6869

70+
test-block-producer-nodes:
71+
name: Test Block Producer Node Connectivity
72+
timeout-minutes: 2
73+
strategy:
74+
matrix:
75+
os: [ubuntu-latest, macos-latest]
76+
runs-on: ${{ matrix.os }}
77+
78+
steps:
79+
- name: Checkout repository
80+
uses: actions/checkout@v5
81+
82+
- name: Test block producer node GraphQL endpoints
83+
run: ./.github/scripts/test-block-producer-node-connectivity.sh
84+
85+
- name: Test block producer node API capabilities
86+
run: ./.github/scripts/test-block-producer-node-capabilities.sh
87+

.github/workflows/tests.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ jobs:
244244
run: ./.github/scripts/test-ocaml-specific-endpoints.sh
245245

246246
- name: Upload binaries
247-
uses: actions/upload-artifact@v4
247+
uses: actions/upload-artifact@v5
248248
with:
249249
name: bin-${{ github.sha }}
250250
path: target/release/mina
@@ -278,7 +278,7 @@ jobs:
278278
uses: actions/checkout@v5
279279

280280
- name: Download mina binary
281-
uses: actions/download-artifact@v5
281+
uses: actions/download-artifact@v6
282282
with:
283283
name: bin-${{ github.sha }}
284284

@@ -323,7 +323,7 @@ jobs:
323323
run: make build-tests
324324

325325
- name: Upload tests
326-
uses: actions/upload-artifact@v4
326+
uses: actions/upload-artifact@v5
327327
with:
328328
name: tests-${{ github.sha }}
329329
path: target/release/tests
@@ -354,7 +354,7 @@ jobs:
354354
run: make build-tests-webrtc
355355

356356
- name: Upload tests
357-
uses: actions/upload-artifact@v4
357+
uses: actions/upload-artifact@v5
358358
with:
359359
name: tests-webrtc-${{ github.sha }}
360360
path: target/release/tests
@@ -425,7 +425,7 @@ jobs:
425425
rm -rf /var/lib/apt/lists/*
426426
427427
- name: Download tests
428-
uses: actions/download-artifact@v5
428+
uses: actions/download-artifact@v6
429429
with:
430430
pattern: tests*-${{ github.sha }}
431431
merge-multiple: true
@@ -444,7 +444,7 @@ jobs:
444444
./${{ matrix.test }} --test-threads=1
445445
446446
- name: Archive network debugger database
447-
uses: actions/upload-artifact@v4
447+
uses: actions/upload-artifact@v5
448448
with:
449449
name: network-debugger-${{ matrix.test }}-${{ github.sha }}
450450
path: /tmp/db
@@ -506,13 +506,13 @@ jobs:
506506
rm -rf /var/lib/apt/lists/*
507507
508508
- name: Download tests
509-
uses: actions/download-artifact@v5
509+
uses: actions/download-artifact@v6
510510
with:
511511
pattern: tests*-${{ github.sha }}
512512
merge-multiple: true
513513

514514
- name: Download tests
515-
uses: actions/download-artifact@v5
515+
uses: actions/download-artifact@v6
516516
with:
517517
pattern: tests-webrtc*-${{ github.sha }}
518518
merge-multiple: true
@@ -531,7 +531,7 @@ jobs:
531531
./${{ matrix.test }} --test-threads=1
532532
533533
- name: Archive network debugger database
534-
uses: actions/upload-artifact@v4
534+
uses: actions/upload-artifact@v5
535535
with:
536536
name: network-debugger-${{ matrix.test }}-${{ github.sha }}
537537
path: /tmp/db
@@ -563,7 +563,7 @@ jobs:
563563
rm -rf /var/lib/apt/lists/*
564564
565565
- name: Download tests
566-
uses: actions/download-artifact@v5
566+
uses: actions/download-artifact@v6
567567
with:
568568
pattern: tests*-${{ github.sha }}
569569
merge-multiple: true
@@ -598,12 +598,12 @@ jobs:
598598

599599
steps:
600600
- name: Download binary
601-
uses: actions/download-artifact@v5
601+
uses: actions/download-artifact@v6
602602
with:
603603
name: bin-${{ github.sha }}
604604

605605
- name: Download test
606-
uses: actions/download-artifact@v5
606+
uses: actions/download-artifact@v6
607607
with:
608608
pattern: tests*-${{ github.sha }}
609609
merge-multiple: true
@@ -633,23 +633,23 @@ jobs:
633633
}
634634
635635
- name: Upload logs
636-
uses: actions/upload-artifact@v4
636+
uses: actions/upload-artifact@v5
637637
with:
638638
name: bootstrap-logs-${{ github.sha }}
639639
path: ${{ env.MINA_HOME }}/logs/*
640640
retention-days: 7
641641
if: ${{ failure() }}
642642

643643
- name: Upload record
644-
uses: actions/upload-artifact@v4
644+
uses: actions/upload-artifact@v5
645645
with:
646646
name: bootstrap-record-${{ github.sha }}
647647
path: ${{ env.MINA_HOME }}/recorder/*
648648
retention-days: 7
649649
if: ${{ failure() }}
650650

651651
- name: Archive network debugger database
652-
uses: actions/upload-artifact@v4
652+
uses: actions/upload-artifact@v5
653653
with:
654654
name: network-debugger-test-bootstrap-${{ github.sha }}
655655
path: /tmp/db

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414

1515
### Added
1616

17+
- **CI**: Add validation workflows for block producer nodes infrastructure,
18+
including connectivity and API capability testing similar to plain nodes
19+
([#1571](https://github.com/o1-labs/mina-rust/pull/1571))
20+
- **Website**: Add block producer nodes documentation page with GraphQL query
21+
examples for latest canonical block and transaction information. Include note
22+
that block production functionality is under development
23+
([#1571](https://github.com/o1-labs/mina-rust/pull/1571))
1724
- **CLI**: add GraphQL introspection and execution commands under `mina
1825
internal graphql`. Three new commands enable dynamic endpoint discovery
1926
(`list`), detailed schema inspection (`inspect <endpoint>`), and arbitrary
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
https://mina-rust-bp-1.gcp.o1test.net/
2+
https://mina-rust-bp-2.gcp.o1test.net/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ bestChain(maxLength: 1) { stateHash protocolState { consensusState { blockHeight } } creator } }

0 commit comments

Comments
 (0)