This repository was archived by the owner on Feb 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +32
-27
lines changed Expand file tree Collapse file tree 3 files changed +32
-27
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,12 @@ set -o errexit
6
6
run_geth () {
7
7
docker run \
8
8
-v /$PWD /scripts:/scripts \
9
+ -t \
9
10
-d \
10
11
-p 8545:8545 \
11
12
-p 8546:8546 \
12
13
-p 30303:30303 \
13
- ethereum/client-go:v1.10.19 \
14
+ ethereum/client-go:stable \
14
15
--http \
15
16
--http.addr ' 0.0.0.0' \
16
17
--http.port 8545 \
@@ -22,7 +23,8 @@ run_geth() {
22
23
--dev \
23
24
--dev.period 0 \
24
25
--allow-insecure-unlock \
25
- js ./scripts/geth-accounts.js \
26
+ --preload ./scripts/geth-accounts.js \
27
+ console \
26
28
> /dev/null &
27
29
}
28
30
Original file line number Diff line number Diff line change @@ -19,16 +19,14 @@ function createAccounts() {
19
19
function unlockAccounts ( ) {
20
20
eth . accounts . forEach ( function ( account ) {
21
21
console . log ( 'Unlocking ' + account + '...' ) ;
22
- personal . unlockAccount ( account , '' , 86400 ) ;
22
+ personal . unlockAccount ( account , '' , 0 ) ;
23
23
} ) ;
24
24
}
25
25
26
26
function setupDevNode ( ) {
27
27
// keep accounts unlocked
28
- while ( true ) {
29
- unlockAccounts ( ) ;
30
- }
28
+ unlockAccounts ( ) ;
31
29
}
32
30
33
31
createAccounts ( ) ;
34
- setupDevNode ( ) ;
32
+ setupDevNode ( ) ;
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- docker pull ethereum/client-go:v1.10.19
3
+ docker pull ethereum/client-go:stable
4
4
5
- docker run \
6
- -v /$PWD /scripts:/scripts \
7
- -i \
8
- -p 8545:8545 \
9
- -p 8546:8546 \
10
- -p 30303:30303 \
11
- ethereum/client-go:v1.10.19 \
12
- --http \
13
- --http.addr ' 0.0.0.0' \
14
- --http.port 8545 \
15
- --http.corsdomain ' *' \
16
- --ws \
17
- --ws.addr ' 0.0.0.0' \
18
- --ws.origins ' *' \
19
- --nodiscover \
20
- --dev \
21
- --dev.period 0 \
22
- --allow-insecure-unlock \
23
- js ./scripts/geth-accounts.js
5
+ CID=$( docker run \
6
+ -v /$PWD /scripts:/scripts \
7
+ -t \
8
+ -d \
9
+ -p 8545:8545 \
10
+ -p 8546:8546 \
11
+ -p 30303:30303 \
12
+ ethereum/client-go:stable \
13
+ --http \
14
+ --http.addr ' 0.0.0.0' \
15
+ --http.port 8545 \
16
+ --http.corsdomain ' *' \
17
+ --ws \
18
+ --ws.addr ' 0.0.0.0' \
19
+ --ws.origins ' *' \
20
+ --nodiscover \
21
+ --dev \
22
+ --dev.period 0 \
23
+ --allow-insecure-unlock \
24
+ --preload ./scripts/geth-accounts.js \
25
+ console)
26
+
27
+ printf " Geth running in docker container ${CID} \n"
28
+ printf " Connect to geth:\n docker exec -it ${CID: 0: 8} geth attach http://localhost:8545 console\n"
You can’t perform that action at this time.
0 commit comments