Skip to content

Commit

Permalink
Merge pull request #29 from EspressoSystems/jh/update
Browse files Browse the repository at this point in the history
Fix the test node
  • Loading branch information
ImJeremyHe authored Apr 18, 2024
2 parents 58a1691 + 318edb3 commit da5f303
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 51 deletions.
49 changes: 38 additions & 11 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,42 @@ RUST_LOG_FORMAT=full
L1_BLOCK_TIME_SEC=3

# Internal port inside container
ESPRESSO_WEB_SERVER_PORT=40000
ESPRESSO_CDN_SERVER_PORT=40000
ESPRESSO_CDN_SERVER_METRICS_PORT=9090
ESPRESSO_ORCHESTRATOR_PORT=40001
ESPRESSO_CONSENSUS_SERVER_PORT=40002
ESPRESSO_DA_SERVER_PORT=40003
ESPRESSO_SEQUENCER_DA_SERVER_URL=http://da-server:$ESPRESSO_WEB_SERVER_PORT
ESPRESSO_SEQUENCER_CONSENSUS_SERVER_URL=http://consensus-server:$ESPRESSO_WEB_SERVER_PORT
ESPRESSO_SEQUENCER_ORCHESTRATOR_URL=http://orchestrator:$ESPRESSO_ORCHESTRATOR_PORT
ESPRESSO_ORCHESTRATOR_NUM_NODES=2
ESPRESSO_ORCHESTRATOR_START_DELAY=5s
ESPRESSO_ORCHESTRATOR_NEXT_VIEW_TIMEOUT=30s
ESPRESSO_ORCHESTRATOR_MIN_TRANSACTIONS=50
ESPRESSO_ORCHESTRATOR_MIN_PROPOSE_TIME=1s
ESPRESSO_ORCHESTRATOR_MAX_PROPOSE_TIME=2s
ESPRESSO_SEQUENCER_CDN_ENDPOINT=marshal-0:${ESPRESSO_CDN_SERVER_PORT}
ESPRESSO_SEQUENCER_ORCHESTRATOR_URL=http://orchestrator:${ESPRESSO_ORCHESTRATOR_PORT}
ESPRESSO_SEQUENCER_API_PORT=50000
ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_PORT=42000
ESPRESSO_SEQUENCER1_API_PORT=50001
ESPRESSO_SEQUENCER_URL=http://espresso-sequencer0:$ESPRESSO_SEQUENCER_API_PORT
ESPRESSO_SEQUENCER_URL=http://espresso-sequencer0:${ESPRESSO_SEQUENCER_API_PORT}
ESPRESSO_SEQUENCER_STORAGE_PATH=/store/sequencer
ESPRESSO_SEQUENCER_L1_PORT=8545
ESPRESSO_SEQUENCER_L1_WS_PORT=8546
ESPRESSO_SEQUENCER_L1_PROVIDER=http://geth:$ESPRESSO_SEQUENCER_L1_PORT
ESPRESSO_SEQUENCER_L1_WS_PROVIDER=ws://geth:$ESPRESSO_SEQUENCER_L1_WS_PORT
ESPRESSO_SEQUENCER_L1_PROVIDER=http://geth:${ESPRESSO_SEQUENCER_L1_PORT}
ESPRESSO_SEQUENCER_L1_WS_PROVIDER=ws://geth:${ESPRESSO_SEQUENCER_L1_WS_PORT}
ESPRESSO_SEQUENCER_L1_USE_LATEST_BLOCK_TAG=true
# A special account for `espresso-sequencer`, check `scripts/accounts.ts` for details.
ESPRESSO_COMMITMENT_ETH_MNEMONIC="indoor dish desk flag debris potato excuse depart ticket judge file exit"
ESPRESSO_SEQUENCER_ETH_MNEMONIC="test test test test test test test test test test test junk"
ESPRESSO_DEPLOYER_ACCOUNT_INDEX=6
ESPRESSO_SEQUENCER_HOTSHOT_ACCOUNT_INDEX=$ESPRESSO_DEPLOYER_ACCOUNT_INDEX
ESPRESSO_SEQUENCER_PREFUNDED_BUILDER_ACCOUNTS=0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f
ESPRESSO_COMMITMENT_TASK_PORT=60000
ESPRESSO_STATE_RELAY_SERVER_PORT=40004
ESPRESSO_SEQUENCER_DB_PORT=5432
ESPRESSO_STATE_RELAY_SERVER_URL=http://state-relay-server:${ESPRESSO_STATE_RELAY_SERVER_PORT}

