feat: add aitbc_mempool PostgreSQL database to deployment setup
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Documentation Validation / validate-docs (push) Has been cancelled
Documentation Validation / validate-policies-strict (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Documentation Validation / validate-docs (push) Has been cancelled
Documentation Validation / validate-policies-strict (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
- Add aitbc_mempool database creation to setup_postgresql_databases.sh - Update setup.sh to include aitbc_mempool in database list - Add PostgreSQL and psycopg installation to provision_node.sh - Add PostgreSQL setup step to genesis authority setup workflow - Add PostgreSQL setup step to follower node setup workflow - Update deployment documentation with PostgreSQL database setup section
This commit is contained in:
@@ -40,12 +40,19 @@ sudo ./setup.sh
|
||||
- `/etc/aitbc/` - Configuration files
|
||||
- Sets proper permissions and ownership
|
||||
|
||||
5. **Systemd Services**
|
||||
5. **PostgreSQL Databases**
|
||||
- Installs PostgreSQL if not present
|
||||
- Creates databases: aitbc_coordinator, aitbc_exchange, aitbc_wallet, aitbc_marketplace, aitbc_governance, aitbc_trading, aitbc_gpu, aitbc_ai, aitbc_mempool
|
||||
- Creates dedicated users for each database
|
||||
- Grants necessary privileges
|
||||
- Uses centralized script: `/opt/aitbc/infra/scripts/setup_postgresql_databases.sh`
|
||||
|
||||
6. **Systemd Services**
|
||||
- Installs service files to `/etc/systemd/system/`
|
||||
- Enables auto-start on boot
|
||||
- Provides fallback manual startup
|
||||
|
||||
6. **Service Management**
|
||||
7. **Service Management**
|
||||
- Creates `/opt/aitbc/start-services.sh` for manual control
|
||||
- Creates `/opt/aitbc/health-check.sh` for monitoring
|
||||
- Sets up logging to `/var/log/aitbc-*.log`
|
||||
|
||||
@@ -86,6 +86,7 @@ setup_database "aitbc_governance" "aitbc_governance"
|
||||
setup_database "aitbc_trading" "aitbc_trading"
|
||||
setup_database "aitbc_gpu" "aitbc_gpu"
|
||||
setup_database "aitbc_ai" "aitbc_ai"
|
||||
setup_database "aitbc_mempool" "aitbc_mempool"
|
||||
|
||||
echo ""
|
||||
echo -e "${BLUE}=== Database Summary ===${NC}"
|
||||
@@ -103,6 +104,7 @@ echo " - aitbc_governance (user: aitbc_governance)"
|
||||
echo " - aitbc_trading (user: aitbc_trading)"
|
||||
echo " - aitbc_gpu (user: aitbc_gpu)"
|
||||
echo " - aitbc_ai (user: aitbc_ai)"
|
||||
echo " - aitbc_mempool (user: aitbc_mempool)"
|
||||
echo ""
|
||||
echo "To configure PostgreSQL for remote connections, run:"
|
||||
echo " $0 --remote-configure [network-cidr]"
|
||||
|
||||
@@ -10,7 +10,7 @@ fi
|
||||
echo "Provisioning node: $NODE_NAME"
|
||||
|
||||
# Install dependencies
|
||||
apt update && apt install -y python3 python3-venv redis-server
|
||||
apt update && apt install -y python3 python3-venv redis-server postgresql postgresql-contrib
|
||||
|
||||
# Setup directories
|
||||
mkdir -p /var/lib/aitbc/{data,keystore}
|
||||
@@ -25,6 +25,12 @@ scp aitbc1:/opt/aitbc/aitbc-cli-final /opt/aitbc/
|
||||
cd /opt/aitbc
|
||||
git pull origin main
|
||||
|
||||
# Install psycopg for PostgreSQL
|
||||
/opt/aitbc/venv/bin/pip install psycopg
|
||||
|
||||
# Setup PostgreSQL databases
|
||||
/opt/aitbc/infra/scripts/setup_postgresql_databases.sh
|
||||
|
||||
# Setup as follower
|
||||
sed -i 's|enable_block_production=true|enable_block_production=false|g' /etc/aitbc/blockchain.env
|
||||
sed -i 's|proposer_id=.*|proposer_id=follower-node-'$NODE_NAME'|g' /etc/aitbc/blockchain.env
|
||||
|
||||
@@ -183,6 +183,7 @@ setup_postgresql_databases() {
|
||||
"aitbc_trading:aitbc_trading"
|
||||
"aitbc_gpu:aitbc_gpu"
|
||||
"aitbc_ai:aitbc_ai"
|
||||
"aitbc_mempool:aitbc_mempool"
|
||||
)
|
||||
|
||||
for db_user in "${databases[@]}"; do
|
||||
|
||||
@@ -16,7 +16,11 @@ git pull origin main
|
||||
|
||||
# Install/update dependencies
|
||||
echo "2. Installing/updating dependencies..."
|
||||
/opt/aitbc/venv/bin/pip install -r requirements.txt
|
||||
/opt/aitbc/venv/bin/pip install -r requirements.txt psycopg
|
||||
|
||||
# Setup PostgreSQL databases
|
||||
echo "2.5. Setting up PostgreSQL databases..."
|
||||
/opt/aitbc/infra/scripts/setup_postgresql_databases.sh
|
||||
|
||||
# Check and create required directories if they don't exist
|
||||
echo "3. Creating required directories..."
|
||||
|
||||
@@ -13,7 +13,11 @@ git pull origin main
|
||||
|
||||
# Install/update dependencies
|
||||
echo "2. Installing/updating dependencies..."
|
||||
/opt/aitbc/venv/bin/pip install -r requirements.txt
|
||||
/opt/aitbc/venv/bin/pip install -r requirements.txt psycopg
|
||||
|
||||
# Setup PostgreSQL databases
|
||||
echo "2.5. Setting up PostgreSQL databases..."
|
||||
/opt/aitbc/infra/scripts/setup_postgresql_databases.sh
|
||||
|
||||
# Check and create required directories if they don't exist
|
||||
echo "3. Creating required directories..."
|
||||
|
||||
Reference in New Issue
Block a user