From 5ab78e9020859d9e90058ac9cb56b127c5b6ffdb Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Thu, 18 Sep 2025 15:04:59 +0200 Subject: [PATCH 1/4] Makefile/trailing ws: ignore node_modules and dist in frontend And also ignore json files, in addition to printing the filename --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b62646392..ad5cc3b3a 100644 --- a/Makefile +++ b/Makefile @@ -144,16 +144,18 @@ fix-trailing-whitespace: ## Remove trailing whitespaces from all files @echo "Removing trailing whitespaces from all files..." @find . -type f \( \ -name "*.rs" -o -name "*.toml" -o -name "*.md" -o -name "*.yaml" \ - -o -name "*.yml" -o -name "*.json" -o -name "*.ts" -o -name "*.tsx" \ + -o -name "*.yml" -o -name "*.ts" -o -name "*.tsx" \ -o -name "*.js" -o -name "*.jsx" -o -name "*.sh" \) \ -not -path "./target/*" \ -not -path "./node_modules/*" \ + -not -path "./frontend/node_modules/*" \ + -not -path "./frontend/dist/*" \ -not -path "./website/node_modules/*" \ -not -path "./website/build/*" \ -not -path "./website/static/api-docs/*" \ -not -path "./website/.docusaurus/*" \ -not -path "./.git/*" \ - -exec sed -i'' -e "s/[[:space:]]*$$//" {} + && \ + -exec sh -c 'echo "Processing: $$1"; sed -i"" -e "s/[[:space:]]*$$//" "$$1"' _ {} \; && \ echo "Trailing whitespaces removed." .PHONY: check-trailing-whitespace @@ -161,10 +163,12 @@ check-trailing-whitespace: ## Check for trailing whitespaces in source files @echo "Checking for trailing whitespaces..." @files_with_trailing_ws=$$(find . -type f \( \ -name "*.rs" -o -name "*.toml" -o -name "*.md" -o -name "*.yaml" \ - -o -name "*.yml" -o -name "*.json" -o -name "*.ts" -o -name "*.tsx" \ + -o -name "*.yml" -o -name "*.ts" -o -name "*.tsx" \ -o -name "*.js" -o -name "*.jsx" -o -name "*.sh" \) \ -not -path "./target/*" \ -not -path "./node_modules/*" \ + -not -path "./frontend/node_modules/*" \ + -not -path "./frontend/dist/*" \ -not -path "./website/node_modules/*" \ -not -path "./website/build/*" \ -not -path "./website/static/api-docs/*" \ From eaba04298f84a854fb9dc5cc6f94e8ea4720ab7a Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Thu, 18 Sep 2025 16:26:13 +0200 Subject: [PATCH 2/4] Website/GraphQL: improve by executing each query in CI --- .github/workflows/test-docs-graphql-api.yaml | 165 ++++ website/docs/developers/graphql-api.md | 811 +++++++++++------- .../mutations/curl/send-delegation.sh | 28 + .../mutations/curl/send-payment.sh | 29 + .../graphql-api/mutations/curl/send-zkapp.sh | 33 + .../mutations/query/send-delegation.graphql | 14 + .../mutations/query/send-payment.graphql | 15 + .../mutations/query/send-zkapp.graphql | 16 + .../queries/curl/account-balance.sh | 12 + .../graphql-api/queries/curl/account.sh | 12 + .../queries/curl/basic-connectivity.sh | 12 + .../graphql-api/queries/curl/best-chain.sh | 12 + .../scripts/graphql-api/queries/curl/block.sh | 12 + .../queries/curl/current-snark-worker.sh | 12 + .../graphql-api/queries/curl/daemon-status.sh | 12 + .../graphql-api/queries/curl/genesis-block.sh | 12 + .../queries/curl/genesis-constants.sh | 12 + .../graphql-api/queries/curl/network-id.sh | 12 + .../graphql-api/queries/curl/node-info.sh | 12 + .../queries/curl/pending-snark-work.sh | 12 + .../queries/curl/pooled-user-commands.sh | 12 + .../queries/curl/pooled-zkapp-commands.sh | 12 + .../queries/curl/recent-activity.sh | 12 + .../graphql-api/queries/curl/snark-pool.sh | 12 + .../graphql-api/queries/curl/sync-status.sh | 12 + .../graphql-api/queries/curl/version.sh | 12 + .../examples/transaction-status.graphql | 3 + .../queries/examples/transaction-status.sh | 12 + .../queries/query/account-balance.graphql | 13 + .../graphql-api/queries/query/account.graphql | 37 + .../queries/query/basic-connectivity.graphql | 1 + .../queries/query/best-chain.graphql | 20 + .../graphql-api/queries/query/block.graphql | 19 + .../query/current-snark-worker.graphql | 12 + .../queries/query/daemon-status.graphql | 12 + .../queries/query/genesis-block.graphql | 10 + .../queries/query/genesis-constants.graphql | 7 + .../queries/query/network-id.graphql | 3 + .../queries/query/node-info.graphql | 8 + .../queries/query/pending-snark-work.graphql | 11 + .../query/pooled-user-commands.graphql | 14 + .../query/pooled-zkapp-commands.graphql | 24 + .../queries/query/recent-activity.graphql | 18 + .../queries/query/snark-pool.graphql | 6 + .../queries/query/sync-status.graphql | 1 + .../graphql-api/queries/query/version.graphql | 3 + 46 files changed, 1237 insertions(+), 324 deletions(-) create mode 100644 .github/workflows/test-docs-graphql-api.yaml create mode 100755 website/docs/developers/scripts/graphql-api/mutations/curl/send-delegation.sh create mode 100755 website/docs/developers/scripts/graphql-api/mutations/curl/send-payment.sh create mode 100755 website/docs/developers/scripts/graphql-api/mutations/curl/send-zkapp.sh create mode 100644 website/docs/developers/scripts/graphql-api/mutations/query/send-delegation.graphql create mode 100644 website/docs/developers/scripts/graphql-api/mutations/query/send-payment.graphql create mode 100644 website/docs/developers/scripts/graphql-api/mutations/query/send-zkapp.graphql create mode 100755 website/docs/developers/scripts/graphql-api/queries/curl/account-balance.sh create mode 100755 website/docs/developers/scripts/graphql-api/queries/curl/account.sh create mode 100755 website/docs/developers/scripts/graphql-api/queries/curl/basic-connectivity.sh create mode 100755 website/docs/developers/scripts/graphql-api/queries/curl/best-chain.sh create mode 100755 website/docs/developers/scripts/graphql-api/queries/curl/block.sh create mode 100755 website/docs/developers/scripts/graphql-api/queries/curl/current-snark-worker.sh create mode 100755 website/docs/developers/scripts/graphql-api/queries/curl/daemon-status.sh create mode 100755 website/docs/developers/scripts/graphql-api/queries/curl/genesis-block.sh create mode 100755 website/docs/developers/scripts/graphql-api/queries/curl/genesis-constants.sh create mode 100755 website/docs/developers/scripts/graphql-api/queries/curl/network-id.sh create mode 100755 website/docs/developers/scripts/graphql-api/queries/curl/node-info.sh create mode 100755 website/docs/developers/scripts/graphql-api/queries/curl/pending-snark-work.sh create mode 100755 website/docs/developers/scripts/graphql-api/queries/curl/pooled-user-commands.sh create mode 100755 website/docs/developers/scripts/graphql-api/queries/curl/pooled-zkapp-commands.sh create mode 100755 website/docs/developers/scripts/graphql-api/queries/curl/recent-activity.sh create mode 100755 website/docs/developers/scripts/graphql-api/queries/curl/snark-pool.sh create mode 100755 website/docs/developers/scripts/graphql-api/queries/curl/sync-status.sh create mode 100755 website/docs/developers/scripts/graphql-api/queries/curl/version.sh create mode 100644 website/docs/developers/scripts/graphql-api/queries/examples/transaction-status.graphql create mode 100755 website/docs/developers/scripts/graphql-api/queries/examples/transaction-status.sh create mode 100644 website/docs/developers/scripts/graphql-api/queries/query/account-balance.graphql create mode 100644 website/docs/developers/scripts/graphql-api/queries/query/account.graphql create mode 100644 website/docs/developers/scripts/graphql-api/queries/query/basic-connectivity.graphql create mode 100644 website/docs/developers/scripts/graphql-api/queries/query/best-chain.graphql create mode 100644 website/docs/developers/scripts/graphql-api/queries/query/block.graphql create mode 100644 website/docs/developers/scripts/graphql-api/queries/query/current-snark-worker.graphql create mode 100644 website/docs/developers/scripts/graphql-api/queries/query/daemon-status.graphql create mode 100644 website/docs/developers/scripts/graphql-api/queries/query/genesis-block.graphql create mode 100644 website/docs/developers/scripts/graphql-api/queries/query/genesis-constants.graphql create mode 100644 website/docs/developers/scripts/graphql-api/queries/query/network-id.graphql create mode 100644 website/docs/developers/scripts/graphql-api/queries/query/node-info.graphql create mode 100644 website/docs/developers/scripts/graphql-api/queries/query/pending-snark-work.graphql create mode 100644 website/docs/developers/scripts/graphql-api/queries/query/pooled-user-commands.graphql create mode 100644 website/docs/developers/scripts/graphql-api/queries/query/pooled-zkapp-commands.graphql create mode 100644 website/docs/developers/scripts/graphql-api/queries/query/recent-activity.graphql create mode 100644 website/docs/developers/scripts/graphql-api/queries/query/snark-pool.graphql create mode 100644 website/docs/developers/scripts/graphql-api/queries/query/sync-status.graphql create mode 100644 website/docs/developers/scripts/graphql-api/queries/query/version.graphql diff --git a/.github/workflows/test-docs-graphql-api.yaml b/.github/workflows/test-docs-graphql-api.yaml new file mode 100644 index 000000000..212146409 --- /dev/null +++ b/.github/workflows/test-docs-graphql-api.yaml @@ -0,0 +1,165 @@ +name: Test Documentation Scripts - GraphQL API + +# Test GraphQL API scripts and examples +on: + schedule: + # Run daily at 7 AM UTC to catch API issues early + - cron: '0 7 * * *' + workflow_dispatch: + # Allow manual triggering for testing + pull_request: + # Always run on pull requests + push: + branches: [ main, develop ] + +jobs: + test-graphql-scripts: + name: Test GraphQL API Scripts + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Install jq for JSON processing + run: | + if [[ "${{ runner.os }}" == "Linux" ]]; then + sudo apt-get update && sudo apt-get install -y jq + elif [[ "${{ runner.os }}" == "macOS" ]]; then + brew install jq + fi + + - name: Test script and query file consistency + run: | + echo "🔍 Testing consistency between bash scripts and GraphQL query files..." + + script_dir="website/docs/developers/scripts/graphql-api/queries/curl" + query_dir="website/docs/developers/scripts/graphql-api/queries/query" + + inconsistent=0 + + # Check that each script that references a query file has a corresponding .graphql file + for script_file in "$script_dir"/*.sh; do + if [ ! -f "$script_file" ]; then + continue + fi + + script_name=$(basename "$script_file" .sh) + + # Look for query file references in the script + if grep -q "query/" "$script_file"; then + expected_query_file="$query_dir/$script_name.graphql" + + if [ -f "$expected_query_file" ]; then + echo "✅ $script_name has corresponding query file" + else + echo "❌ $script_name missing query file: $expected_query_file" + inconsistent=$((inconsistent + 1)) + fi + fi + done + + # Check that each query file has a corresponding script + for query_file in "$query_dir"/*.graphql; do + if [ ! -f "$query_file" ]; then + continue + fi + + query_name=$(basename "$query_file" .graphql) + expected_script_file="$script_dir/$query_name.sh" + + if [ -f "$expected_script_file" ]; then + echo "✅ $query_name has corresponding script file" + else + echo "❌ $query_name query file has no corresponding script: $expected_script_file" + inconsistent=$((inconsistent + 1)) + fi + done + + if [ $inconsistent -gt 0 ]; then + echo "💥 $inconsistent script/query file inconsistencies found" + exit 1 + else + echo "🎉 All scripts and query files are consistent" + fi + + - name: Test GraphQL command scripts + run: | + echo "🔍 Testing GraphQL API command scripts..." + + # Dynamically discover all bash scripts in the queries/curl directory (only test queries, not mutations) + script_dir="website/docs/developers/scripts/graphql-api/queries/curl" + + if [ ! -d "$script_dir" ]; then + echo "❌ Script directory not found: $script_dir" + exit 1 + fi + + # Get all .sh files in the curl directory + script_files=$(ls "$script_dir"/*.sh 2>/dev/null) + + if [ -z "$script_files" ]; then + echo "❌ No bash scripts found in $script_dir" + exit 1 + fi + + failed=0 + + for script_file in $script_files; do + if [ ! -f "$script_file" ]; then + echo "❌ Script file not found: $script_file" + failed=$((failed + 1)) + continue + fi + + echo "Testing script: $script_file" + + # Execute the script and capture output + if output=$(timeout 30 bash "$script_file" 2>&1); then + echo "✅ Script executed successfully" + + # Check if this is a GraphQL script (contains JSON response) + if echo "$output" | grep -q "^{"; then + # Extract JSON response (skip curl progress output) + json_response=$(echo "$output" | grep "^{") + + # Check if it's valid JSON + if echo "$json_response" | jq . > /dev/null 2>&1; then + # Check for GraphQL errors + if echo "$json_response" | jq -e '.errors' > /dev/null 2>&1; then + echo "❌ Script returned GraphQL errors:" + echo "$json_response" | jq '.errors' + failed=$((failed + 1)) + else + echo "✅ Script response contains valid JSON: $(echo "$json_response" | head -c 100)..." + fi + else + echo "❌ Script returned invalid JSON: $(echo "$json_response" | head -c 100)..." + failed=$((failed + 1)) + fi + else + # Non-JSON script validation (basic error checking) + if echo "$output" | grep -q "error\|Error\|ERROR"; then + echo "⚠️ Script returned error response: $(echo "$output" | head -c 100)..." + else + echo "✅ Script response looks valid: $(echo "$output" | head -c 100)..." + fi + fi + else + echo "❌ Script execution failed: $script_file" + failed=$((failed + 1)) + fi + + echo "---" + done + + if [ $failed -gt 0 ]; then + echo "💥 $failed GraphQL script tests failed" + echo "Some GraphQL API scripts may need updates." + exit 1 + else + echo "🎉 All GraphQL API command scripts are working" + fi diff --git a/website/docs/developers/graphql-api.md b/website/docs/developers/graphql-api.md index 83ea8e59c..1428b9e0d 100644 --- a/website/docs/developers/graphql-api.md +++ b/website/docs/developers/graphql-api.md @@ -4,6 +4,93 @@ description: Complete reference for Mina Rust GraphQL API endpoints and queries sidebar_position: 6 --- +import CodeBlock from "@theme/CodeBlock"; import Tabs from "@theme/Tabs"; import +TabItem from "@theme/TabItem"; import TestBasicConnectivity from +"!!raw-loader!./scripts/graphql-api/queries/curl/basic-connectivity.sh"; import +QuerySyncStatus from +"!!raw-loader!./scripts/graphql-api/queries/curl/sync-status.sh"; import +QueryNodeInfo from +"!!raw-loader!./scripts/graphql-api/queries/curl/node-info.sh"; import +QueryRecentActivity from +"!!raw-loader!./scripts/graphql-api/queries/curl/recent-activity.sh"; import +QueryAccountBalance from +"!!raw-loader!./scripts/graphql-api/queries/curl/account-balance.sh"; import +QueryBlock from "!!raw-loader!./scripts/graphql-api/queries/curl/block.sh"; +import QueryGenesisBlock from +"!!raw-loader!./scripts/graphql-api/queries/curl/genesis-block.sh"; import +QueryGenesisConstants from +"!!raw-loader!./scripts/graphql-api/queries/curl/genesis-constants.sh"; import +QueryPooledUserCommands from +"!!raw-loader!./scripts/graphql-api/queries/curl/pooled-user-commands.sh"; +import QueryPooledZkappCommands from +"!!raw-loader!./scripts/graphql-api/queries/curl/pooled-zkapp-commands.sh"; +import QueryTransactionStatus from +"!!raw-loader!./scripts/graphql-api/queries/examples/transaction-status.sh"; +import QuerySnarkPool from +"!!raw-loader!./scripts/graphql-api/queries/curl/snark-pool.sh"; import +QueryPendingSnarkWork from +"!!raw-loader!./scripts/graphql-api/queries/curl/pending-snark-work.sh"; import +QueryCurrentSnarkWorker from +"!!raw-loader!./scripts/graphql-api/queries/curl/current-snark-worker.sh"; +import QueryDaemonStatus from +"!!raw-loader!./scripts/graphql-api/queries/curl/daemon-status.sh"; import +QueryNetworkID from +"!!raw-loader!./scripts/graphql-api/queries/curl/network-id.sh"; import +QueryVersion from "!!raw-loader!./scripts/graphql-api/queries/curl/version.sh"; +import QueryBestChain from +"!!raw-loader!./scripts/graphql-api/queries/curl/best-chain.sh"; import +QueryAccount from "!!raw-loader!./scripts/graphql-api/queries/curl/account.sh"; +import BasicConnectivityQuery from +"!!raw-loader!./scripts/graphql-api/queries/query/basic-connectivity.graphql"; +import SyncStatusQuery from +"!!raw-loader!./scripts/graphql-api/queries/query/sync-status.graphql"; import +NodeInfoQuery from +"!!raw-loader!./scripts/graphql-api/queries/query/node-info.graphql"; import +RecentActivityQuery from +"!!raw-loader!./scripts/graphql-api/queries/query/recent-activity.graphql"; +import AccountBalanceQuery from +"!!raw-loader!./scripts/graphql-api/queries/query/account-balance.graphql"; +import DaemonStatusQuery from +"!!raw-loader!./scripts/graphql-api/queries/query/daemon-status.graphql"; import +NetworkIDQuery from +"!!raw-loader!./scripts/graphql-api/queries/query/network-id.graphql"; import +VersionQuery from +"!!raw-loader!./scripts/graphql-api/queries/query/version.graphql"; import +BestChainQuery from +"!!raw-loader!./scripts/graphql-api/queries/query/best-chain.graphql"; import +BlockQuery from +"!!raw-loader!./scripts/graphql-api/queries/query/block.graphql"; import +GenesisBlockQuery from +"!!raw-loader!./scripts/graphql-api/queries/query/genesis-block.graphql"; import +GenesisConstantsQuery from +"!!raw-loader!./scripts/graphql-api/queries/query/genesis-constants.graphql"; +import AccountQuery from +"!!raw-loader!./scripts/graphql-api/queries/query/account.graphql"; import +PooledUserCommandsQuery from +"!!raw-loader!./scripts/graphql-api/queries/query/pooled-user-commands.graphql"; +import PooledZkappCommandsQuery from +"!!raw-loader!./scripts/graphql-api/queries/query/pooled-zkapp-commands.graphql"; +import TransactionStatusQuery from +"!!raw-loader!./scripts/graphql-api/queries/examples/transaction-status.graphql"; +import SnarkPoolQuery from +"!!raw-loader!./scripts/graphql-api/queries/query/snark-pool.graphql"; import +PendingSnarkWorkQuery from +"!!raw-loader!./scripts/graphql-api/queries/query/pending-snark-work.graphql"; +import CurrentSnarkWorkerQuery from +"!!raw-loader!./scripts/graphql-api/queries/query/current-snark-worker.graphql"; +import SendPaymentMutation from +"!!raw-loader!./scripts/graphql-api/mutations/query/send-payment.graphql"; +import SendDelegationMutation from +"!!raw-loader!./scripts/graphql-api/mutations/query/send-delegation.graphql"; +import SendZkappMutation from +"!!raw-loader!./scripts/graphql-api/mutations/query/send-zkapp.graphql"; import +MutationSendPayment from +"!!raw-loader!./scripts/graphql-api/mutations/curl/send-payment.sh"; import +MutationSendDelegation from +"!!raw-loader!./scripts/graphql-api/mutations/curl/send-delegation.sh"; import +MutationSendZkapp from +"!!raw-loader!./scripts/graphql-api/mutations/curl/send-zkapp.sh"; + # GraphQL API Reference The Mina Rust node provides a comprehensive GraphQL API for querying blockchain @@ -11,21 +98,51 @@ data, account information, transaction status, and network statistics. The API is built using [Juniper](https://github.com/graphql-rust/juniper) and is available at `http://localhost:3000/graphql` when running a node. +You can also use one of the nodes deployed by o1Labs. See the +[Infrastructure](../node-operators/infrastructure/plain-nodes) section for +available nodes and connection details. + ## Quick Start ### Testing the API -```bash -# Basic connectivity test -curl -X POST http://localhost:3000/graphql \ - -H "Content-Type: application/json" \ - -d '{"query": "{ __typename }"}' + + -# Get sync status -curl -X POST http://localhost:3000/graphql \ - -H "Content-Type: application/json" \ - -d '{"query": "{ syncStatus }"}' -``` + {BasicConnectivityQuery} + + + + + {TestBasicConnectivity} + + + + + + + + {SyncStatusQuery} + + + + + {QuerySyncStatus} + + + ### Interactive Exploration @@ -54,40 +171,70 @@ query { Get comprehensive daemon status information. -```graphql -query { - daemonStatus { - blockchainLength - chainId - commitId - stateHash - numAccounts - globalSlotSinceGenesisBestTip - ledgerMerkleRoot - coinbaseReceiver - } -} -``` + + + + {DaemonStatusQuery} + + + + + {QueryDaemonStatus} + + + ##### `networkID` Get the network identifier. -```graphql -query { - networkID # Returns: "mina:devnet" or similar -} -``` + + + + {NetworkIDQuery} + + + + + {QueryNetworkID} + + + ##### `version` Get the node version (git commit hash). -```graphql -query { - version # Returns: git commit hash -} -``` + + + + {VersionQuery} + + + + + {QueryVersion} + + + #### Blockchain Data @@ -95,85 +242,93 @@ query { Get the best chain blocks up to specified length. -```graphql -query RecentBlocks { - bestChain(maxLength: 10) { - stateHash - protocolState { - consensusState { - blockHeight - slotSinceGenesis - } - previousStateHash - } - transactions { - userCommands { - id - fee - amount - memo - } - } - } -} -``` + + + + {BestChainQuery} + + + + + {QueryBestChain} + + + ##### `block(height: Int, stateHash: String)` Get a specific block by height or state hash. -```graphql -query GetBlock { - block(height: 455450) { - stateHash - protocolState { - consensusState { - blockHeight - } - } - creator - transactions { - userCommands { - amount - fee - from - to - } - } - } -} -``` + + + + {BlockQuery} + + + + + {QueryBlock} + + + ##### `genesisBlock` Get the genesis block. -```graphql -query { - genesisBlock { - stateHash - protocolState { - consensusState { - blockHeight - } - } - } -} -``` + + + + {GenesisBlockQuery} + + + + + {QueryGenesisBlock} + + + ##### `genesisConstants` Get genesis constants and network parameters. -```graphql -query { - genesisConstants { - accountCreationFee - genesisTimestamp - coinbase - } -} -``` + + + + {GenesisConstantsQuery} + + + + + {QueryGenesisConstants} + + + #### Account Information @@ -181,42 +336,24 @@ query { Get account information by public key. -```graphql -query GetAccount($publicKey: String!) { - account(publicKey: $publicKey) { - balance { - total - liquid - locked - } - nonce - delegateAccount { - publicKey - } - votingFor - receiptChainHash - publicKey - token - tokenSymbol - zkappUri - zkappState - permissions { - editState - send - receive - access - setDelegate - setPermissions - setVerificationKey - setZkappUri - editActionState - setTokenSymbol - incrementNonce - setVotingFor - } - } -} -``` + + + + {AccountQuery} + + + + + {QueryAccount} + + + #### Transaction Pool @@ -224,50 +361,47 @@ query GetAccount($publicKey: String!) { Get pending user commands (payments/delegations) from the transaction pool. -```graphql -query PooledUserCommands($publicKey: String) { - pooledUserCommands(publicKey: $publicKey) { - id - amount - fee - from - to - nonce - memo - isDelegation - hash - kind - } -} -``` + + + + {PooledUserCommandsQuery} + + + + + {QueryPooledUserCommands} + + + ##### `pooledZkappCommands(publicKey: String, hashes: [String], ids: [String])` Get pending zkApp commands from the transaction pool. -```graphql -query PooledZkApps($publicKey: String) { - pooledZkappCommands(publicKey: $publicKey) { - id - hash - zkappCommand { - feePayer { - body { - publicKey - fee - nonce - } - } - accountUpdates { - body { - publicKey - balanceChange - } - } - } - } -} -``` + + + + {PooledZkappCommandsQuery} + + + + + {QueryPooledZkappCommands} + + + #### Transaction Status @@ -275,11 +409,24 @@ query PooledZkApps($publicKey: String) { Get the status of a specific transaction. -```graphql -query TransactionStatus($transactionId: String!) { - transactionStatus(payment: $transactionId) # Returns: PENDING | INCLUDED | UNKNOWN -} -``` + + + + {TransactionStatusQuery} + + + + + {QueryTransactionStatus} + + + #### SNARK Work @@ -287,51 +434,70 @@ query TransactionStatus($transactionId: String!) { Get completed SNARK work from the pool. -```graphql -query { - snarkPool { - fee - prover - } -} -``` + + + + {SnarkPoolQuery} + + + + + {QuerySnarkPool} + + + ##### `pendingSnarkWork` Get pending SNARK work that needs to be completed. -```graphql -query { - pendingSnarkWork { - workBundle { - sourceFirstPassLedgerHash - targetFirstPassLedgerHash - sourceSecondPassLedgerHash - targetSecondPassLedgerHash - workId - } - } -} -``` + + + + {PendingSnarkWorkQuery} + + + + + {QueryPendingSnarkWork} + + + ##### `currentSnarkWorker` Get information about the currently configured SNARK worker. -```graphql -query { - currentSnarkWorker { - key - fee - account { - publicKey - balance { - total - } - } - } -} -``` + + + + {CurrentSnarkWorkerQuery} + + + + + {QueryCurrentSnarkWorker} + + + ### Mutation Endpoints @@ -341,67 +507,70 @@ query { Submit a payment transaction. -```graphql -mutation SendPayment( - $input: SendPaymentInput! - $signature: UserCommandSignature! -) { - sendPayment(input: $input, signature: $signature) { - payment { - id - hash - amount - fee - from - to - } - } -} -``` + + + + {SendPaymentMutation} + + + + + {MutationSendPayment} + + + ##### `sendDelegation` Submit a delegation transaction. -```graphql -mutation SendDelegation( - $input: SendDelegationInput! - $signature: UserCommandSignature! -) { - sendDelegation(input: $input, signature: $signature) { - delegation { - id - hash - delegator - delegate - fee - } - } -} -``` + + + + {SendDelegationMutation} + + + + + {MutationSendDelegation} + + + ##### `sendZkapp` Submit a zkApp transaction. -```graphql -mutation SendZkApp($input: SendZkAppInput!) { - sendZkapp(input: $input) { - zkapp { - id - hash - zkappCommand { - feePayer { - body { - publicKey - fee - } - } - } - } - } -} -``` + + + + {SendZkappMutation} + + + + + {MutationSendZkapp} + + + ## Implementation Details @@ -489,72 +658,66 @@ query { ### Get Node Information -```bash -curl -X POST http://localhost:3000/graphql \ - -H "Content-Type: application/json" \ - -d '{ - "query": "query NodeInfo { - syncStatus - networkID - version - daemonStatus { - blockchainLength - peers - uptimeSecs - } - }" - }' -``` + + + + {NodeInfoQuery} + + + + + {QueryNodeInfo} + + + ### Get Recent Blockchain Activity -```bash -curl -X POST http://localhost:3000/graphql \ - -H "Content-Type: application/json" \ - -d '{ - "query": "query RecentActivity { - bestChain(maxLength: 5) { - stateHash - protocolState { - consensusState { - blockHeight - } - } - transactions { - userCommands { - amount - fee - from - to - } - } - } - }" - }' -``` + + + + {RecentActivityQuery} + + + + + {QueryRecentActivity} + + + ### Check Account Balance -```bash -curl -X POST http://localhost:3000/graphql \ - -H "Content-Type: application/json" \ - -d '{ - "query": "query GetBalance($publicKey: String!) { - account(publicKey: $publicKey) { - balance { - total - liquid - locked - } - nonce - delegate - } - }", - "variables": { - "publicKey": "B62qp3B9VW1ir5qL1MWRwr6ecjC2NZbGr8vysGeme9vXGcFXTMNXb2t" - } - }' -``` + + + + {AccountBalanceQuery} + + + + + {QueryAccountBalance} + + + ## Development and Testing diff --git a/website/docs/developers/scripts/graphql-api/mutations/curl/send-delegation.sh b/website/docs/developers/scripts/graphql-api/mutations/curl/send-delegation.sh new file mode 100755 index 000000000..4268baebb --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/mutations/curl/send-delegation.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +# WARNING: This mutation modifies the blockchain state +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/send-delegation.graphql" | sed 's/ */ /g') + +# Example variables - replace with actual values +VARIABLES='{ + "input": { + "from": "B62qmGtQ7kn6zbw4tAYomBJJri1gZSThfQZJaMG6eR3tyNP3RiCcEQZ", + "to": "B62qrPN5Y5yq8kGE3FbVKbGTdTAJNdtNtB5sNVpxyRwWGcDEhpMzc8g", + "fee": "10000000", + "memo": "Test delegation" + }, + "signature": { + "field": "...", + "scalar": "..." + } +}' + +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\", \"variables\": $VARIABLES}" diff --git a/website/docs/developers/scripts/graphql-api/mutations/curl/send-payment.sh b/website/docs/developers/scripts/graphql-api/mutations/curl/send-payment.sh new file mode 100755 index 000000000..93020fe1d --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/mutations/curl/send-payment.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +# WARNING: This mutation modifies the blockchain state +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/send-payment.graphql" | sed 's/ */ /g') + +# Example variables - replace with actual values +VARIABLES='{ + "input": { + "from": "B62qmGtQ7kn6zbw4tAYomBJJri1gZSThfQZJaMG6eR3tyNP3RiCcEQZ", + "to": "B62qrPN5Y5yq8kGE3FbVKbGTdTAJNdtNtB5sNVpxyRwWGcDEhpMzc8g", + "amount": "1000000000", + "fee": "10000000", + "memo": "Test payment" + }, + "signature": { + "field": "...", + "scalar": "..." + } +}' + +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\", \"variables\": $VARIABLES}" diff --git a/website/docs/developers/scripts/graphql-api/mutations/curl/send-zkapp.sh b/website/docs/developers/scripts/graphql-api/mutations/curl/send-zkapp.sh new file mode 100755 index 000000000..32baaa08a --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/mutations/curl/send-zkapp.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +# WARNING: This mutation modifies the blockchain state +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/send-zkapp.graphql" | sed 's/ */ /g') + +# Example variables - replace with actual zkApp transaction data +VARIABLES='{ + "input": { + "zkappCommand": { + "feePayer": { + "body": { + "publicKey": "B62qmGtQ7kn6zbw4tAYomBJJri1gZSThfQZJaMG6eR3tyNP3RiCcEQZ", + "fee": "10000000", + "validUntil": null, + "nonce": 0 + }, + "authorization": "..." + }, + "accountUpdates": [], + "memo": "zkApp transaction" + } + } +}' + +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\", \"variables\": $VARIABLES}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/mutations/query/send-delegation.graphql b/website/docs/developers/scripts/graphql-api/mutations/query/send-delegation.graphql new file mode 100644 index 000000000..738f746a6 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/mutations/query/send-delegation.graphql @@ -0,0 +1,14 @@ +mutation SendDelegation( + $input: SendDelegationInput! + $signature: UserCommandSignature! +) { + sendDelegation(input: $input, signature: $signature) { + delegation { + id + hash + delegator + delegate + fee + } + } +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/mutations/query/send-payment.graphql b/website/docs/developers/scripts/graphql-api/mutations/query/send-payment.graphql new file mode 100644 index 000000000..f7dd965ef --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/mutations/query/send-payment.graphql @@ -0,0 +1,15 @@ +mutation SendPayment( + $input: SendPaymentInput! + $signature: UserCommandSignature! +) { + sendPayment(input: $input, signature: $signature) { + payment { + id + hash + amount + fee + from + to + } + } +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/mutations/query/send-zkapp.graphql b/website/docs/developers/scripts/graphql-api/mutations/query/send-zkapp.graphql new file mode 100644 index 000000000..ecb086e83 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/mutations/query/send-zkapp.graphql @@ -0,0 +1,16 @@ +mutation SendZkApp($input: SendZkAppInput!) { + sendZkapp(input: $input) { + zkapp { + id + hash + zkappCommand { + feePayer { + body { + publicKey + fee + } + } + } + } + } +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/curl/account-balance.sh b/website/docs/developers/scripts/graphql-api/queries/curl/account-balance.sh new file mode 100755 index 000000000..1f8bd8e76 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/curl/account-balance.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/account-balance.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\", \"variables\": { \"publicKey\": \"B62qp3B9VW1ir5qL1MWRwr6ecjC2NZbGr8vysGeme9vXGcFXTMNXb2t\" }}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/curl/account.sh b/website/docs/developers/scripts/graphql-api/queries/curl/account.sh new file mode 100755 index 000000000..796536fac --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/curl/account.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/account.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\", \"variables\": {\"publicKey\": \"B62qp3B9VW1ir5qL1MWRwr6ecjC2NZbGr8vysGeme9vXGcFXTMNXb2t\"}}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/curl/basic-connectivity.sh b/website/docs/developers/scripts/graphql-api/queries/curl/basic-connectivity.sh new file mode 100755 index 000000000..c539098f0 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/curl/basic-connectivity.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/basic-connectivity.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\"}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/curl/best-chain.sh b/website/docs/developers/scripts/graphql-api/queries/curl/best-chain.sh new file mode 100755 index 000000000..1bb30fdc2 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/curl/best-chain.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/best-chain.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\"}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/curl/block.sh b/website/docs/developers/scripts/graphql-api/queries/curl/block.sh new file mode 100755 index 000000000..57ebb2836 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/curl/block.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/block.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\"}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/curl/current-snark-worker.sh b/website/docs/developers/scripts/graphql-api/queries/curl/current-snark-worker.sh new file mode 100755 index 000000000..ebbdfa22b --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/curl/current-snark-worker.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/current-snark-worker.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\"}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/curl/daemon-status.sh b/website/docs/developers/scripts/graphql-api/queries/curl/daemon-status.sh new file mode 100755 index 000000000..15729afa3 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/curl/daemon-status.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/daemon-status.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\"}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/curl/genesis-block.sh b/website/docs/developers/scripts/graphql-api/queries/curl/genesis-block.sh new file mode 100755 index 000000000..0a3c4c6b5 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/curl/genesis-block.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/genesis-block.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\"}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/curl/genesis-constants.sh b/website/docs/developers/scripts/graphql-api/queries/curl/genesis-constants.sh new file mode 100755 index 000000000..eacca6e18 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/curl/genesis-constants.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/genesis-constants.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\"}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/curl/network-id.sh b/website/docs/developers/scripts/graphql-api/queries/curl/network-id.sh new file mode 100755 index 000000000..2f0fbbda5 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/curl/network-id.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/network-id.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\"}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/curl/node-info.sh b/website/docs/developers/scripts/graphql-api/queries/curl/node-info.sh new file mode 100755 index 000000000..0464f3d94 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/curl/node-info.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/node-info.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\"}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/curl/pending-snark-work.sh b/website/docs/developers/scripts/graphql-api/queries/curl/pending-snark-work.sh new file mode 100755 index 000000000..d1b30ff4d --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/curl/pending-snark-work.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/pending-snark-work.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\"}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/curl/pooled-user-commands.sh b/website/docs/developers/scripts/graphql-api/queries/curl/pooled-user-commands.sh new file mode 100755 index 000000000..dbf2aec82 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/curl/pooled-user-commands.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/pooled-user-commands.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\", \"variables\": {\"publicKey\": \"B62qmGtQ7kn6zbw4tAYomBJJri1gZSThfQZJaMG6eR3tyNP3RiCcEQZ\"}}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/curl/pooled-zkapp-commands.sh b/website/docs/developers/scripts/graphql-api/queries/curl/pooled-zkapp-commands.sh new file mode 100755 index 000000000..a9daee794 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/curl/pooled-zkapp-commands.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/pooled-zkapp-commands.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\", \"variables\": {\"publicKey\": \"B62qmZB4E4KhmpYwoPDHe5c4yeQeAreCEwwgkGUrqSa6Ma3uC2RDZRY\"}}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/curl/recent-activity.sh b/website/docs/developers/scripts/graphql-api/queries/curl/recent-activity.sh new file mode 100755 index 000000000..a2a40a083 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/curl/recent-activity.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/recent-activity.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\"}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/curl/snark-pool.sh b/website/docs/developers/scripts/graphql-api/queries/curl/snark-pool.sh new file mode 100755 index 000000000..4e1d88d3a --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/curl/snark-pool.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/snark-pool.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\"}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/curl/sync-status.sh b/website/docs/developers/scripts/graphql-api/queries/curl/sync-status.sh new file mode 100755 index 000000000..33817d465 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/curl/sync-status.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/sync-status.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\"}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/curl/version.sh b/website/docs/developers/scripts/graphql-api/queries/curl/version.sh new file mode 100755 index 000000000..48c627806 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/curl/version.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/version.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\"}" \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/examples/transaction-status.graphql b/website/docs/developers/scripts/graphql-api/queries/examples/transaction-status.graphql new file mode 100644 index 000000000..574a78b6a --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/examples/transaction-status.graphql @@ -0,0 +1,3 @@ +query TransactionStatus($payment: String!) { + transactionStatus(payment: $payment) +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/examples/transaction-status.sh b/website/docs/developers/scripts/graphql-api/queries/examples/transaction-status.sh new file mode 100755 index 000000000..0319b7954 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/examples/transaction-status.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: $0 [GRAPHQL_ENDPOINT] +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (default: http://mina-rust-plain-1.gcp.o1test.net/graphql) + +GRAPHQL_ENDPOINT="${1:-http://mina-rust-plain-1.gcp.o1test.net/graphql}" + +# Replace with your own node endpoint: http://localhost:3000/graphql +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(tr '\n' ' ' < "$SCRIPT_DIR/../query/transaction-status.graphql" | sed 's/ */ /g') +curl -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\", \"variables\": {\"payment\": \"5Ju2GQkUHy8iMXaeJDbDCyaV8fR1in3ewuM82Rq4z3sdqNrKkzgp\"}}" diff --git a/website/docs/developers/scripts/graphql-api/queries/query/account-balance.graphql b/website/docs/developers/scripts/graphql-api/queries/query/account-balance.graphql new file mode 100644 index 000000000..bb783120d --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/query/account-balance.graphql @@ -0,0 +1,13 @@ +query GetBalance($publicKey: String!) { + account(publicKey: $publicKey) { + balance { + total + liquid + locked + } + nonce + delegateAccount { + publicKey + } + } +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/query/account.graphql b/website/docs/developers/scripts/graphql-api/queries/query/account.graphql new file mode 100644 index 000000000..8353e8d2c --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/query/account.graphql @@ -0,0 +1,37 @@ +query GetAccount($publicKey: String!) { + account(publicKey: $publicKey) { + balance { + total + liquid + locked + } + nonce + delegateAccount { + publicKey + } + votingFor + receiptChainHash + publicKey + token + tokenSymbol + zkappUri + zkappState + permissions { + editState + send + receive + access + setDelegate + setPermissions + setVerificationKey { + auth + txnVersion + } + setZkappUri + editActionState + setTokenSymbol + incrementNonce + setVotingFor + } + } +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/query/basic-connectivity.graphql b/website/docs/developers/scripts/graphql-api/queries/query/basic-connectivity.graphql new file mode 100644 index 000000000..16050551c --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/query/basic-connectivity.graphql @@ -0,0 +1 @@ +{ __typename } \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/query/best-chain.graphql b/website/docs/developers/scripts/graphql-api/queries/query/best-chain.graphql new file mode 100644 index 000000000..39d3f07fc --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/query/best-chain.graphql @@ -0,0 +1,20 @@ +query RecentBlocks { + bestChain(maxLength: 10) { + stateHash + protocolState { + consensusState { + blockHeight + slotSinceGenesis + } + previousStateHash + } + transactions { + userCommands { + id + fee + amount + memo + } + } + } +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/query/block.graphql b/website/docs/developers/scripts/graphql-api/queries/query/block.graphql new file mode 100644 index 000000000..c09bf6bb0 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/query/block.graphql @@ -0,0 +1,19 @@ +query GetLatestBlock { + bestChain(maxLength: 1) { + stateHash + protocolState { + consensusState { + blockHeight + } + } + creator + transactions { + userCommands { + amount + fee + from + to + } + } + } +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/query/current-snark-worker.graphql b/website/docs/developers/scripts/graphql-api/queries/query/current-snark-worker.graphql new file mode 100644 index 000000000..86e997ab2 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/query/current-snark-worker.graphql @@ -0,0 +1,12 @@ +query CurrentSnarkWorker { + currentSnarkWorker { + key + fee + account { + publicKey + balance { + total + } + } + } +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/query/daemon-status.graphql b/website/docs/developers/scripts/graphql-api/queries/query/daemon-status.graphql new file mode 100644 index 000000000..65f76c24b --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/query/daemon-status.graphql @@ -0,0 +1,12 @@ +query { + daemonStatus { + blockchainLength + chainId + commitId + stateHash + numAccounts + globalSlotSinceGenesisBestTip + ledgerMerkleRoot + coinbaseReceiver + } +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/query/genesis-block.graphql b/website/docs/developers/scripts/graphql-api/queries/query/genesis-block.graphql new file mode 100644 index 000000000..65d1e0a7b --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/query/genesis-block.graphql @@ -0,0 +1,10 @@ +query { + genesisBlock { + stateHash + protocolState { + consensusState { + blockHeight + } + } + } +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/query/genesis-constants.graphql b/website/docs/developers/scripts/graphql-api/queries/query/genesis-constants.graphql new file mode 100644 index 000000000..21944940f --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/query/genesis-constants.graphql @@ -0,0 +1,7 @@ +query { + genesisConstants { + accountCreationFee + genesisTimestamp + coinbase + } +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/query/network-id.graphql b/website/docs/developers/scripts/graphql-api/queries/query/network-id.graphql new file mode 100644 index 000000000..0285b017b --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/query/network-id.graphql @@ -0,0 +1,3 @@ +query { + networkID +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/query/node-info.graphql b/website/docs/developers/scripts/graphql-api/queries/query/node-info.graphql new file mode 100644 index 000000000..d041f0e3d --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/query/node-info.graphql @@ -0,0 +1,8 @@ +query NodeInfo { + networkID + version + daemonStatus { + blockchainLength + chainId + } +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/query/pending-snark-work.graphql b/website/docs/developers/scripts/graphql-api/queries/query/pending-snark-work.graphql new file mode 100644 index 000000000..92599b0f3 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/query/pending-snark-work.graphql @@ -0,0 +1,11 @@ +query PendingSnarkWork { + pendingSnarkWork { + workBundle { + sourceFirstPassLedgerHash + targetFirstPassLedgerHash + sourceSecondPassLedgerHash + targetSecondPassLedgerHash + workId + } + } +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/query/pooled-user-commands.graphql b/website/docs/developers/scripts/graphql-api/queries/query/pooled-user-commands.graphql new file mode 100644 index 000000000..f431dc1bf --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/query/pooled-user-commands.graphql @@ -0,0 +1,14 @@ +query PooledUserCommands($publicKey: String) { + pooledUserCommands(publicKey: $publicKey) { + id + amount + fee + from + to + nonce + memo + isDelegation + hash + kind + } +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/query/pooled-zkapp-commands.graphql b/website/docs/developers/scripts/graphql-api/queries/query/pooled-zkapp-commands.graphql new file mode 100644 index 000000000..94ba677eb --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/query/pooled-zkapp-commands.graphql @@ -0,0 +1,24 @@ +query PooledZkApps($publicKey: String) { + pooledZkappCommands(publicKey: $publicKey) { + id + hash + zkappCommand { + feePayer { + body { + publicKey + fee + nonce + } + } + accountUpdates { + body { + publicKey + balanceChange { + magnitude + sgn + } + } + } + } + } +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/query/recent-activity.graphql b/website/docs/developers/scripts/graphql-api/queries/query/recent-activity.graphql new file mode 100644 index 000000000..74d923762 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/query/recent-activity.graphql @@ -0,0 +1,18 @@ +query RecentActivity { + bestChain(maxLength: 5) { + stateHash + protocolState { + consensusState { + blockHeight + } + } + transactions { + userCommands { + amount + fee + from + to + } + } + } +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/query/snark-pool.graphql b/website/docs/developers/scripts/graphql-api/queries/query/snark-pool.graphql new file mode 100644 index 000000000..a374992f1 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/query/snark-pool.graphql @@ -0,0 +1,6 @@ +query SnarkPool { + snarkPool { + fee + prover + } +} \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/query/sync-status.graphql b/website/docs/developers/scripts/graphql-api/queries/query/sync-status.graphql new file mode 100644 index 000000000..ee472a532 --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/query/sync-status.graphql @@ -0,0 +1 @@ +{ syncStatus } \ No newline at end of file diff --git a/website/docs/developers/scripts/graphql-api/queries/query/version.graphql b/website/docs/developers/scripts/graphql-api/queries/query/version.graphql new file mode 100644 index 000000000..57631255e --- /dev/null +++ b/website/docs/developers/scripts/graphql-api/queries/query/version.graphql @@ -0,0 +1,3 @@ +query { + version +} \ No newline at end of file From 8884058ef0bad13a584d9ebda360fbc68fd590b5 Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Thu, 18 Sep 2025 16:48:17 +0200 Subject: [PATCH 3/4] Website/infrastructure: add documentation with o1Labs infra --- .../workflows/test-docs-infrastructure.yaml | 367 ++++++++++++++++++ website/docs/developers/getting-started.mdx | 12 + .../scripts/infrastructure/plain-nodes.txt | 3 + .../queries/block-height.graphql | 1 + .../queries/daemon-status.graphql | 1 + .../infrastructure/queries/peers.graphql | 1 + .../queries/schema-introspection.graphql | 1 + .../infrastructure/query-block-height.sh | 17 + .../infrastructure/query-daemon-status.sh | 17 + .../scripts/infrastructure/query-peers.sh | 17 + .../scripts/infrastructure/seed-nodes.txt | 3 + .../infrastructure/test-connectivity.sh | 16 + .../infrastructure/test-graphql-endpoint.sh | 17 + .../infrastructure/archive-nodes.mdx | 29 ++ .../infrastructure/frontend.mdx | 29 ++ .../infrastructure/plain-nodes.mdx | 152 ++++++++ .../infrastructure/seed-nodes.mdx | 103 +++++ website/sidebars.ts | 10 + 18 files changed, 796 insertions(+) create mode 100644 .github/workflows/test-docs-infrastructure.yaml create mode 100644 website/docs/developers/scripts/infrastructure/plain-nodes.txt create mode 100644 website/docs/developers/scripts/infrastructure/queries/block-height.graphql create mode 100644 website/docs/developers/scripts/infrastructure/queries/daemon-status.graphql create mode 100644 website/docs/developers/scripts/infrastructure/queries/peers.graphql create mode 100644 website/docs/developers/scripts/infrastructure/queries/schema-introspection.graphql create mode 100755 website/docs/developers/scripts/infrastructure/query-block-height.sh create mode 100755 website/docs/developers/scripts/infrastructure/query-daemon-status.sh create mode 100755 website/docs/developers/scripts/infrastructure/query-peers.sh create mode 100644 website/docs/developers/scripts/infrastructure/seed-nodes.txt create mode 100755 website/docs/developers/scripts/infrastructure/test-connectivity.sh create mode 100755 website/docs/developers/scripts/infrastructure/test-graphql-endpoint.sh create mode 100644 website/docs/node-operators/infrastructure/archive-nodes.mdx create mode 100644 website/docs/node-operators/infrastructure/frontend.mdx create mode 100644 website/docs/node-operators/infrastructure/plain-nodes.mdx create mode 100644 website/docs/node-operators/infrastructure/seed-nodes.mdx diff --git a/.github/workflows/test-docs-infrastructure.yaml b/.github/workflows/test-docs-infrastructure.yaml new file mode 100644 index 000000000..e6c242f1a --- /dev/null +++ b/.github/workflows/test-docs-infrastructure.yaml @@ -0,0 +1,367 @@ +name: Test Documentation Scripts - Infrastructure + +# Test infrastructure connectivity and infrastructure scripts +on: + schedule: + # Run daily at 6 AM UTC to catch infrastructure issues early + - cron: '0 6 * * *' + workflow_dispatch: + # Allow manual triggering for testing + pull_request: + # Always run on pull requests + push: + branches: [ main, develop ] + +jobs: + test-seed-nodes: + name: Test Seed Node Connectivity + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Test seed node connectivity + run: | + echo "🔍 Testing o1Labs seed node connectivity..." + + # Read seed nodes from file + seed_file="website/docs/developers/scripts/infrastructure/seed-nodes.txt" + + if [ ! -f "$seed_file" ]; then + echo "❌ Seed nodes file not found: $seed_file" + exit 1 + fi + + failed=0 + + # Extract hostnames from multiaddress format and test connectivity + while IFS= read -r seed_address; do + # Extract hostname from multiaddress: /peer-id/https/hostname/port + hostname=$(echo "$seed_address" | cut -d'/' -f4) + + if [ -z "$hostname" ]; then + echo "❌ Could not extract hostname from: $seed_address" + failed=$((failed + 1)) + continue + fi + + echo "Testing connectivity to $hostname (from $seed_address)..." + + # Test HTTPS connectivity (port 443) + if curl -s --connect-timeout 10 --max-time 30 "https://$hostname" > /dev/null 2>&1; then + echo "✅ $hostname is reachable via HTTPS" + else + echo "❌ $hostname is not reachable via HTTPS" + failed=$((failed + 1)) + fi + + # Test basic DNS resolution (non-fatal for now) + if nslookup "$hostname" > /dev/null 2>&1; then + echo "✅ $hostname DNS resolution successful" + else + echo "⚠️ $hostname DNS resolution failed (may be environment-specific)" + fi + + echo "---" + done < "$seed_file" + + if [ $failed -gt 0 ]; then + echo "💥 $failed connectivity tests failed" + echo "Infrastructure issues detected. Please check seed node status." + exit 1 + else + echo "🎉 All seed nodes are healthy and reachable" + fi + + - name: Test seed node response headers + run: | + echo "🔍 Testing seed node HTTP response headers..." + + # Read seed nodes from file + seed_file="website/docs/developers/scripts/infrastructure/seed-nodes.txt" + + if [ ! -f "$seed_file" ]; then + echo "❌ Seed nodes file not found: $seed_file" + exit 1 + fi + + # Extract hostnames from multiaddress format and test headers + while IFS= read -r seed_address; do + # Extract hostname from multiaddress: /peer-id/https/hostname/port + hostname=$(echo "$seed_address" | cut -d'/' -f4) + + if [ -z "$hostname" ]; then + echo "❌ Could not extract hostname from: $seed_address" + continue + fi + + echo "Checking headers for $hostname (from $seed_address)..." + + # Get response headers (ignore cert issues for now) + if headers=$(curl -s -I --connect-timeout 10 --max-time 30 "https://$hostname" 2>/dev/null); then + echo "✅ $hostname returned headers:" + echo "$headers" | head -5 | sed 's/^/ /' + else + echo "⚠️ $hostname did not return headers (may be expected for WebRTC endpoints)" + fi + + echo "---" + done < "$seed_file" + + verify-seed-node-format: + name: Verify Seed Node Address Format + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Verify seed nodes are subset of official seeds + run: | + echo "🔍 Verifying seed nodes are subset of official o1Labs seeds..." + + # Download official seeds list + official_seeds_url="https://raw.githubusercontent.com/o1-labs/seeds/main/networks/devnet-webrtc.txt" + curl -s "$official_seeds_url" > /tmp/official-seeds.txt + + if [ ! -s /tmp/official-seeds.txt ]; then + echo "❌ Failed to download official seeds list" + exit 1 + fi + + echo "Downloaded official seeds list" + + # Read our seed nodes + seed_file="website/docs/developers/scripts/infrastructure/seed-nodes.txt" + our_seeds=$(cat "$seed_file") + + # Check each of our seeds exists in official list + missing=0 + while IFS= read -r seed; do + if grep -Fxq "$seed" /tmp/official-seeds.txt; then + echo "✅ Found in official list: $seed" + else + echo "❌ Missing from official list: $seed" + missing=$((missing + 1)) + fi + done <<< "$our_seeds" + + if [ $missing -gt 0 ]; then + echo "💥 $missing seed node(s) not found in official seeds" + echo "Official seeds list:" + cat /tmp/official-seeds.txt + exit 1 + else + echo "🎉 All seed nodes are present in official seeds list" + fi + + test-plain-nodes: + name: Test Plain Node Connectivity + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Test plain node GraphQL endpoints + run: | + echo "🔍 Testing plain node GraphQL connectivity..." + + # Read plain nodes from file + plain_nodes_file="website/docs/developers/scripts/infrastructure/plain-nodes.txt" + + if [ ! -f "$plain_nodes_file" ]; then + echo "❌ Plain nodes file not found: $plain_nodes_file" + exit 1 + fi + + plain_nodes=$(cat "$plain_nodes_file") + failed=0 + + for node_url in $plain_nodes; do + echo "Testing GraphQL endpoint: $node_url" + + # Test basic HTTP connectivity + if curl -s --connect-timeout 10 --max-time 30 "$node_url" > /dev/null 2>&1; then + echo "✅ $node_url is reachable via HTTP" + else + echo "❌ $node_url is not reachable via HTTP" + failed=$((failed + 1)) + continue + fi + + # Test GraphQL endpoint using website scripts + graphql_url="${node_url}graphql" + + # Test daemon status query using the website script + if response=$(bash website/docs/developers/scripts/graphql-api/queries/curl/daemon-status.sh "$graphql_url" 2>/dev/null); then + # Extract JSON response (skip curl progress output) + json_response=$(echo "$response" | grep "^{") + + # Check if it's valid JSON + if echo "$json_response" | jq . > /dev/null 2>&1; then + # Check for GraphQL errors + if echo "$json_response" | jq -e '.errors' > /dev/null 2>&1; then + echo "⚠️ $graphql_url returned GraphQL error:" + echo "$json_response" | jq '.errors' + # Check for valid data + elif echo "$json_response" | jq -e '.data.daemonStatus' > /dev/null 2>&1; then + echo "✅ $graphql_url GraphQL query successful" + sync_status=$(echo "$json_response" | jq -r '.data.daemonStatus.syncStatus // "unknown"') + chain_id=$(echo "$json_response" | jq -r '.data.daemonStatus.chainId // "unknown"') + echo " Sync Status: $sync_status, Chain ID: ${chain_id:0:16}..." + else + echo "⚠️ $graphql_url unexpected response format" + fi + else + echo "⚠️ $graphql_url did not return valid JSON: $(echo "$response" | head -c 100)..." + fi + else + echo "❌ $graphql_url GraphQL query failed" + failed=$((failed + 1)) + fi + + echo "---" + done + + if [ $failed -gt 0 ]; then + echo "💥 $failed plain node tests failed" + echo "Infrastructure issues detected. Please check plain node status." + exit 1 + else + echo "🎉 All plain nodes are healthy and responding" + fi + + - name: Test plain node API capabilities + run: | + echo "🔍 Testing plain node API capabilities..." + + # Read plain nodes from file + plain_nodes_file="website/docs/developers/scripts/infrastructure/plain-nodes.txt" + plain_nodes=$(cat "$plain_nodes_file") + + # Test with first available node + for node_url in $plain_nodes; do + graphql_url="${node_url}graphql" + + echo "Testing API capabilities on: $graphql_url" + + # Test network ID query using website script + network_success=false + if network_response=$(bash website/docs/developers/scripts/graphql-api/queries/curl/network-id.sh "$graphql_url" 2>/dev/null); then + network_json=$(echo "$network_response" | grep "^{") + if echo "$network_json" | jq -e '.data.networkID' > /dev/null 2>&1; then + network_id=$(echo "$network_json" | jq -r '.data.networkID') + echo "✅ Network ID query successful: $network_id" + network_success=true + else + echo "⚠️ Network ID query failed or unexpected response" + fi + else + echo "⚠️ Network ID query script failed" + fi + + # Test best chain query using website script + chain_success=false + if chain_response=$(bash website/docs/developers/scripts/graphql-api/queries/curl/best-chain.sh "$graphql_url" 2>/dev/null); then + chain_json=$(echo "$chain_response" | grep "^{") + if echo "$chain_json" | jq -e '.data.bestChain[0].stateHash' > /dev/null 2>&1; then + state_hash=$(echo "$chain_json" | jq -r '.data.bestChain[0].stateHash') + echo "✅ Best chain query successful: ${state_hash:0:16}..." + chain_success=true + else + echo "⚠️ Best chain query failed or unexpected response" + fi + else + echo "⚠️ Best chain query script failed" + fi + + # We only need to test one working node + if [ "$network_success" = true ] && [ "$chain_success" = true ]; then + echo "🎉 Plain node API capabilities verified" + break + fi + done + + - name: Test infrastructure scripts + run: | + echo "🔍 Testing infrastructure command scripts..." + + # Dynamically discover all bash scripts in the infrastructure directory + script_dir="website/docs/developers/scripts/infrastructure" + + if [ ! -d "$script_dir" ]; then + echo "❌ Script directory not found: $script_dir" + exit 1 + fi + + # Get all .sh files in the infrastructure directory + script_files=$(ls "$script_dir"/*.sh 2>/dev/null) + + if [ -z "$script_files" ]; then + echo "❌ No bash scripts found in $script_dir" + exit 1 + fi + + failed=0 + + # Use first plain node for testing infrastructure scripts + plain_nodes_file="website/docs/developers/scripts/infrastructure/plain-nodes.txt" + test_endpoint="" + if [ -f "$plain_nodes_file" ]; then + first_node=$(head -n 1 "$plain_nodes_file") + test_endpoint="${first_node}graphql" + else + # Fallback endpoint if file not found + test_endpoint="http://mina-rust-plain-1.gcp.o1test.net/graphql" + fi + + for script_file in $script_files; do + if [ ! -f "$script_file" ]; then + echo "❌ Script file not found: $script_file" + failed=$((failed + 1)) + continue + fi + + echo "Testing script: $script_file" + + # Execute the script with test endpoint and capture output + if output=$(timeout 30 bash "$script_file" "$test_endpoint" 2>&1); then + echo "✅ Script executed successfully" + + # Try to parse output as JSON using jq + if json_response=$(echo "$output" | jq . 2>/dev/null); then + # Valid JSON response - check for GraphQL errors + if echo "$json_response" | jq -e '.errors' > /dev/null 2>&1; then + echo "❌ Script returned GraphQL errors:" + echo "$json_response" | jq '.errors' + failed=$((failed + 1)) + elif echo "$json_response" | jq -e '.data' > /dev/null 2>&1; then + echo "✅ Script response contains valid data: $(echo "$json_response" | head -c 100)..." + else + echo "⚠️ Unexpected JSON response format: $(echo "$json_response" | head -c 100)..." + fi + else + # Non-JSON output - just validate it looks reasonable + echo "✅ Script response (non-JSON): $(echo "$output" | head -c 100)..." + fi + else + echo "❌ Script execution failed: $script_file" + failed=$((failed + 1)) + fi + + echo "---" + done + + if [ $failed -gt 0 ]; then + echo "💥 $failed infrastructure script tests failed" + echo "Some infrastructure scripts may need updates." + exit 1 + else + echo "🎉 All infrastructure command scripts are working" + fi + diff --git a/website/docs/developers/getting-started.mdx b/website/docs/developers/getting-started.mdx index 3bcbf8bfd..f737b8741 100644 --- a/website/docs/developers/getting-started.mdx +++ b/website/docs/developers/getting-started.mdx @@ -218,6 +218,18 @@ state machine pattern, and component organization, please see the ./target/release/mina node --network devnet ``` + + +:::tip Connect to o1Labs Infrastructure + +For reliable network connectivity, you can connect to o1Labs maintained seed +nodes. See the [Seed Nodes](../node-operators/infrastructure/seed-nodes) +documentation for official seed node addresses and connection instructions. + +::: + + + ### Archive Node ```bash diff --git a/website/docs/developers/scripts/infrastructure/plain-nodes.txt b/website/docs/developers/scripts/infrastructure/plain-nodes.txt new file mode 100644 index 000000000..9fd43af2d --- /dev/null +++ b/website/docs/developers/scripts/infrastructure/plain-nodes.txt @@ -0,0 +1,3 @@ +http://mina-rust-plain-1.gcp.o1test.net/ +http://mina-rust-plain-2.gcp.o1test.net/ +http://mina-rust-plain-3.gcp.o1test.net/ \ No newline at end of file diff --git a/website/docs/developers/scripts/infrastructure/queries/block-height.graphql b/website/docs/developers/scripts/infrastructure/queries/block-height.graphql new file mode 100644 index 000000000..752b8f2c4 --- /dev/null +++ b/website/docs/developers/scripts/infrastructure/queries/block-height.graphql @@ -0,0 +1 @@ +{ bestChain(maxLength: 1) { protocolState { consensusState { blockHeight } } } } \ No newline at end of file diff --git a/website/docs/developers/scripts/infrastructure/queries/daemon-status.graphql b/website/docs/developers/scripts/infrastructure/queries/daemon-status.graphql new file mode 100644 index 000000000..70ed4e26f --- /dev/null +++ b/website/docs/developers/scripts/infrastructure/queries/daemon-status.graphql @@ -0,0 +1 @@ +{ daemonStatus { blockchainLength chainId } } \ No newline at end of file diff --git a/website/docs/developers/scripts/infrastructure/queries/peers.graphql b/website/docs/developers/scripts/infrastructure/queries/peers.graphql new file mode 100644 index 000000000..613d6cbed --- /dev/null +++ b/website/docs/developers/scripts/infrastructure/queries/peers.graphql @@ -0,0 +1 @@ +{ daemonStatus { peers { peerId address connectionStatus } } } \ No newline at end of file diff --git a/website/docs/developers/scripts/infrastructure/queries/schema-introspection.graphql b/website/docs/developers/scripts/infrastructure/queries/schema-introspection.graphql new file mode 100644 index 000000000..0cc8ac230 --- /dev/null +++ b/website/docs/developers/scripts/infrastructure/queries/schema-introspection.graphql @@ -0,0 +1 @@ +{ __schema { types { name } } } \ No newline at end of file diff --git a/website/docs/developers/scripts/infrastructure/query-block-height.sh b/website/docs/developers/scripts/infrastructure/query-block-height.sh new file mode 100755 index 000000000..b25998594 --- /dev/null +++ b/website/docs/developers/scripts/infrastructure/query-block-height.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Usage: $0 GRAPHQL_ENDPOINT +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (required) + +if [ -z "$1" ]; then + echo "Error: GRAPHQL_ENDPOINT is required" + echo "Usage: $0 GRAPHQL_ENDPOINT" + exit 1 +fi + +GRAPHQL_ENDPOINT="$1" + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(cat "$SCRIPT_DIR/queries/block-height.graphql") +curl -s -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\"}" \ No newline at end of file diff --git a/website/docs/developers/scripts/infrastructure/query-daemon-status.sh b/website/docs/developers/scripts/infrastructure/query-daemon-status.sh new file mode 100755 index 000000000..e13b3d807 --- /dev/null +++ b/website/docs/developers/scripts/infrastructure/query-daemon-status.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Usage: $0 GRAPHQL_ENDPOINT +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (required) + +if [ -z "$1" ]; then + echo "Error: GRAPHQL_ENDPOINT is required" + echo "Usage: $0 GRAPHQL_ENDPOINT" + exit 1 +fi + +GRAPHQL_ENDPOINT="$1" + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(cat "$SCRIPT_DIR/queries/daemon-status.graphql") +curl -s -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\"}" \ No newline at end of file diff --git a/website/docs/developers/scripts/infrastructure/query-peers.sh b/website/docs/developers/scripts/infrastructure/query-peers.sh new file mode 100755 index 000000000..dfd1a4095 --- /dev/null +++ b/website/docs/developers/scripts/infrastructure/query-peers.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Usage: $0 GRAPHQL_ENDPOINT +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (required) + +if [ -z "$1" ]; then + echo "Error: GRAPHQL_ENDPOINT is required" + echo "Usage: $0 GRAPHQL_ENDPOINT" + exit 1 +fi + +GRAPHQL_ENDPOINT="$1" + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(cat "$SCRIPT_DIR/queries/peers.graphql") +curl -s -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\"}" \ No newline at end of file diff --git a/website/docs/developers/scripts/infrastructure/seed-nodes.txt b/website/docs/developers/scripts/infrastructure/seed-nodes.txt new file mode 100644 index 000000000..9ddc5ea66 --- /dev/null +++ b/website/docs/developers/scripts/infrastructure/seed-nodes.txt @@ -0,0 +1,3 @@ +/2az589QvS6i3EJiVKUfVHCkyqf4khGy9PjQF7nSQuveF27wp7xX/https/mina-rust-seed-1.gcp.o1test.net/443 +/2cJEbhytxfdeqdGTrnBikvdqLGxSRJMjDAUP9P92iUnuE3qayFp/https/mina-rust-seed-2.gcp.o1test.net/443 +/2bH4u5xMoM8noHyS9Fs1QiDqZrEQczeHTDfJahWkRvCCP87nCdu/https/mina-rust-seed-3.gcp.o1test.net/443 diff --git a/website/docs/developers/scripts/infrastructure/test-connectivity.sh b/website/docs/developers/scripts/infrastructure/test-connectivity.sh new file mode 100755 index 000000000..d12317474 --- /dev/null +++ b/website/docs/developers/scripts/infrastructure/test-connectivity.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Usage: $0 GRAPHQL_ENDPOINT +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (required) + +if [ -z "$1" ]; then + echo "Error: GRAPHQL_ENDPOINT is required" + echo "Usage: $0 GRAPHQL_ENDPOINT" + exit 1 +fi + +GRAPHQL_ENDPOINT="$1" + +# Extract base URL from GraphQL endpoint (remove /graphql suffix) +BASE_URL=${GRAPHQL_ENDPOINT%/graphql} + +curl -s -I "$BASE_URL/" \ No newline at end of file diff --git a/website/docs/developers/scripts/infrastructure/test-graphql-endpoint.sh b/website/docs/developers/scripts/infrastructure/test-graphql-endpoint.sh new file mode 100755 index 000000000..9f79fcacd --- /dev/null +++ b/website/docs/developers/scripts/infrastructure/test-graphql-endpoint.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Usage: $0 GRAPHQL_ENDPOINT +# GRAPHQL_ENDPOINT: GraphQL endpoint URL (required) + +if [ -z "$1" ]; then + echo "Error: GRAPHQL_ENDPOINT is required" + echo "Usage: $0 GRAPHQL_ENDPOINT" + exit 1 +fi + +GRAPHQL_ENDPOINT="$1" + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QUERY=$(cat "$SCRIPT_DIR/queries/schema-introspection.graphql") +curl -s -X POST "$GRAPHQL_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "{\"query\": \"$QUERY\"}" \ No newline at end of file diff --git a/website/docs/node-operators/infrastructure/archive-nodes.mdx b/website/docs/node-operators/infrastructure/archive-nodes.mdx new file mode 100644 index 000000000..abb76aa23 --- /dev/null +++ b/website/docs/node-operators/infrastructure/archive-nodes.mdx @@ -0,0 +1,29 @@ +--- +title: Archive Nodes +description: o1Labs archive node infrastructure for historical data access +sidebar_position: 3 +--- + +# Archive Nodes + + + +:::caution Under Construction + +This page is currently under construction. o1Labs archive node infrastructure +documentation will be added here once the archive nodes are deployed and +available. + +Archive nodes will provide: + +- Historical blockchain data access +- Complete transaction history +- Block and state archival +- Database query interfaces + +Check back soon for complete documentation on accessing o1Labs archive +infrastructure. + +::: + + diff --git a/website/docs/node-operators/infrastructure/frontend.mdx b/website/docs/node-operators/infrastructure/frontend.mdx new file mode 100644 index 000000000..d6c9211da --- /dev/null +++ b/website/docs/node-operators/infrastructure/frontend.mdx @@ -0,0 +1,29 @@ +--- +title: Frontend +description: o1Labs frontend infrastructure for web-based network interaction +sidebar_position: 4 +--- + +# Frontend + + + +:::caution Under Construction + +This page is currently under construction. o1Labs frontend infrastructure +documentation will be added here once the production frontend is deployed and +available. + +The frontend will provide: + +- Web-based network monitoring +- Real-time blockchain statistics +- Node management interface +- Network visualization tools + +Check back soon for complete documentation on accessing the o1Labs frontend +infrastructure. + +::: + + diff --git a/website/docs/node-operators/infrastructure/plain-nodes.mdx b/website/docs/node-operators/infrastructure/plain-nodes.mdx new file mode 100644 index 000000000..3e538a8e4 --- /dev/null +++ b/website/docs/node-operators/infrastructure/plain-nodes.mdx @@ -0,0 +1,152 @@ +--- +title: Plain Nodes +description: o1Labs plain node infrastructure for network interaction +sidebar_position: 2 +--- + +import CodeBlock from "@theme/CodeBlock"; +import PlainNodesList from "!!raw-loader!../../developers/scripts/infrastructure/plain-nodes.txt"; +import QueryDaemonStatus from "!!raw-loader!../../developers/scripts/infrastructure/query-daemon-status.sh"; +import QueryBlockHeight from "!!raw-loader!../../developers/scripts/infrastructure/query-block-height.sh"; +import QueryPeers from "!!raw-loader!../../developers/scripts/infrastructure/query-peers.sh"; +import TestConnectivity from "!!raw-loader!../../developers/scripts/infrastructure/test-connectivity.sh"; +import TestGraphQLEndpoint from "!!raw-loader!../../developers/scripts/infrastructure/test-graphql-endpoint.sh"; + +# Plain Nodes + +o1Labs maintains plain node infrastructure that provides HTTP endpoints for +interacting with the Mina Rust network. These nodes offer API access and network +information without requiring direct peer-to-peer connections. + +## Available Plain Nodes + +The following plain nodes are officially maintained by o1Labs: + + + {PlainNodesList} + + +## Node Information + +- **Availability**: Maintained 24/7 by o1Labs +- **Purpose**: API access and network queries +- **Location**: Google Cloud Platform (GCP) + +## Using Plain Nodes + +### GraphQL API Access + +Plain nodes provide GraphQL API endpoints for querying network state: + + + {QueryDaemonStatus} + + +### Network Information + +You can query various network information: + + + {QueryBlockHeight} + + + + {QueryPeers} + + +## API Capabilities + +### Blockchain Queries + +- **Block information**: Current and historical blocks +- **Transaction data**: Transaction status and history +- **Account balances**: Account information and balances +- **Network state**: Consensus and sync status + +### Network Monitoring + +- **Peer connections**: Current peer list and status +- **Sync progress**: Blockchain synchronization state +- **Protocol information**: Network protocol version and chain ID + + + +:::info API Documentation + +For complete API documentation, see the +[GraphQL API](../../developers/graphql-api) documentation which provides +detailed information about available queries and mutations. + +::: + + + +## Troubleshooting + +### Connection Issues + +If you cannot connect to plain nodes: + +1. **Check network connectivity**: Ensure internet access and HTTP traffic is + allowed +2. **Verify URLs**: Confirm you're using the correct node URLs +3. **Test manually**: Try accessing the URLs in a browser +4. **Check node status**: Verify the node is responding to queries + +### API Errors + +Common API issues: + + + {TestConnectivity} + + + + {TestGraphQLEndpoint} + + +## Updates and Maintenance + +### Infrastructure Updates + +o1Labs maintains these plain nodes with: + +- **Regular updates**: Nodes are kept current with latest releases +- **Monitoring**: 24/7 health monitoring and alerting +- **Load balancing**: Multiple nodes ensure continuous availability +- **Performance optimization**: Regular performance tuning + +### Communication + +Infrastructure maintenance and updates are communicated through: + +- GitHub release notes +- Project documentation updates +- Community announcements + +## Reference Information + +### Related Documentation + +- [Seed Nodes](./seed-nodes) - P2P network bootstrap nodes +- [Archive Nodes](./archive-nodes) - Historical data access +- [Frontend](./frontend) - Web interface deployment +- [GraphQL API](../../developers/graphql-api) - Complete API documentation diff --git a/website/docs/node-operators/infrastructure/seed-nodes.mdx b/website/docs/node-operators/infrastructure/seed-nodes.mdx new file mode 100644 index 000000000..af587d846 --- /dev/null +++ b/website/docs/node-operators/infrastructure/seed-nodes.mdx @@ -0,0 +1,103 @@ +--- +title: Seed Nodes +description: Official o1Labs seed nodes for reliable network connectivity +sidebar_position: 1 +--- + +import CodeBlock from "@theme/CodeBlock"; +import SeedNodesList from "!!raw-loader!../../developers/scripts/infrastructure/seed-nodes.txt"; + +# Seed Nodes + +o1Labs maintains official seed nodes that provide reliable entry points for +connecting to the Mina Rust network. These nodes are recommended for use by node +operators who want to ensure stable connectivity. + +## Available Seed Nodes + +The following seed nodes are officially maintained by o1Labs: + + + {SeedNodesList} + + +## Configuration + +For information on how to configure your node to use these seed nodes, see the +[Network Configuration](../network-configuration) page. + + + +:::info Connectivity Testing + +These seed nodes are tested automatically by CI to ensure they remain +accessible. If you experience connectivity issues, please check the project's +GitHub Issues page for any known outages. + +::: + + + +## Troubleshooting + +### Connection Issues + +If you cannot connect to seed nodes: + +1. **Check network connectivity**: Ensure internet access and DNS resolution +2. **Verify firewall settings**: Allow outbound HTTPS connections +3. **Test manually**: Try `curl https://mina-rust-seed-1.gcp.o1test.net` +4. **Check node logs**: Look for connection error messages + +### DNS Resolution Problems + +```bash +# Test DNS resolution +nslookup mina-rust-seed-1.gcp.o1test.net + +# Alternative DNS servers +nslookup mina-rust-seed-1.gcp.o1test.net 8.8.8.8 +``` + +### Certificate Issues + +If you encounter TLS/SSL certificate problems: + +```bash +# Test certificate validity +openssl s_client -connect mina-rust-seed-1.gcp.o1test.net:443 \ + -servername mina-rust-seed-1.gcp.o1test.net +``` + +## Updates and Maintenance + +### Infrastructure Updates + +o1Labs maintains these seed nodes with: + +- **Regular updates**: Nodes are kept current with latest releases +- **Monitoring**: 24/7 health monitoring and alerting +- **Maintenance windows**: Scheduled updates with minimal downtime +- **Redundancy**: Multiple nodes ensure continuous availability + +### Communication + +Infrastructure maintenance and updates are communicated through: + +- GitHub release notes +- Project documentation updates +- Community announcements + +## Reference Information + +For the most current seed node information, always refer to the +[official seeds repository](https://github.com/o1-labs/seeds/blob/main/networks/devnet-webrtc.txt). + +### Related Documentation + +- [Plain Nodes](./plain-nodes) - Running standard Mina Rust nodes +- [Archive Nodes](./archive-nodes) - Historical data archival infrastructure +- [Frontend](./frontend) - Web interface deployment diff --git a/website/sidebars.ts b/website/sidebars.ts index b8ee6eac9..dcd3d33e8 100644 --- a/website/sidebars.ts +++ b/website/sidebars.ts @@ -40,6 +40,16 @@ const sidebars: SidebarsConfig = { 'node-operators/node-management', ], }, + { + type: 'category', + label: 'o1Labs Infrastructure', + items: [ + 'node-operators/infrastructure/seed-nodes', + 'node-operators/infrastructure/plain-nodes', + 'node-operators/infrastructure/archive-nodes', + 'node-operators/infrastructure/frontend', + ], + }, { type: 'category', label: 'Advanced Topics', From 386098bd9444707c92f6cc2502f1c63038785b1e Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Thu, 18 Sep 2025 17:07:53 +0200 Subject: [PATCH 4/4] CHANGELOG: add description for patch !1430 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6aa1288d..02bff6084 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Added + +- **Website**: add o1Labs infrastructure entry, describing the nodes managed by + o1Labs, including seed and plain nodes + ([#1430](https://github.com/o1-labs/mina-rust/pull/1430)). The infrastructure + is tested accordingly in the CI at every push. ### Changed - **CI**: Update CI to test on specific macOS versions (13, 14, 15) instead of only macos-latest, providing better coverage across macOS versions that developers are using ([#1421](https://github.com/o1-labs/mina-rust/pull/1421)) +- **Website**: update GraphQL API page by extracting all endpoints and run it in + CI, at every push, with the o1Labs managed plain nodes + ([#1421](https://github.com/o1-labs/mina-rust/pull/1421)). ## v0.17.0