ESPRESSO_STATE_SIGNATURE_WEIGHT_THRESHOLD=3

ESPRESSO_SEQUENCER_HOTSHOT_ACCOUNT_INDEX=6
ESPRESSO_BUILDER_ETH_ACCOUNT_INDEX=6
ESPRESSO_SEQUENCER_ETH_ACCOUNT_INDEX=6
ESPRESSO_DEPLOYER_ACCOUNT_INDEX=6

# Example sequencer demo private keys
ESPRESSO_DEMO_SEQUENCER_STAKING_PRIVATE_KEY_0=BLS_SIGNING_KEY~lNDh4Pn-pTAyzyprOAFdXHwhrKhEwqwtMtkD3CZF4x3o
Expand All @@ -46,3 +60,16 @@ ESPRESSO_STATE_RELAY_SERVER_URL=http://state-relay-server:$ESPRESSO_STATE_RELAY_

ESPRESSO_SEQUENCER_HOTSHOT_ADDRESS="0x75745a1124de342716a94cbdfdea12f4f93d1b80"
ESPRESSO_SEQUENCER_LIGHT_CLIENT_ADDRESS="0xae05733adeebc16f9e7f377c89b6ac7369fc9b07"

# Builder service
ESPRESSO_BUILDER_L1_PROVIDER=${ESPRESSO_SEQUENCER_L1_PROVIDER}
ESPRESSO_BUILDER_ETH_MNEMONIC=${ESPRESSO_SEQUENCER_ETH_MNEMONIC}
ESPRESSO_BUILDER_SERVER_PORT=41003
ESPRESSO_BUILDER_PRIVATE_STAKING_KEY=BLS_SIGNING_KEY~tI9He_sCnEbfEajycUXz9Scfy6ocLr0yL9ceD53s8QPa
ESPRESSO_BUILDER_PRIVATE_STATE_KEY=SCHNORR_SIGNING_KEY~IftHINvgzqcd9agX13HHY3Uhz8vsH46i8soKgV7ZUQV-
ESPRESSO_BUILDER_CHANNEL_CAPACITY=1024
ESPRESSO_BUILDER_BOOTSTRAPPED_VIEW=0
BUILDER_ADDRESS=0x23618e81e3f5cdf7f54c3d65f7fbc0abf5b21e8f

ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_0=7000
ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_1=7001
169 changes: 130 additions & 39 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -342,55 +342,104 @@ services:
- "$ESPRESSO_ORCHESTRATOR_PORT:$ESPRESSO_ORCHESTRATOR_PORT"
environment:
- ESPRESSO_ORCHESTRATOR_PORT
- ESPRESSO_ORCHESTRATOR_NUM_NODES=2
- ESPRESSO_ORCHESTRATOR_START_DELAY=5s
- ESPRESSO_ORCHESTRATOR_NEXT_VIEW_TIMEOUT=30s
- ESPRESSO_ORCHESTRATOR_MIN_TRANSACTIONS=1
- ESPRESSO_ORCHESTRATOR_MIN_PROPOSE_TIME=0s
- ESPRESSO_ORCHESTRATOR_MAX_PROPOSE_TIME=1s
- ESPRESSO_ORCHESTRATOR_NUM_NODES
- ESPRESSO_ORCHESTRATOR_START_DELAY
- ESPRESSO_ORCHESTRATOR_NEXT_VIEW_TIMEOUT
- ESPRESSO_ORCHESTRATOR_MIN_TRANSACTIONS
- ESPRESSO_ORCHESTRATOR_MIN_PROPOSE_TIME
- ESPRESSO_ORCHESTRATOR_MAX_PROPOSE_TIME
- RUST_LOG
- RUST_LOG_FORMAT

da-server:
image: ghcr.io/espressosystems/espresso-sequencer/web-server:arbitrum-integrationmusl
ports:
- "$ESPRESSO_DA_SERVER_PORT:$ESPRESSO_WEB_SERVER_PORT"
keydb:
image: docker.io/eqalpha/keydb:latest
command: ["--requirepass", "changemeplease!!"]
healthcheck:
# Attempt to PING the database
test: keydb-cli --pass changemeplease!! --raw incr PING
interval: 5s
timeout: 4s
retries: 20

