diff --git a/scripts/ci.sh b/scripts/ci.sh index 42ec1f816b8..a8b906fd7bb 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -6,11 +6,12 @@ set -o errexit run_geth() { docker run \ -v /$PWD/scripts:/scripts \ + -t \ -d \ -p 8545:8545 \ -p 8546:8546 \ -p 30303:30303 \ - ethereum/client-go:v1.10.19 \ + ethereum/client-go:stable \ --http \ --http.addr '0.0.0.0' \ --http.port 8545 \ @@ -22,7 +23,8 @@ run_geth() { --dev \ --dev.period 0 \ --allow-insecure-unlock \ - js ./scripts/geth-accounts.js \ + --preload ./scripts/geth-accounts.js \ + console \ >/dev/null & } diff --git a/scripts/geth-accounts.js b/scripts/geth-accounts.js index 2ddc2ac23ad..570895dc95e 100644 --- a/scripts/geth-accounts.js +++ b/scripts/geth-accounts.js @@ -19,16 +19,14 @@ function createAccounts() { function unlockAccounts() { eth.accounts.forEach(function (account) { console.log('Unlocking ' + account + '...'); - personal.unlockAccount(account, '', 86400); + personal.unlockAccount(account, '', 0); }); } function setupDevNode() { // keep accounts unlocked - while (true) { - unlockAccounts(); - } + unlockAccounts(); } createAccounts(); -setupDevNode(); \ No newline at end of file +setupDevNode(); diff --git a/scripts/geth.sh b/scripts/geth.sh index ca32f5f10df..f3fc24ec947 100755 --- a/scripts/geth.sh +++ b/scripts/geth.sh @@ -1,23 +1,28 @@ #!/usr/bin/env bash -docker pull ethereum/client-go:v1.10.19 +docker pull ethereum/client-go:stable -docker run \ - -v /$PWD/scripts:/scripts \ - -i \ - -p 8545:8545 \ - -p 8546:8546 \ - -p 30303:30303 \ - ethereum/client-go:v1.10.19 \ - --http \ - --http.addr '0.0.0.0' \ - --http.port 8545 \ - --http.corsdomain '*' \ - --ws \ - --ws.addr '0.0.0.0' \ - --ws.origins '*' \ - --nodiscover \ - --dev \ - --dev.period 0 \ - --allow-insecure-unlock \ - js ./scripts/geth-accounts.js +CID=$(docker run \ + -v /$PWD/scripts:/scripts \ + -t \ + -d \ + -p 8545:8545 \ + -p 8546:8546 \ + -p 30303:30303 \ + ethereum/client-go:stable \ + --http \ + --http.addr '0.0.0.0' \ + --http.port 8545 \ + --http.corsdomain '*' \ + --ws \ + --ws.addr '0.0.0.0' \ + --ws.origins '*' \ + --nodiscover \ + --dev \ + --dev.period 0 \ + --allow-insecure-unlock \ + --preload ./scripts/geth-accounts.js \ + console) + +printf "Geth running in docker container ${CID}\n" +printf "Connect to geth:\n docker exec -it ${CID:0:8} geth attach http://localhost:8545 console\n"