Skip to content

Commit

Permalink
feature: state dump entrypoint (#57)
Browse files Browse the repository at this point in the history
* docker: disable ipc, default env vars for running locally

* docker: state dump entrypoint
  • Loading branch information
tynes authored Oct 9, 2020
1 parent 12fbd94 commit 29f199f
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 6 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/
EXPOSE 8545 8546 8547 30303 30303/udp

COPY docker/entrypoint.sh /bin
RUN chmod +x /bin/entrypoint.sh
COPY docker/state_dump_entrypoint.sh /bin
RUN chmod +x /bin/entrypoint.sh \
&& chmod +x /bin/state_dump_entrypoint.sh

ENTRYPOINT ["sh", "/bin/entrypoint.sh"]
7 changes: 6 additions & 1 deletion docker/dev_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
# Exits if any command fails
set -e

NETWORK_ID=${NETWORK_ID:-420}
HOSTNAME=${HOSTNAME:-0.0.0.0}
PORT=${PORT:-8545}
NETWORK_ID=${NETWORK_ID:-420}
VOLUME_PATH=${VOLUME_PATH:-/mnt/l2geth}

TARGET_GAS_LIMIT=${TARGET_GAS_LIMIT:-8000000}

TX_INGESTION=${TX_INGESTION:-false}
TX_INGESTION_DB_HOST=${TX_INGESTION_DB_HOST:-localhost}
TX_INGESTION_POLL_INTERVAL=${TX_INGESTION_POLL_INTERVAL:-3s}
Expand All @@ -24,6 +28,7 @@ else
--rpcvhosts='*' \
--rpccorsdomain='*' \
--rpcport $PORT \
--ipcdisable \
--networkid $NETWORK_ID \
--rpcapi 'eth,net' \
--gasprice '0' \
Expand Down
9 changes: 5 additions & 4 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh

## Passed in from environment variables:
# HOSTNAME=
# PORT=8545
# NETWORK_ID=420
NETWORK_ID=${NETWORK_ID:-420}
HOSTNAME=${HOSTNAME:-0.0.0.0}
PORT=${PORT:-8545}
NETWORK_ID=${NETWORK_ID:-420}
VOLUME_PATH=${VOLUME_PATH:-/mnt/l2geth}

CLEAR_DATA_FILE_PATH="${VOLUME_PATH}/.clear_data_key_${CLEAR_DATA_KEY}"
TARGET_GAS_LIMIT=${TARGET_GAS_LIMIT:-8000000}
TX_INGESTION=${TX_INGESTION:-false}
Expand Down Expand Up @@ -33,6 +33,7 @@ geth --dev \
--rpccorsdomain='*' \
--rpcport $PORT \
--networkid $NETWORK_ID \
--ipcdisable \
--rpcapi 'eth,net' \
--gasprice '0' \
--targetgaslimit $TARGET_GAS_LIMIT \
Expand Down
27 changes: 27 additions & 0 deletions docker/state_dump_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

HOSTNAME=${HOSTNAME:-0.0.0.0}
PORT=${PORT:-8545}
NETWORK_ID=${NETWORK_ID:-420}
VOLUME_PATH=${VOLUME_PATH:-/mnt/l2geth}

TARGET_GAS_LIMIT=${TARGET_GAS_LIMIT:-8000000}

echo "Starting Geth in debug mode"
## Command to kick off geth
geth --dev \
--datadir $VOLUME_PATH \
--rpc \
--rpcaddr $HOSTNAME \
--rpcvhosts='*' \
--rpccorsdomain='*' \
--rpcport $PORT \
--networkid $NETWORK_ID \
--ipcdisable \
--rpcapi 'debug' \
--gasprice '0' \
--targetgaslimit $TARGET_GAS_LIMIT \
--nousb \
--gcmode=archive \
--verbosity "6" \
--txingestion.enable=false

0 comments on commit 29f199f

Please sign in to comment.