Skip to content

Commit 29f199f

Browse files
authored
feature: state dump entrypoint (#57)
* docker: disable ipc, default env vars for running locally * docker: state dump entrypoint
1 parent 12fbd94 commit 29f199f

File tree

4 files changed

+41
-6
lines changed

4 files changed

+41
-6
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/
1515
EXPOSE 8545 8546 8547 30303 30303/udp
1616

1717
COPY docker/entrypoint.sh /bin
18-
RUN chmod +x /bin/entrypoint.sh
18+
COPY docker/state_dump_entrypoint.sh /bin
19+
RUN chmod +x /bin/entrypoint.sh \
20+
&& chmod +x /bin/state_dump_entrypoint.sh
1921

2022
ENTRYPOINT ["sh", "/bin/entrypoint.sh"]

docker/dev_entrypoint.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
# Exits if any command fails
44
set -e
55

6-
NETWORK_ID=${NETWORK_ID:-420}
6+
HOSTNAME=${HOSTNAME:-0.0.0.0}
77
PORT=${PORT:-8545}
8+
NETWORK_ID=${NETWORK_ID:-420}
9+
VOLUME_PATH=${VOLUME_PATH:-/mnt/l2geth}
10+
811
TARGET_GAS_LIMIT=${TARGET_GAS_LIMIT:-8000000}
12+
913
TX_INGESTION=${TX_INGESTION:-false}
1014
TX_INGESTION_DB_HOST=${TX_INGESTION_DB_HOST:-localhost}
1115
TX_INGESTION_POLL_INTERVAL=${TX_INGESTION_POLL_INTERVAL:-3s}
@@ -24,6 +28,7 @@ else
2428
--rpcvhosts='*' \
2529
--rpccorsdomain='*' \
2630
--rpcport $PORT \
31+
--ipcdisable \
2732
--networkid $NETWORK_ID \
2833
--rpcapi 'eth,net' \
2934
--gasprice '0' \

docker/entrypoint.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/sh
22

33
## Passed in from environment variables:
4-
# HOSTNAME=
5-
# PORT=8545
6-
# NETWORK_ID=420
7-
NETWORK_ID=${NETWORK_ID:-420}
4+
HOSTNAME=${HOSTNAME:-0.0.0.0}
85
PORT=${PORT:-8545}
6+
NETWORK_ID=${NETWORK_ID:-420}
7+
VOLUME_PATH=${VOLUME_PATH:-/mnt/l2geth}
8+
99
CLEAR_DATA_FILE_PATH="${VOLUME_PATH}/.clear_data_key_${CLEAR_DATA_KEY}"
1010
TARGET_GAS_LIMIT=${TARGET_GAS_LIMIT:-8000000}
1111
TX_INGESTION=${TX_INGESTION:-false}
@@ -33,6 +33,7 @@ geth --dev \
3333
--rpccorsdomain='*' \
3434
--rpcport $PORT \
3535
--networkid $NETWORK_ID \
36+
--ipcdisable \
3637
--rpcapi 'eth,net' \
3738
--gasprice '0' \
3839
--targetgaslimit $TARGET_GAS_LIMIT \

docker/state_dump_entrypoint.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/sh
2+
3+
HOSTNAME=${HOSTNAME:-0.0.0.0}
4+
PORT=${PORT:-8545}
5+
NETWORK_ID=${NETWORK_ID:-420}
6+
VOLUME_PATH=${VOLUME_PATH:-/mnt/l2geth}
7+
8+
TARGET_GAS_LIMIT=${TARGET_GAS_LIMIT:-8000000}
9+
10+
echo "Starting Geth in debug mode"
11+
## Command to kick off geth
12+
geth --dev \
13+
--datadir $VOLUME_PATH \
14+
--rpc \
15+
--rpcaddr $HOSTNAME \
16+
--rpcvhosts='*' \
17+
--rpccorsdomain='*' \
18+
--rpcport $PORT \
19+
--networkid $NETWORK_ID \
20+
--ipcdisable \
21+
--rpcapi 'debug' \
22+
--gasprice '0' \
23+
--targetgaslimit $TARGET_GAS_LIMIT \
24+
--nousb \
25+
--gcmode=archive \
26+
--verbosity "6" \
27+
--txingestion.enable=false

0 commit comments

Comments
 (0)