Skip to content

Commit c979ca6

Browse files
committed
fix
1 parent 3ee59b6 commit c979ca6

File tree

1 file changed

+21
-29
lines changed

1 file changed

+21
-29
lines changed

scripts/node-env.sh

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
#!/bin/bash
22

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-
113
# Detect current shell and its RC file
124
if [ -n "$ZSH_VERSION" ]; then
135
CURRENT_SHELL="zsh"
@@ -332,13 +324,13 @@ function eth-rpc() {
332324
--dev \
333325
--rpc-port 8546 \
334326
--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)
342334
else
343335
"$POLKADOT_SDK_DIR/target/$bin_folder/eth-rpc" \
344336
--log="$RUST_LOG" \
@@ -386,13 +378,13 @@ function eth-rpc() {
386378
--no-prometheus \
387379
--dev \
388380
--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)
396388
else
397389
"$POLKADOT_SDK_DIR/target/$bin_folder/eth-rpc" \
398390
--log="$RUST_LOG" \
@@ -437,13 +429,13 @@ function eth-rpc() {
437429
--no-prometheus \
438430
--dev \
439431
--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)
447439
else
448440
cargo run \
449441
--quiet \

0 commit comments

Comments
 (0)