# The CDN system's main entry point; where users contact first.
marshal-0:
environment:
- ESPRESSO_WEB_SERVER_PORT
- RUST_LOG=error
- RUST_LOG_FORMAT
- RUST_LOG
- ESPRESSO_CDN_SERVER_METRICS_PORT
image: ghcr.io/espressosystems/espresso-sequencer/cdn-marshal:main
command:
- cdn-marshal
- -d
- redis://:changemeplease!!@keydb:6379
- --bind-port
- $ESPRESSO_CDN_SERVER_PORT
- --metrics-enabled
- --metrics-port
- $ESPRESSO_CDN_SERVER_METRICS_PORT
depends_on:
orchestrator:
keydb:
condition: service_healthy

consensus-server:
image: ghcr.io/espressosystems/espresso-sequencer/web-server:arbitrum-integrationmusl
ports:
- "$ESPRESSO_CONSENSUS_SERVER_PORT:$ESPRESSO_WEB_SERVER_PORT"
# A broker is the main message-routing unit of the CDN
broker-0:
environment:
- ESPRESSO_WEB_SERVER_PORT
- RUST_LOG=error
- RUST_LOG_FORMAT
- RUST_LOG
- ESPRESSO_CDN_SERVER_METRICS_PORT
image: ghcr.io/espressosystems/espresso-sequencer/cdn-broker:main
command:
- cdn-broker
- -d
- redis://:changemeplease!!@keydb:6379
- --public-advertise-address
- broker-0:1738
- --private-advertise-address
- broker-0:1739
- --metrics-enabled
- --metrics-port
- $ESPRESSO_CDN_SERVER_METRICS_PORT
depends_on:
orchestrator:
keydb:
condition: service_healthy

# A broker is the main message-routing unit of the CDN
broker-1:
environment:
- RUST_LOG
- ESPRESSO_CDN_SERVER_METRICS_PORT
image: ghcr.io/espressosystems/espresso-sequencer/cdn-broker:main
command:
- cdn-broker
- -d
- redis://:changemeplease!!@keydb:6379
- --public-advertise-address
- broker-1:1738
- --private-advertise-address
- broker-1:1739
- --metrics-enabled
- --metrics-port
- $ESPRESSO_CDN_SERVER_METRICS_PORT
depends_on:
keydb:
condition: service_healthy

espresso-sequencer0:
image: ghcr.io/espressosystems/espresso-sequencer/sequencer:arbitrum-integrationmusl
ports:
- "$ESPRESSO_SEQUENCER_API_PORT:$ESPRESSO_SEQUENCER_API_PORT"
- "$ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_PORT:$ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_PORT"
# Run the API server (with options taken from the environment) and the optional submission API
command: sequencer -- http -- query -- status -- submit
command: sequencer -- http -- query -- status -- submit -- hotshot-events
environment:
- ESPRESSO_SEQUENCER_ORCHESTRATOR_URL
- ESPRESSO_SEQUENCER_DA_SERVER_URL
- ESPRESSO_SEQUENCER_CONSENSUS_SERVER_URL
- ESPRESSO_SEQUENCER_CDN_ENDPOINT
- ESPRESSO_SEQUENCER_API_PORT
- ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_PORT
- ESPRESSO_SEQUENCER_STORAGE_PATH
- ESPRESSO_SEQUENCER_L1_PROVIDER
- ESPRESSO_SEQUENCER_L1_USE_LATEST_BLOCK_TAG
- ESPRESSO_SEQUENCER_PRIVATE_STAKING_KEY=$ESPRESSO_DEMO_SEQUENCER_STAKING_PRIVATE_KEY_0
- ESPRESSO_SEQUENCER_PRIVATE_STATE_KEY=$ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_1
- ESPRESSO_SEQUENCER_PRIVATE_STATE_KEY=$ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_0
- ESPRESSO_SEQUENCER_LIBP2P_BIND_ADDRESS=0.0.0.0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_0
- ESPRESSO_SEQUENCER_LIBP2P_ADVERTISE_ADDRESS=espresso-sequencer0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_0
- ESPRESSO_STATE_RELAY_SERVER_URL
- ESPRESSO_SEQUENCER_ETH_MNEMONIC
- ESPRESSO_SEQUENCER_ETH_ACCOUNT_INDEX
Expand All @@ -401,9 +450,13 @@ services:
depends_on:
orchestrator:
condition: service_healthy
consensus-server:
sequencer-db:
condition: service_healthy
broker-0:
condition: service_healthy
da-server:
broker-1:
condition: service_healthy
marshal-0:
condition: service_healthy
geth:
condition: service_started
Expand All @@ -415,26 +468,31 @@ services:
# Run the API server (with options taken from the environment)
environment:
- ESPRESSO_SEQUENCER_ORCHESTRATOR_URL
- ESPRESSO_SEQUENCER_DA_SERVER_URL
- ESPRESSO_SEQUENCER_CONSENSUS_SERVER_URL
- ESPRESSO_SEQUENCER_CDN_ENDPOINT
- ESPRESSO_SEQUENCER_API_PORT
- ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_PORT
- ESPRESSO_SEQUENCER_STORAGE_PATH
- ESPRESSO_SEQUENCER_L1_PROVIDER
- ESPRESSO_SEQUENCER_L1_USE_LATEST_BLOCK_TAG
- ESPRESSO_SEQUENCER_PRIVATE_STAKING_KEY=$ESPRESSO_DEMO_SEQUENCER_STAKING_PRIVATE_KEY_1
- ESPRESSO_SEQUENCER_PRIVATE_STATE_KEY=$ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_1
- ESPRESSO_SEQUENCER_LIBP2P_BIND_ADDRESS=0.0.0.0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_1
- ESPRESSO_SEQUENCER_LIBP2P_ADVERTISE_ADDRESS=espresso-sequencer1:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_1
- ESPRESSO_SEQUENCER_ETH_MNEMONIC
- ESPRESSO_SEQUENCER_ETH_ACCOUNT_INDEX
- ESPRESSO_SEQUENCER_PREFUNDED_BUILDER_ACCOUNTS
- ESPRESSO_SEQUENCER_STATE_PEERS=http://espresso-sequencer0:$ESPRESSO_SEQUENCER_API_PORT
- RUST_LOG
- RUST_LOG_FORMAT
- ESPRESSO_SEQUENCER_STATE_PEERS=http://espresso-sequencer0:$ESPRESSO_SEQUENCER_API_PORT
depends_on:
orchestrator:
condition: service_healthy
consensus-server:
sequencer-db:
condition: service_healthy
broker-0:
condition: service_healthy
broker-1:
condition: service_healthy
da-server:
marshal-0:
condition: service_healthy
geth:
condition: service_started
Expand Down Expand Up @@ -469,10 +527,6 @@ services:
depends_on:
espresso-sequencer0:
condition: service_healthy
consensus-server:
condition: service_healthy
da-server:
condition: service_healthy
geth:
condition: service_started
deploy-contracts:
Expand All @@ -488,6 +542,43 @@ services:
- RUST_LOG
- RUST_LOG_FORMAT

