fix: use psycopg2 instead of psycopg for PostgreSQL connection
All checks were successful
Cross-Node Transaction Testing / transaction-test (push) Successful in 5s
Deploy to Testnet / deploy-testnet (push) Successful in 1m39s
Multi-Node Stress Testing / stress-test (push) Successful in 2s

- Fix connection string to use postgresql+psycopg2://
- Add libpq-dev for PostgreSQL development headers
- Update deployment script with correct PostgreSQL driver
This commit is contained in:
aitbc
2026-05-20 10:11:10 +02:00
parent 763c5d5794
commit 218424f460

View File

@@ -136,12 +136,12 @@ setup_directories() {
setup_postgresql() {
log_info "Setting up PostgreSQL for mempool..."
# Install PostgreSQL
# Install PostgreSQL and development headers
if command -v apt-get &> /dev/null; then
apt-get update
apt-get install -y postgresql postgresql-contrib python3-psycopg2
apt-get install -y postgresql postgresql-contrib libpq-dev
elif command -v yum &> /dev/null; then
yum install -y postgresql-server postgresql-contrib python3-psycopg2
yum install -y postgresql-server postgresql-contrib postgresql-devel
else
log_error "Unsupported package manager"
exit 1
@@ -189,7 +189,7 @@ ENABLE_BLOCK_PRODUCTION=false
GOSSIP_BROADCAST_URL=redis://127.0.0.1:6379
CROSS_SITE_REMOTE_ENDPOINTS=
MEMPOOL_BACKEND=database
MEMPOOL_DB_URL=postgresql+psycopg://aitbc_mempool:aitbc_mempool_password@localhost:5432/aitbc_mempool
MEMPOOL_DB_URL=postgresql+psycopg2://aitbc_mempool:aitbc_mempool_password@localhost:5432/aitbc_mempool
EOF
chmod 600 "$ENV_FILE"
log_info "Created $ENV_FILE with chain ID: $CHAIN_ID"