From c5af4819ff64f65913a781cbaa2b9ae577e6fcae Mon Sep 17 00:00:00 2001 From: oib Date: Thu, 26 Feb 2026 23:42:23 +0100 Subject: [PATCH] fix: change explorer port to 3001 and add systemd service configuration --- apps/blockchain-explorer/main.py | 4 ++-- systemd/aitbc-explorer.service | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 systemd/aitbc-explorer.service diff --git a/apps/blockchain-explorer/main.py b/apps/blockchain-explorer/main.py index 051c0a97..b5032c67 100644 --- a/apps/blockchain-explorer/main.py +++ b/apps/blockchain-explorer/main.py @@ -21,7 +21,7 @@ BLOCKCHAIN_RPC_URL = "http://localhost:8082" # Local blockchain node EXTERNAL_RPC_URL = "http://aitbc.keisanki.net:8082" # External access # HTML Template -HTML_TEMPLATE = """ +HTML_TEMPLATE = r""" @@ -458,4 +458,4 @@ async def health(): if __name__ == "__main__": - uvicorn.run(app, host="0.0.0.0", port=3000) + uvicorn.run(app, host="0.0.0.0", port=3001) diff --git a/systemd/aitbc-explorer.service b/systemd/aitbc-explorer.service new file mode 100644 index 00000000..8eb8f36d --- /dev/null +++ b/systemd/aitbc-explorer.service @@ -0,0 +1,21 @@ +[Unit] +Description=AITBC Blockchain Explorer UI +After=network.target aitbc-blockchain-rpc-1.service aitbc-blockchain-rpc-2.service + +[Service] +Type=simple +User=root +WorkingDirectory=/opt/aitbc/apps/blockchain-explorer +# Assuming we will use the venv from coordinator-api or blockchain-node as standard +Environment=PATH=/opt/aitbc/apps/coordinator-api/.venv/bin:/usr/local/bin:/usr/bin:/bin +# Need to make sure fastapi and uvicorn are available +ExecStart=/opt/aitbc/apps/coordinator-api/.venv/bin/python main.py +Restart=always +RestartSec=5 +# Adjust logging +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=aitbc-explorer + +[Install] +WantedBy=multi-user.target