|
1 | 1 | #!/bin/bash |
2 | 2 |
|
3 | | -# Get the directory where this script is located (works in both bash and zsh) |
4 | | -if [ -n "$BASH_SOURCE" ]; then |
5 | | - SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
6 | | -else |
7 | | - # zsh |
8 | | - SCRIPT_DIR="$(cd "$(dirname "${(%):-%x}")" && pwd)" |
9 | | -fi |
10 | | - |
11 | 3 | # Detect current shell and its RC file |
12 | 4 | if [ -n "$ZSH_VERSION" ]; then |
13 | 5 | CURRENT_SHELL="zsh" |
@@ -332,13 +324,13 @@ function eth-rpc() { |
332 | 324 | --dev \ |
333 | 325 | --rpc-port 8546 \ |
334 | 326 | --node-rpc-url "$NODE_RPC_URL" \ |
335 | | - "${args[@]}" 2>&1 \ |
336 | | - | tee /tmp/eth-rpc.log \ |
337 | | - | tee >(grep --line-buffered 'recv=' \ |
338 | | - | grep --line-buffered '\\"method\\":\\"eth_sendRawTransaction\\"' \ |
339 | | - | sed -u -E 's/.*recv="(.*)"/\1/' \ |
340 | | - | sed -u 's/\\"/"/g' \ |
341 | | - > /tmp/eth-rpc-requests.log) |
| 327 | + "${args[@]}" 2>&1 | |
| 328 | + tee /tmp/eth-rpc.log | |
| 329 | + tee >(grep --line-buffered 'recv=' | |
| 330 | + grep --line-buffered '\\"method\\":\\"eth_sendRawTransaction\\"' | |
| 331 | + sed -u -E 's/.*recv="(.*)"/\1/' | |
| 332 | + sed -u 's/\\"/"/g' \ |
| 333 | + >/tmp/eth-rpc-requests.log) |
342 | 334 | else |
343 | 335 | "$POLKADOT_SDK_DIR/target/$bin_folder/eth-rpc" \ |
344 | 336 | --log="$RUST_LOG" \ |
@@ -386,13 +378,13 @@ function eth-rpc() { |
386 | 378 | --no-prometheus \ |
387 | 379 | --dev \ |
388 | 380 | --node-rpc-url "$NODE_RPC_URL" \ |
389 | | - "${args[@]}" 2>&1 \ |
390 | | - | tee /tmp/eth-rpc.log \ |
391 | | - | tee >(grep --line-buffered 'recv=' \ |
392 | | - | grep --line-buffered '\\"method\\":\\"eth_sendRawTransaction\\"' \ |
393 | | - | sed -u -E 's/.*recv="(.*)"/\1/' \ |
394 | | - | sed -u 's/\\"/"/g' \ |
395 | | - > /tmp/eth-rpc-requests.log) |
| 381 | + "${args[@]}" 2>&1 | |
| 382 | + tee /tmp/eth-rpc.log | |
| 383 | + tee >(grep --line-buffered 'recv=' | |
| 384 | + grep --line-buffered '\\"method\\":\\"eth_sendRawTransaction\\"' | |
| 385 | + sed -u -E 's/.*recv="(.*)"/\1/' | |
| 386 | + sed -u 's/\\"/"/g' \ |
| 387 | + >/tmp/eth-rpc-requests.log) |
396 | 388 | else |
397 | 389 | "$POLKADOT_SDK_DIR/target/$bin_folder/eth-rpc" \ |
398 | 390 | --log="$RUST_LOG" \ |
@@ -437,13 +429,13 @@ function eth-rpc() { |
437 | 429 | --no-prometheus \ |
438 | 430 | --dev \ |
439 | 431 | --node-rpc-url "$NODE_RPC_URL" \ |
440 | | - "${args[@]}" 2>&1 \ |
441 | | - | tee /tmp/eth-rpc.log \ |
442 | | - | tee >(grep --line-buffered 'recv=' \ |
443 | | - | grep --line-buffered '\\"method\\":\\"eth_sendRawTransaction\\"' \ |
444 | | - | sed -u -E 's/.*recv="(.*)"/\1/' \ |
445 | | - | sed -u 's/\\"/"/g' \ |
446 | | - > /tmp/eth-rpc-requests.log) |
| 432 | + "${args[@]}" 2>&1 | |
| 433 | + tee /tmp/eth-rpc.log | |
| 434 | + tee >(grep --line-buffered 'recv=' | |
| 435 | + grep --line-buffered '\\"method\\":\\"eth_sendRawTransaction\\"' | |
| 436 | + sed -u -E 's/.*recv="(.*)"/\1/' | |
| 437 | + sed -u 's/\\"/"/g' \ |
| 438 | + >/tmp/eth-rpc-requests.log) |
447 | 439 | else |
448 | 440 | cargo run \ |
449 | 441 | --quiet \ |
|
0 commit comments