-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display final configuration on Web3 calls, add firefly_shutdown messa…
…ge (#446) * evm: formatting * web3: formatting * web3: remove redundant #Or undef * web3: add #kevm_shutdown message * kevm: allow input file from stdin * kevm: simpler inferface to web3 server, port is mandatory * kevm: wrapper web3-send for interacting with running web3 server * Makefile: formatting * Makefile, tests/web3/runtest: separate out web3 test runner * web3: only allow shutting down in SHUTDOWNABLE is set to true * tests/web3/runtest.sh: make sure client is really dead no matter what * Makefile, tests/web3/no-shutdown: test both with/without --shutdownable * evm: formatting * deps/plugin: update submodule * Makefile, tests/web3/runtest: saner output for test-web3 * Jenkinsfile: test-web3 in sequence for saner output * Makefile: increase timeout for test-web3 to 10s * tests/web3/runtest: kill kevm-client specifically * tests/web3/runtest.sh: explicitly wait for kevm client to shut down * tests/web3/runtest.sh: make sure timeout doesnt force test to fail * tests/web3/runtest: make sure parent process is killed too * Makefile: no need for sleep 10
- Loading branch information
Showing
9 changed files
with
121 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"method": "net_version", | ||
"params": [] | ||
} | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"method": "firefly_shutdown", | ||
"params": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"jsonrpc":"2.0","id":1,"result":"28346"}{"jsonrpc":"2.0","id":1,"error":{"code":-32800,"message":"Firefly client not started with `--shutdownable`!"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
input_file="$1" ; shift | ||
output_file="$1" ; shift | ||
|
||
# Start Firefly | ||
PORT=$(tests/web3/get_port.py) | ||
./kevm web3 "$PORT" "$@" & | ||
kevm_client_pid="$!" | ||
while ! netcat -z 127.0.0.1 "$PORT"; do sleep 0.1; done | ||
|
||
# Feed input in, store output in tmp file | ||
tmp_output_file="$(mktemp)" | ||
trap "rm -rf $tmp_output_file" INT TERM EXIT | ||
cat "$input_file" | netcat 127.0.0.1 "$PORT" -q 0 > "$tmp_output_file" | ||
|
||
./kevm web3-send "$PORT" 'firefly_shutdown' | ||
echo | ||
timeout 20 tail --pid="$kevm_client_pid" -f /dev/null || true | ||
pkill -P "$kevm_client_pid" kevm-client || true | ||
timeout 20 tail --pid="$kevm_client_pid" -f /dev/null || true | ||
|
||
exit_code='0' | ||
git --no-pager diff --no-index "$output_file" "$tmp_output_file" || exit_code="$?" | ||
|
||
exit "$exit_code" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters