Skip to content

Commit 04b13be

Browse files
committed
simpler traffic proxy using just socat
Signed-off-by: Justin Florentine <justin+github@florentine.us>
1 parent 2812556 commit 04b13be

File tree

4 files changed

+10
-195
lines changed

4 files changed

+10
-195
lines changed

clients/snooper/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
FROM alpine
22

3-
RUN apk add --no-cache socat
4-
53
USER root
6-
FROM alpine
74

85
RUN apk add --no-cache socat
6+
RUN apk add --no-cache jq
97

108
COPY genesis.json /genesis.json
119
#TODO: check env var for mapper to use
1210
COPY mapper.jq /mapper.jq
1311

12+
1413
CMD ["sh", "-c", "\
1514
socat -V > /version.txt & \
16-
socat TCP-LISTEN:8545,fork TCP:host.docker.internal:8545 & \
17-
socat TCP-LISTEN:8551,fork TCP:host.docker.internal:8551 & \
15+
jq -f /mapper.jq /genesis.json > /besugenesis.json; \
16+
cat /besugenesis.json; \
17+
socat -v TCP-LISTEN:8545,fork TCP:host.docker.internal:8545 & \
18+
socat -v TCP-LISTEN:8551,fork TCP:host.docker.internal:8551 & \
1819
socat TCP-LISTEN:30303,fork TCP:host.docker.internal:30303 & \
1920
socat UDP-LISTEN:30303,fork UDP:host.docker.internal:30303 & \
2021
wait"]

clients/snooper/besu.sh

Lines changed: 0 additions & 168 deletions
This file was deleted.

clients/snooper/enode.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

configs/snoop-client.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- client: snooper
2+
nametag: main
3+
4+

0 commit comments

Comments
 (0)