Fix workflow scripts: create blockchain.env directly instead of copying from non-existent /opt/aitbc/.env
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled

- Update 01_preflight_setup.sh to create blockchain.env with defaults
- Update hermes preflight setup scripts to create blockchain.env with defaults
- Remove dependency on /opt/aitbc/.env which doesn't exist
This commit is contained in:
aitbc
2026-05-26 15:54:17 +02:00
parent 27312dcf2a
commit fd75eb32bc
3 changed files with 72 additions and 7 deletions

View File

@@ -80,8 +80,30 @@ hermes execute --agent GenesisAgent --task update_systemd_config || {
echo "5. Setting up central configuration via hermes agents..."
hermes execute --agent CoordinatorAgent --task setup_central_config || {
echo "⚠️ hermes config setup failed - using manual method"
cp /opt/aitbc/.env /etc/aitbc/blockchain.env.backup 2>/dev/null || true
mv /opt/aitbc/.env /etc/aitbc/blockchain.env 2>/dev/null || true
# Create blockchain.env if it doesn't exist
if [ ! -f "/etc/aitbc/blockchain.env" ]; then
echo "Creating /etc/aitbc/blockchain.env with default configuration..."
cat > /etc/aitbc/blockchain.env << 'EOF'
# AITBC Blockchain Configuration
# This file contains shared environment variables for all AITBC services
NODE_ENV=production
DEBUG=false
LOG_LEVEL=INFO
CHAIN_ID=ait-mainnet
BLOCK_TIME=5
NETWORK_ID=1337
CONSENSUS=proof_of_authority
rpc_bind_host=0.0.0.0
rpc_bind_port=8006
auto_sync_enabled=true
island_id=ait-mainnet-island
supported_chains=ait-mainnet,ait-testnet
default_peer_rpc_url=http://aitbc1:8006
EOF
echo "Created /etc/aitbc/blockchain.env"
else
echo "/etc/aitbc/blockchain.env already exists"
fi
}
# 6. Setup AITBC CLI tool (via hermes)

View File

@@ -48,8 +48,30 @@ systemctl daemon-reload
# 5. Setup central configuration file
echo "5. Setting up central configuration file..."
cp /opt/aitbc/.env /etc/aitbc/blockchain.env.backup 2>/dev/null || true
mv /opt/aitbc/.env /etc/aitbc/blockchain.env 2>/dev/null || true
# Create blockchain.env if it doesn't exist
if [ ! -f "/etc/aitbc/blockchain.env" ]; then
echo "Creating /etc/aitbc/blockchain.env with default configuration..."
cat > /etc/aitbc/blockchain.env << 'EOF'
# AITBC Blockchain Configuration
# This file contains shared environment variables for all AITBC services
NODE_ENV=production
DEBUG=false
LOG_LEVEL=INFO
CHAIN_ID=ait-mainnet
BLOCK_TIME=5
NETWORK_ID=1337
CONSENSUS=proof_of_authority
rpc_bind_host=0.0.0.0
rpc_bind_port=8006
auto_sync_enabled=true
island_id=ait-mainnet-island
supported_chains=ait-mainnet,ait-testnet
default_peer_rpc_url=http://aitbc1:8006
EOF
echo "Created /etc/aitbc/blockchain.env"
else
echo "/etc/aitbc/blockchain.env already exists"
fi
# 6. Setup AITBC CLI tool
echo "6. Setting up AITBC CLI tool..."

View File

@@ -22,9 +22,30 @@ systemctl daemon-reload
# 3. Create central configuration file
echo "3. Setting up central configuration file..."
cp /opt/aitbc/.env /etc/aitbc/blockchain.env.backup 2>/dev/null || true
# Ensure blockchain.env is in the correct location
mv /opt/aitbc/.env /etc/aitbc/blockchain.env 2>/dev/null || true
# Create blockchain.env if it doesn't exist
if [ ! -f "/etc/aitbc/blockchain.env" ]; then
echo "Creating /etc/aitbc/blockchain.env with default configuration..."
cat > /etc/aitbc/blockchain.env << 'EOF'
# AITBC Blockchain Configuration
# This file contains shared environment variables for all AITBC services
NODE_ENV=production
DEBUG=false
LOG_LEVEL=INFO
CHAIN_ID=ait-mainnet
BLOCK_TIME=5
NETWORK_ID=1337
CONSENSUS=proof_of_authority
rpc_bind_host=0.0.0.0
rpc_bind_port=8006
auto_sync_enabled=true
island_id=ait-mainnet-island
supported_chains=ait-mainnet,ait-testnet
default_peer_rpc_url=http://aitbc1:8006
EOF
echo "Created /etc/aitbc/blockchain.env"
else
echo "/etc/aitbc/blockchain.env already exists"
fi
# 4. Setup AITBC CLI tool
echo "4. Setting up AITBC CLI tool..."