docs: refactor workflow with script references and add mempool RPC endpoint
All checks were successful
Documentation Validation / validate-docs (push) Successful in 8s
Integration Tests / test-service-integration (push) Successful in 46s
Python Tests / test-python (push) Successful in 1m26s
Systemd Sync / sync-systemd (push) Successful in 3s
Security Scanning / security-scan (push) Successful in 1m36s
All checks were successful
Documentation Validation / validate-docs (push) Successful in 8s
Integration Tests / test-service-integration (push) Successful in 46s
Python Tests / test-python (push) Successful in 1m26s
Systemd Sync / sync-systemd (push) Successful in 3s
Security Scanning / security-scan (push) Successful in 1m36s
📋 Workflow Documentation:
• Replace inline service optimization with 15_service_optimization.sh reference
• Replace inline monitoring setup with 16_monitoring_setup.sh reference
• Replace inline security hardening with 17_security_hardening.sh reference
• Add production readiness validation with 18_production_readiness.sh
• Consolidate scaling and load balancing script references
• Remove duplicate integration
This commit is contained in:
57
scripts/workflow/15_service_optimization.sh
Executable file
57
scripts/workflow/15_service_optimization.sh
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
# Service Optimization Script for AITBC Production
|
||||
# This script optimizes systemd services for production environment
|
||||
|
||||
set -e # Exit on any error
|
||||
|
||||
echo "=== AITBC Service Optimization ==="
|
||||
|
||||
# Create service overrides for production (stored in git repo)
|
||||
echo "1. Creating production service overrides..."
|
||||
mkdir -p /opt/aitbc/systemd/aitbc-blockchain-node.service.d
|
||||
|
||||
cat > /opt/aitbc/systemd/aitbc-blockchain-node.service.d/production.conf << EOF
|
||||
[Service]
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
LimitNOFILE=65536
|
||||
Environment="PYTHONPATH=/opt/aitbc/apps/blockchain-node/src"
|
||||
Environment="AITBC_ENV=production"
|
||||
EOF
|
||||
|
||||
# Create symlink from systemd to git repo (ensures git always has current files)
|
||||
echo "2. Creating symlink from systemd to git repo..."
|
||||
ln -sf /opt/aitbc/systemd/aitbc-blockchain-node.service.d/production.conf /etc/systemd/system/aitbc-blockchain-node.service.d/production.conf
|
||||
|
||||
# Create RPC service optimization
|
||||
echo "3. Creating RPC service optimization..."
|
||||
mkdir -p /opt/aitbc/systemd/aitbc-blockchain-rpc.service.d
|
||||
|
||||
cat > /opt/aitbc/systemd/aitbc-blockchain-rpc.service.d/production.conf << EOF
|
||||
[Service]
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
LimitNOFILE=65536
|
||||
Environment="PYTHONPATH=/opt/aitbc/apps/blockchain-node/src"
|
||||
Environment="AITBC_ENV=production"
|
||||
Environment="UVICORN_WORKERS=4"
|
||||
Environment="UVICORN_BACKLOG=2048"
|
||||
EOF
|
||||
|
||||
ln -sf /opt/aitbc/systemd/aitbc-blockchain-rpc.service.d/production.conf /etc/systemd/system/aitbc-blockchain-rpc.service.d/production.conf
|
||||
|
||||
# Reload and restart services
|
||||
echo "4. Reloading and restarting services..."
|
||||
systemctl daemon-reload
|
||||
systemctl restart aitbc-blockchain-node aitbc-blockchain-rpc
|
||||
|
||||
# Verify services are running
|
||||
echo "5. Verifying service status..."
|
||||
sleep 3
|
||||
echo " Blockchain node: $(systemctl is-active aitbc-blockchain-node)"
|
||||
echo " RPC service: $(systemctl is-active aitbc-blockchain-rpc)"
|
||||
|
||||
echo "✅ Service optimization completed successfully!"
|
||||
echo " • Production overrides created in git repo"
|
||||
echo " • Symlinks established for version control"
|
||||
echo " • Services restarted and verified"
|
||||
Reference in New Issue
Block a user