Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m13s
CI/CD Pipeline / Security Scanning (push) Successful in 2m30s
CI/CD Pipeline / Lint and Format (push) Failing after 45s
CI/CD Pipeline / Terraform Validation (push) Failing after 26s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 28s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 39s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 21s
Validation / validate-genesis (push) Successful in 30s
Validation / validate-terraform (push) Failing after 25s
Validation / validate-kubernetes (push) Failing after 13s
Validation / validate-smart-contracts (push) Failing after 16s
Validation / validate-security (push) Failing after 1m28s
Validation / validate-documentation (push) Failing after 19s
Verify Deployment / Verify Deployment (push) Failing after 53s
Ship Z Chain slot, International Z Wallet routes, in-app Z Bot APIs, Besu bootstrap, and local/production deployment tooling for digital.omdnl.org. Co-authored-by: Cursor <cursoragent@cursor.com>
67 lines
2.5 KiB
PowerShell
67 lines
2.5 KiB
PowerShell
# Bootstrap local Z Chain (chainId 900002) with Hyperledger Besu via Docker.
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
$Root = (Resolve-Path (Join-Path $PSScriptRoot "..\..")).Path
|
|
$NetworkDir = if ($env:Z_CHAIN_NETWORK_DIR) { $env:Z_CHAIN_NETWORK_DIR } else { Join-Path $Root "logs\z-chain-network" }
|
|
$GenesisConfig = Join-Path $Root "config\z-chain-network-config.json"
|
|
$RpcPort = if ($env:Z_CHAIN_RPC_PORT) { $env:Z_CHAIN_RPC_PORT } else { "8546" }
|
|
$ContainerName = if ($env:Z_CHAIN_BESU_CONTAINER) { $env:Z_CHAIN_BESU_CONTAINER } else { "z-chain-besu" }
|
|
|
|
try {
|
|
docker info 2>&1 | Out-Null
|
|
if ($LASTEXITCODE -ne 0) { throw "Docker daemon not running" }
|
|
} catch {
|
|
Write-Error "Docker is installed but not running. Start Docker Desktop or run: scripts\deployment\complete-z-chain.ps1 (Hardhat fallback)"
|
|
}
|
|
|
|
if (-not (Test-Path $GenesisConfig)) {
|
|
Write-Error "Missing $GenesisConfig"
|
|
}
|
|
|
|
New-Item -ItemType Directory -Force -Path $NetworkDir | Out-Null
|
|
|
|
$GenesisOut = Join-Path $NetworkDir "genesis.json"
|
|
if (-not (Test-Path $GenesisOut)) {
|
|
Write-Host "Generating IBFT2 network files in $NetworkDir ..."
|
|
docker run --rm `
|
|
-v "${Root}\config:/config:ro" `
|
|
-v "${NetworkDir}:/network" `
|
|
hyperledger/besu:latest `
|
|
operator generate-blockchain-config `
|
|
--config-file=/config/z-chain-network-config.json `
|
|
--to=/network
|
|
}
|
|
|
|
$existing = docker ps -a --format "{{.Names}}" 2>$null | Where-Object { $_ -eq $ContainerName }
|
|
if ($existing) {
|
|
Write-Host "Removing existing container $ContainerName ..."
|
|
docker rm -f $ContainerName | Out-Null
|
|
}
|
|
|
|
$NodeKey = Join-Path $NetworkDir "keys\node1\key"
|
|
if (-not (Test-Path $NodeKey) -or -not (Test-Path $GenesisOut)) {
|
|
Write-Error "Generated network files missing under $NetworkDir"
|
|
}
|
|
|
|
Write-Host "Starting Z Chain Besu on http://127.0.0.1:$RpcPort (chainId 900002) ..."
|
|
docker run -d `
|
|
--name $ContainerName `
|
|
-p "${RpcPort}:8545" `
|
|
-v "${NetworkDir}:/network:ro" `
|
|
hyperledger/besu:latest `
|
|
--data-path=/tmp/besu `
|
|
--genesis-file=/network/genesis.json `
|
|
--node-private-key-file=/network/keys/node1/key `
|
|
--rpc-http-enabled `
|
|
--rpc-http-api=ETH,NET,WEB3,IBFT,ADMIN,DEBUG `
|
|
--rpc-http-host=0.0.0.0 `
|
|
--rpc-http-port=8545 `
|
|
--rpc-http-cors-origins="*" `
|
|
--host-allowlist="*" `
|
|
--min-gas-price=0 | Out-Null
|
|
|
|
Write-Host ""
|
|
Write-Host "Z Chain local RPC: http://127.0.0.1:$RpcPort"
|
|
Write-Host 'Set env: CHAIN_900002_RPC_URL=http://127.0.0.1:' + $RpcPort
|
|
Write-Host 'Set env: VITE_RPC_URL_900002=http://127.0.0.1:' + $RpcPort
|