Skip to content

Commit

Permalink
feat: add autodeposit parameter, refactor domain variable as environm…
Browse files Browse the repository at this point in the history
…ent variable too
  • Loading branch information
Evan-Kim2028 committed Dec 19, 2024
1 parent bcc123f commit bcf7014
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
# Set default environment variables
ENV ROOT_PATH=/opt/mev-commit
ENV BINARY_PATH=${ROOT_PATH}/mev-commit
ENV DOMAIN=testnet.mev-commit.xyz
ENV DOMAIN=${DOMAIN}
ENV ARTIFACTS_URL=https://github.com/primev/mev-commit/releases/latest/download

ENV VERSION=${MEV_COMMIT_VERSION}
ENV ARTIFACTS_BASE_URL=https://github.com/primev/mev-commit/releases
ENV AUTO_DEPOSIT_VALUE=${AUTO_DEPOSIT_VALUE}
# Create the directory for mev-commit
RUN mkdir -p ${ROOT_PATH}
WORKDIR ${ROOT_PATH}
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ services:
mev-commit-bidder:
build: .
environment:
DOMAIN: testnet.mev-commit.xyz
DOMAIN: ${DOMAIN}
PRIVATE_KEY_BIDDER: ${PRIVATE_KEY_BIDDER}
AUTO_DEPOSIT_VALUE: ${AUTO_DEPOSIT_VALUE}
networks:
- app-network
ports:
Expand Down
4 changes: 3 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ FLAGS=(
--peer-type "bidder"
--bootnodes "${BOOTNODE}"
--log-tags "service:docker-mev-commit-bidder"
--bidder-bid-timeout "15s" # Override timeout here

)

# Start mev-commit in the background
Expand All @@ -64,7 +66,7 @@ wait_for_health() {
# Function to send auto deposit request
send_auto_deposit() {
echo "Sending auto deposit request..."
response=$(curl --silent --show-error --output /dev/null --write-out "%{http_code}" --request POST "http://127.0.0.1:13523/v1/bidder/auto_deposit/1000000000000000000")
response=$(curl --silent --show-error --output /dev/null --write-out "%{http_code}" --request POST "http://127.0.0.1:13523/v1/bidder/auto_deposit/${AUTO_DEPOSIT_VALUE}")
if [ "${response}" -ne 200 ]; then
echo "Failed to send auto deposit request, status code: ${response}"
else
Expand Down
5 changes: 4 additions & 1 deletion env.example
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
PRIVATE_KEY_BIDDER=your_private_key
PRIVATE_KEY_BIDDER=your_private_key
MEV_COMMIT_VERSION=latest
DOMAIN=testnet.mev-commit.xyz
AUTO_DEPOSIT_VALUE=1000000000000000000

0 comments on commit bcf7014

Please sign in to comment.