Files
proxmox/thirdweb-core-2103-test/scripts/rpc-url-2103.sh
defiQUG dbd517b279 Sync workspace: config, docs, scripts, CI, operator rules, and submodule pointers.
- Update dbis_core, cross-chain-pmm-lps, explorer-monorepo, metamask-integration, pr-workspace/chains
- Omit embedded publish git dirs and empty placeholders from index

Made-with: Cursor
2026-04-12 06:12:20 -07:00

32 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# Print JSON-RPC URL for VMID 2103 (besu-rpc-core-thirdweb).
#
# Default: NPM HTTPS FQDN (E2E verified: eth_chainId 0x8a, forge script dry-run OK).
# LAN direct: set RPC_THIRDWEB_ADMIN_LAN_ONLY=1 or pass a full URL via RPC_URL_2103.
#
# Precedence: RPC_URL_2103 → RPC_TW_CORE_HTTP → RPC_THIRDWEB_ADMIN_CORE (if already http(s) URL)
# → if RPC_THIRDWEB_ADMIN_LAN_ONLY=1 then http://<RPC_THIRDWEB_ADMIN_CORE or 192.168.11.217>:8545
# → else https://rpc.tw-core.d-bis.org
set -euo pipefail
if [[ -n "${RPC_URL_2103:-}" ]]; then
printf '%s\n' "$RPC_URL_2103"
exit 0
fi
if [[ -n "${RPC_TW_CORE_HTTP:-}" ]]; then
printf '%s\n' "$RPC_TW_CORE_HTTP"
exit 0
fi
raw="${RPC_THIRDWEB_ADMIN_CORE:-}"
if [[ "$raw" =~ ^https?:// ]]; then
printf '%s\n' "$raw"
exit 0
fi
if [[ "${RPC_THIRDWEB_ADMIN_LAN_ONLY:-}" == "1" || "${RPC_THIRDWEB_ADMIN_LAN_ONLY:-}" == "true" ]]; then
host="${raw:-192.168.11.217}"
host="${host#http://}"
host="${host#https://}"
printf 'http://%s:8545\n' "$host"
exit 0
fi
printf '%s\n' "https://rpc.tw-core.d-bis.org"