===================================================================
  CHAIN-138 COMPLETE DEPLOYMENT
===================================================================

[0;36mStep 1: Configuring .env for Chain-138[0m

[0;32m✅ CHAIN138_RPC_URL already configured[0m

[0;36mStep 2: Checking genesis file[0m

[1;33m⚠️  genesis.json not found, generating...[0m
[0;32mGenerating genesis for ChainID 138 - DeFi Oracle Meta Mainnet[0m
[1;33mGenerating 4 validator keys...[0m

ERROR: JAVA_HOME is set to an invalid directory: /usr/

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.


ERROR: JAVA_HOME is set to an invalid directory: /usr/

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.


ERROR: JAVA_HOME is set to an invalid directory: /usr/

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.


ERROR: JAVA_HOME is set to an invalid directory: /usr/

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

[1;33mGenerating oracle key...[0m
[0;32mGenerated oracle key[0m
[1;33mGenerating IBFT extraData...[0m
[1;33mCreating genesis.json...[0m
[0;32mGenesis file created at: /home/intlc/projects/smom-dbis-138/config/genesis.json[0m
[1;33mNote: extraData must be generated using Besu's operator generate-blockchain-config[0m
[1;33mwith the actual validator addresses for production deployment.[0m
[0;32mSetup complete![0m
[1;33mNext steps:[0m
1. Review and update genesis.json with actual validator addresses
2. Generate proper IBFT extraData using: besu operator generate-blockchain-config
3. Store validator keys securely (Azure Key Vault for production)
4. Deploy infrastructure using Terraform
[0;31m❌ Failed to generate genesis.json[0m

[0;36mStep 3: Checking infrastructure deployment[0m

[1;33m⚠️  Kubernetes cluster not accessible[0m
  Infrastructure deployment may be required

[0;36mStep 4: Testing RPC connectivity[0m

  Testing https://rpc.d-bis.org: [0;31m❌ Not accessible[0m

[0;36mStep 5: Deploying CCIPTxReporter[0m

[1;33m⚠️  CCIPTxReporter not deployed[0m
  To deploy, run:
    npm run deploy:reporter:chain138
  Or:
    npx hardhat run scripts/ccip-deployment/deploy-ccip-reporter.js --network chain138

[0;36mStep 6: Verifying predeployed contracts[0m

  Checking WETH9: [1;33m⚠️  Not found (may need genesis predeployment)[0m
  Checking WETH10: [1;33m⚠️  Not found (may need genesis predeployment)[0m

[0;36mStep 7: Running verification[0m

===================================================================
  CHAIN-138 COMPLETE VERIFICATION
===================================================================

[0;36mRunning full deployment verification...[0m

===================================================================
  CHAIN-138 FULL DEPLOYMENT VERIFICATION
===================================================================

[0;34m1. Infrastructure Verification[0m

  Checking RPC endpoint:   [0;31m❌ RPC Endpoint[0m
    https://rpc.d-bis.org (not accessible)
  Checking Chain ID:   [1;33m⚠️  Chain ID[0m
    Chain ID: 0 (expected 138)
  Checking Latest Block:   [0;31m❌ Latest Block[0m
    Cannot retrieve block number

[0;34m2. Predeployed Contracts Verification[0m

  Checking WETH9:   [0;31m❌ WETH9[0m
    0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 (no code found)
  Checking WETH10:   [0;31m❌ WETH10[0m
    0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f (no code found)

[0;34m3. CCIP Integration Contracts[0m

  [0;31m❌ CCIPTxReporter[0m
    Not deployed (no address in .env)
  [1;33m⚠️  CCIP Router[0m
    Not configured in .env (may use official Chainlink router)

[0;34m4. Bridge Contracts on Chain-138[0m

  [1;33m⚠️  CCIPWETH9Bridge[0m
    Not configured (may not be needed on Chain-138)
  [1;33m⚠️  CCIPWETH10Bridge[0m
    Not configured (may not be needed on Chain-138)

[0;34m5. Kubernetes Services (if applicable)[0m

  Checking Kubernetes access:   [1;33m⚠️  Kubernetes[0m
    Cannot access cluster

[0;34m6. Configuration Files[0m

  [0;31m❌ Genesis File[0m
    genesis.json not found
  [0;32m✅ .env File[0m
    Exists
  [0;32m✅ CHAIN138_RPC_URL[0m
    Configured
  [0;32m✅ CHAIN138_SELECTOR[0m
    Configured

[0;34m7. Network Connectivity[0m

  Testing RPC connectivity:   [0;32m✅ RPC Connectivity[0m
    Response time: 0.593994s

===================================================================
[0;34mSUMMARY[0m
===================================================================

  ✅ Successful: 4
  ⚠️  Warnings: 5
  ❌ Errors: 6

[0;31m❌ Chain-138 deployment has errors that need to be addressed[0m
