dapphub / dapphub/dapptools

`dapp testnet` does not exit `geth` gracefully

Open
#57 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
2.1k
Forks
320
PR merge metrics
No merged PRs in 30d

Description

@mbrock something I noticed using `dapp testnet --save x --load x`... you have a
```
( set -x; kill -INT $gethpid; wait )
```
inside `trap` to cleanly send a kill signal to geth so that it exits correctly. But it's not really working. When stopping `dapp testnet --save x --load x` geth often does not write blocks and when you load you end up with an older blockchain. I've done some tests and noticed that:
```
geth \
2> >(tee "$chaindir/geth.log" | grep --line-buffered Success | sed 's/^/geth: /' >&2) \
--datadir "$chaindir" --networkid "$CHAINID" --port="$port" \
--mine --minerthreads=1 \
--rpc --rpcapi "web3,eth,net,debug" --rpccorsdomain '*' --nodiscover \
--rpcport="$RPC_PORT" --unlock="$(IFS=,; echo "${address[*]}")" --password=<(exit) &
```
If I remove this line ` 2> >(tee "$chaindir/geth.log" | grep --line-buffered Success | sed 's/^/geth: /' >&2) \` then when I Ctrl + C, or `kill -INT $(pidof geth)` it exits gracefully and fully writes the blocks to disk.

I have no idea why redirecting the output from `geth` makes it not exit gracefully. Maybe it's something else I'm missing.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.