Files
aitbc/dev/scripts/patch_cli_api_endpoints_v1.py
oib ccedbace53 chore: remove configuration files and enhance blockchain explorer with advanced search, analytics, and export features
- Delete .aitbc.yaml.example CLI configuration template
- Delete .lycheeignore link checker exclusion rules
- Delete .nvmrc Node.js version specification
- Add advanced search panel with filters for address, amount range, transaction type, time range, and validator
- Add analytics dashboard with transaction volume, active addresses, and block time metrics
- Add Chart.js integration
2026-03-02 15:38:25 +01:00

21 lines
901 B
Python

import re
import os
from glob import glob
# The issue is that config.coordinator_url in the CLI already contains "/v1" if run with `--url http://127.0.0.1:8000/v1`
# Thus f"{config.coordinator_url}/v1/jobs" results in "http://127.0.0.1:8000/v1/v1/jobs" which is a 404!
# Let's fix ALL files in cli/aitbc_cli/commands/ to remove the extra /v1 when hitting the coordinator.
cli_commands_dir = "/home/oib/windsurf/aitbc/cli/aitbc_cli/commands"
for filepath in glob(os.path.join(cli_commands_dir, "*.py")):
with open(filepath, "r") as f:
content = f.read()
# We want to replace {config.coordinator_url}/v1/ with {config.coordinator_url}/
new_content = content.replace('{config.coordinator_url}/v1/', '{config.coordinator_url}/')
if new_content != content:
with open(filepath, "w") as f:
f.write(new_content)
print(f"Patched {filepath}")