Some checks failed
AITBC CI/CD Pipeline / lint-and-test (3.11) (pull_request) Has been cancelled
AITBC CI/CD Pipeline / lint-and-test (3.12) (pull_request) Has been cancelled
AITBC CI/CD Pipeline / lint-and-test (3.13) (pull_request) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.11) (pull_request) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.12) (pull_request) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.13) (pull_request) Has been cancelled
Security Scanning / Bandit Security Scan (apps/coordinator-api/src) (pull_request) Has been cancelled
Security Scanning / Bandit Security Scan (cli/aitbc_cli) (pull_request) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-core/src) (pull_request) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-crypto/src) (pull_request) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-sdk/src) (pull_request) Has been cancelled
Security Scanning / Bandit Security Scan (tests) (pull_request) Has been cancelled
Security Scanning / CodeQL Security Analysis (javascript) (pull_request) Has been cancelled
Security Scanning / CodeQL Security Analysis (python) (pull_request) Has been cancelled
Security Scanning / Dependency Security Scan (pull_request) Has been cancelled
Security Scanning / Container Security Scan (pull_request) Has been cancelled
Security Scanning / OSSF Scorecard (pull_request) Has been cancelled
AITBC CI/CD Pipeline / test-cli (pull_request) Has been cancelled
AITBC CI/CD Pipeline / test-services (pull_request) Has been cancelled
AITBC CI/CD Pipeline / test-production-services (pull_request) Has been cancelled
AITBC CI/CD Pipeline / security-scan (pull_request) Has been cancelled
AITBC CI/CD Pipeline / build (pull_request) Has been cancelled
AITBC CI/CD Pipeline / deploy-staging (pull_request) Has been cancelled
AITBC CI/CD Pipeline / deploy-production (pull_request) Has been cancelled
AITBC CI/CD Pipeline / performance-test (pull_request) Has been cancelled
AITBC CI/CD Pipeline / docs (pull_request) Has been cancelled
AITBC CI/CD Pipeline / release (pull_request) Has been cancelled
AITBC CI/CD Pipeline / notify (pull_request) Has been cancelled
AITBC CLI Level 1 Commands Test / test-summary (pull_request) Has been cancelled
Security Scanning / Security Summary Report (pull_request) Has been cancelled
- Update blockchain node scripts for devnet and mainnet - Update blockchain RPC router for production - Update coordinator API main configuration - Update blockchain router endpoints - Add production key generation script - Remove gitea token file (security)
66 lines
2.0 KiB
Bash
Executable File
66 lines
2.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "$ROOT_DIR"
|
|
VENV_PYTHON="$ROOT_DIR/.venv/bin/python"
|
|
if [ ! -x "$VENV_PYTHON" ]; then
|
|
echo "[devnet] Virtualenv not found at $VENV_PYTHON. Please create it: python -m venv .venv && .venv/bin/pip install -r requirements.txt"
|
|
exit 1
|
|
fi
|
|
export PYTHONPATH="${ROOT_DIR}/src:${ROOT_DIR}/scripts:${PYTHONPATH:-}"
|
|
|
|
GENESIS_PATH="data/devnet/genesis.json"
|
|
ALLOCATIONS_PATH="data/devnet/allocations.json"
|
|
PROPOSER_ADDRESS="ait15v2cdlz5a3uy3wfurgh6m957kahnhhprdq7fy9m6eay05mvrv4jsyx4sks"
|
|
"$VENV_PYTHON" "scripts/make_genesis.py" \
|
|
--output "$GENESIS_PATH" \
|
|
--force \
|
|
--allocations "$ALLOCATIONS_PATH" \
|
|
--authorities "$PROPOSER_ADDRESS" \
|
|
--chain-id "ait-devnet"
|
|
|
|
echo "[devnet] Generated genesis at ${GENESIS_PATH}"
|
|
|
|
# Set environment for devnet
|
|
export chain_id="ait-devnet"
|
|
export supported_chains="ait-devnet"
|
|
export proposer_id="${PROPOSER_ADDRESS}"
|
|
export mint_per_unit=0
|
|
export coordinator_ratio=0.05
|
|
export db_path="./data/${chain_id}/chain.db"
|
|
export trusted_proposers="${PROPOSER_ADDRESS}"
|
|
export gossip_backend="memory"
|
|
|
|
# Optional: if you have a proposer private key for block signing (future), set PROPOSER_KEY
|
|
# export PROPOSER_KEY="..."
|
|
|
|
echo "[devnet] Environment configured: chain_id=${chain_id}, proposer_id=${proposer_id}"
|
|
|
|
declare -a CHILD_PIDS=()
|
|
cleanup() {
|
|
for pid in "${CHILD_PIDS[@]}"; do
|
|
if kill -0 "$pid" 2>/dev/null; then
|
|
kill "$pid" 2>/dev/null || true
|
|
fi
|
|
done
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
"$VENV_PYTHON" -m aitbc_chain.main &
|
|
CHILD_PIDS+=($!)
|
|
echo "[devnet] Blockchain node started (PID ${CHILD_PIDS[-1]})"
|
|
|
|
sleep 1
|
|
|
|
"$VENV_PYTHON" -m uvicorn aitbc_chain.app:app --host 127.0.0.1 --port 8026 --log-level info &
|
|
CHILD_PIDS+=($!)
|
|
echo "[devnet] RPC API serving at http://127.0.0.1:8026"
|
|
|
|
# Optional: mock coordinator for devnet only
|
|
# "$VENV_PYTHON" -m uvicorn mock_coordinator:app --host 127.0.0.1 --port 8090 --log-level info &
|
|
# CHILD_PIDS+=($!)
|
|
# echo "[devnet] Mock coordinator serving at http://127.0.0.1:8090"
|
|
|
|
wait
|