sequencer-db:
image: postgres
user: postgres
ports:
- "$ESPRESSO_SEQUENCER_DB_PORT:5432"
environment:
- POSTGRES_PASSWORD=password
- POSTGRES_USER=root
healthcheck:
# Postgres can be falsely "ready" once before running init scripts.
# See https://github.com/docker-library/postgres/issues/146 for discussion.
test: "pg_isready && sleep 1 && pg_isready"
interval: 5s
timeout: 4s
retries: 20

permissionless-builder:
image: ghcr.io/espressosystems/espresso-sequencer/builder:main
ports:
- "$ESPRESSO_BUILDER_SERVER_PORT:$ESPRESSO_BUILDER_SERVER_PORT"
environment:
- ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_URL=http://espresso-sequencer0:$ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_PORT
- ESPRESSO_SEQUENCER_STATE_PEERS=http://espresso-sequencer0:$ESPRESSO_SEQUENCER_API_PORT
- ESPRESSO_BUILDER_PRIVATE_STAKING_KEY
- ESPRESSO_BUILDER_PRIVATE_STATE_KEY
- ESPRESSO_BUILDER_ETH_MNEMONIC
- ESPRESSO_BUILDER_ETH_ACCOUNT_INDEX
- ESPRESSO_BUILDER_L1_PROVIDER
- ESPRESSO_BUILDER_SERVER_PORT
- ESPRESSO_BUILDER_CHANNEL_CAPACITY
- ESPRESSO_BUILDER_BOOTSTRAPPED_VIEW
- RUST_LOG
- RUST_LOG_FORMAT
- ASYNC_STD_THREAD_COUNT
depends_on:
espresso-sequencer0:
condition: service_healthy

volumes:
l1data:
Expand Down
2 changes: 1 addition & 1 deletion test-node.bash
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ if $blockscout; then
NODES="$NODES blockscout"
fi
if $espresso; then
NODES="$NODES orchestrator da-server consensus-server espresso-sequencer0 espresso-sequencer1 commitment-task"
NODES="$NODES orchestrator espresso-sequencer0 espresso-sequencer1 commitment-task permissionless-builder"

fi
if $force_build; then
Expand Down

0 comments on commit da5f303

Please sign in to comment.