diff --git a/scripts/index.ts b/scripts/index.ts index 43d1650c..b751ff47 100644 --- a/scripts/index.ts +++ b/scripts/index.ts @@ -36,6 +36,7 @@ async function main() { espresso: { boolean: true, decription: 'use Espresso Sequencer for sequencing and DA', default: false }, espressoUrl: { string: true, description: 'Espresso Sequencer url', default: 'http://espresso-dev-node:41000' }, lightClientAddress: { string: true, description: 'address of the light client contract', default: ''}, + enableFinalityNode: {boolean: true, description: 'enable finality node', default: false}, }) .command(bridgeFundsCommand) .command(bridgeToL3Command) diff --git a/smoke-test-finality-node.bash b/smoke-test-finality-node.bash new file mode 100755 index 00000000..c1bc699e --- /dev/null +++ b/smoke-test-finality-node.bash @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -euo pipefail + +listen_to_sequencer_feed() { + # Listen to the sequencer feed and check if the sender address is detected + while read -r message; do + # Check if the message contains the specific sender address + if [[ "$message" == *"\"sender\":\"0xdd6bd74674c356345db88c354491c7d3173c6806\""* ]]; then + echo "Sender address detected" + break + fi + done < <(websocat ws://127.0.0.1:9642) +} + + +./test-node.bash --espresso --latest-espresso-image --validate --tokenbridge --init-force --detach --espresso-finality-node + +# Start the espresso finality node +docker compose up -d sequencer-espresso-finality --wait --detach + +# Sending L2 transaction +./test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait + +listen_to_sequencer_feed + +docker compose down \ No newline at end of file diff --git a/test-node.bash b/test-node.bash index b9a40625..a6612ca6 100755 --- a/test-node.bash +++ b/test-node.bash @@ -63,7 +63,6 @@ devprivkey=b6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659 l1chainid=1337 simple=true simple_with_validator=false - while [[ $# -gt 0 ]]; do case $1 in --init) @@ -106,6 +105,10 @@ while [[ $# -gt 0 ]]; do l2_espresso=true shift ;; + --espresso-finality-node) + enableFinalityNode=true + shift + ;; --latest-espresso-image) latest_espresso_image=true shift @@ -234,6 +237,7 @@ while [[ $# -gt 0 ]]; do echo --no-tokenbridge don\'t build or launch tokenbridge echo --no-run does not launch nodes \(useful with build or init\) echo --no-simple run a full configuration with separate sequencer/batch-poster/validator/relayer + echo --enable-finality-node enable espresso finality node echo echo script runs inside a separate docker. For SCRIPT-ARGS, run $0 script --help exit 0 @@ -294,6 +298,7 @@ if [ $batchposters -gt 2 ]; then fi + if $validate; then NODES="$NODES validator" elif ! $simple; then @@ -308,6 +313,7 @@ if $l3node; then export ESPRESSO_DEPLOYER_ALT_MNEMONICS="indoor dish desk flag debris potato excuse depart ticket judge file exit" export ESPRESSO_SEQUENCER_DEPLOYER_ALT_INDICES="6" fi + if $blockscout; then NODES="$NODES blockscout" fi @@ -397,6 +403,7 @@ if $force_init; then docker compose run --entrypoint sh geth -c "chown -R 1000:1000 /keystore" docker compose run --entrypoint sh geth -c "chown -R 1000:1000 /config" + if $consensusclient; then echo == Writing configs docker compose run scripts write-geth-genesis-config @@ -418,6 +425,7 @@ if $force_init; then docker compose up --wait prysm_validator else docker compose up --wait geth + # docker compose up --wait geth-espresso-finality docker compose run scripts write-geth-genesis-config fi @@ -454,7 +462,10 @@ if $force_init; then else echo == Writing configs docker compose run scripts write-config --espresso $l2_espresso --lightClientAddress $lightClientAddr - + if $enableFinalityNode; then + echo == Writing configs for finality node + docker compose run scripts write-config --enableFinalityNode --lightClientAddress $lightClientAddr + fi echo == Initializing redis docker compose up --wait redis docker compose run scripts redis-init --redundancy $redundantsequencers