Files
aitbc/scripts/deployment/provision_node.sh
aitbc cbf2a8a160
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
feat: add aitbc_mempool PostgreSQL database to deployment setup
- 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
2026-05-03 22:07:16 +02:00

39 lines
978 B
Bash
Executable File

#!/bin/bash
# Provision new AITBC node
NODE_NAME=$1
if [ -z "$NODE_NAME" ]; then
echo "Usage: $0 <node-name>"
exit 1
fi
echo "Provisioning node: $NODE_NAME"
# Install dependencies
apt update && apt install -y python3 python3-venv redis-server postgresql postgresql-contrib
# Setup directories
mkdir -p /var/lib/aitbc/{data,keystore}
mkdir -p /etc/aitbc
mkdir -p /var/log/aitbc
# Copy configuration
scp aitbc1:/etc/aitbc/blockchain.env /etc/aitbc/
scp aitbc1:/opt/aitbc/aitbc-cli-final /opt/aitbc/
# Pull code
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
echo "Node $NODE_NAME provisioned successfully"