Fix workflow scripts: create blockchain.env directly instead of copying from non-existent /opt/aitbc/.env
- 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:
@@ -80,8 +80,30 @@ hermes execute --agent GenesisAgent --task update_systemd_config || {
|
|||||||
echo "5. Setting up central configuration via hermes agents..."
|
echo "5. Setting up central configuration via hermes agents..."
|
||||||
hermes execute --agent CoordinatorAgent --task setup_central_config || {
|
hermes execute --agent CoordinatorAgent --task setup_central_config || {
|
||||||
echo "⚠️ hermes config setup failed - using manual method"
|
echo "⚠️ hermes config setup failed - using manual method"
|
||||||
cp /opt/aitbc/.env /etc/aitbc/blockchain.env.backup 2>/dev/null || true
|
# Create blockchain.env if it doesn't exist
|
||||||
mv /opt/aitbc/.env /etc/aitbc/blockchain.env 2>/dev/null || true
|
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)
|
# 6. Setup AITBC CLI tool (via hermes)
|
||||||
|
|||||||
@@ -48,8 +48,30 @@ systemctl daemon-reload
|
|||||||
|
|
||||||
# 5. Setup central configuration file
|
# 5. Setup central configuration file
|
||||||
echo "5. Setting up central configuration file..."
|
echo "5. Setting up central configuration file..."
|
||||||
cp /opt/aitbc/.env /etc/aitbc/blockchain.env.backup 2>/dev/null || true
|
# Create blockchain.env if it doesn't exist
|
||||||
mv /opt/aitbc/.env /etc/aitbc/blockchain.env 2>/dev/null || true
|
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
|
# 6. Setup AITBC CLI tool
|
||||||
echo "6. Setting up AITBC CLI tool..."
|
echo "6. Setting up AITBC CLI tool..."
|
||||||
|
|||||||
@@ -22,9 +22,30 @@ systemctl daemon-reload
|
|||||||
|
|
||||||
# 3. Create central configuration file
|
# 3. Create central configuration file
|
||||||
echo "3. Setting up central configuration file..."
|
echo "3. Setting up central configuration file..."
|
||||||
cp /opt/aitbc/.env /etc/aitbc/blockchain.env.backup 2>/dev/null || true
|
# Create blockchain.env if it doesn't exist
|
||||||
# Ensure blockchain.env is in the correct location
|
if [ ! -f "/etc/aitbc/blockchain.env" ]; then
|
||||||
mv /opt/aitbc/.env /etc/aitbc/blockchain.env 2>/dev/null || true
|
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
|
# 4. Setup AITBC CLI tool
|
||||||
echo "4. Setting up AITBC CLI tool..."
|
echo "4. Setting up AITBC CLI tool..."
|
||||||
|
|||||||
Reference in New Issue
Block a user