Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 &
}

Expand Down
8 changes: 3 additions & 5 deletions scripts/geth-accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
setupDevNode();
45 changes: 25 additions & 20 deletions scripts/geth.sh
Original file line number Diff line number Diff line change
@@ -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"