-
Notifications
You must be signed in to change notification settings - Fork 3
/
gethnet
executable file
·40 lines (36 loc) · 1.06 KB
/
gethnet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
set -e
cd "$(dirname "$0")"
ACCOUNT=0x9ca9d2d5e04012c9ed24c0e513c9bfaa4a2dd77f
RPCAPI="eth,net,web3,admin,personal,debug"
GETHNETDIR=./datadir
# Enable different gethnet subcommands such as clean or console.
# No subcommand runs the main mining geth.
case "$1" in
attach)
geth attach ws://localhost:18546
;;
clean)
rm -rf $GETHNETDIR
;;
console)
geth console --dev --mine --networkid 17 --wsorigins "*" --rpc --ws \
--rpcapi "$RPCAPI" --rpccorsdomain "null" \
--allow-insecure-unlock \
--rpcaddr 127.0.0.1 --rpcport 18545 --wsport 18546 --datadir $GETHNETDIR \
--unlock "$ACCOUNT" \
--ipcdisable \
--password ../clroot/password.txt
;;
*)
geth --dev --mine --networkid 17 --wsorigins "*" --rpc --ws \
--rpcapi "$RPCAPI" --rpccorsdomain "null" \
--rpcaddr 127.0.0.1 --dev.period 2 --rpcport 18545 --wsport 18546 \
--allow-insecure-unlock \
--datadir $GETHNETDIR \
--unlock "$ACCOUNT" \
--ipcdisable \
--password ./password.txt \
--verbosity 1
;;
esac