#!/usr/bin/env bash # Schneller Zustandscheck fuer den Boot: Was ist wirklich live? # Verifiziert direkt an der Quelle statt Notizen zu glauben. set -uo pipefail cd "$(dirname "$0")/.." OWNER="5-NRCJ8Jg1fqtcvKaFYLsHBQ37_gyqsR9cOsxuzM748" POINTER="BUprgAw-XbRvvQPDcpL6Kds6-xPa2vmJfzmf7OLiLT4" code() { curl -s -o /dev/null -w "%{http_code}" -L --max-time 20 "$1"; } echo "== Pointer (permanente Adresse)" echo " https://arweave.net/$POINTER -> HTTP $(code "https://arweave.net/$POINTER")" echo "== Neuestes Site-Manifest laut GraphQL (arweave.net, Zeiger-Logik: Block+Published-At)" LATEST=$(curl -s --max-time 20 https://arweave.net/graphql -H 'content-type: application/json' -d "{\"query\":\"query { transactions(owners: [\\\"$OWNER\\\"], tags: [{name: \\\"App-Name\\\", values: [\\\"kiel-site\\\"]}, {name: \\\"Content-Type\\\", values: [\\\"application/x.arweave-manifest+json\\\"]}], sort: HEIGHT_DESC, first: 10) { edges { node { id block { height } tags { name value } } } } }\"}" \ | python3 -c " import sys, json edges = json.load(sys.stdin)['data']['transactions']['edges'] best, bh, bt = 'KEINS', -1, -1 for e in edges: n = e['node'] h = n['block']['height'] if n['block'] else float('inf') t = next((int(tag['value']) for tag in n['tags'] if tag['name'] == 'Published-At'), -1) if h > bh or (h == bh and t > bt): best, bh, bt = n['id'], h, t print(best)") echo " $LATEST" if [ "$LATEST" != "KEINS" ]; then echo " https://arweave.net/$LATEST/ -> HTTP $(code "https://arweave.net/$LATEST/")" fi echo "== Letzter lokaler Upload (publish/last-upload.json)" python3 -c "import json; print(' ' + json.load(open('publish/last-upload.json'))['manifestResponse']['id'])" 2>/dev/null || echo " (keine Datei)" echo "== Subdomain (falls Ronny den Redirect gesetzt hat)" echo " http://kiel.overlkd.com -> HTTP $(code "http://kiel.overlkd.com")" echo "== Solana-Wallet (sollte 0 sein, kein Geld angefordert)" curl -s --max-time 20 https://api.mainnet-beta.solana.com -H 'content-type: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"getBalance","params":["8Ln1zb7vUqLuHbEVg3rPBWUaoor2YJsucMtHzYCd5E6Z"]}' \ | python3 -c "import sys,json; print(' ' + str(json.load(sys.stdin)['result']['value']/1e9) + ' SOL')" 2>/dev/null || echo " (RPC nicht erreichbar)"