From de62dc9162272960fd859b9af38b2afe157b028f Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Fri, 6 Sep 2024 13:00:08 -0400 Subject: [PATCH] E2E smoke test with nitro components running separately --- scripts/config.ts | 19 +++++++------------ smoke-test-seperate-components.bash | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 12 deletions(-) create mode 100644 smoke-test-seperate-components.bash diff --git a/scripts/config.ts b/scripts/config.ts index 737f5a43..fb998036 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -250,17 +250,16 @@ function writeConfigs(argv: any) { "vhosts": "*", "corsdomain": "*" }, - } + } as any if (argv.espresso) { - let config = baseConfig as any - config.node['block-validator']["espresso"] = false - config.node['block-validator']["light-client-address"] = "" - config.node["batch-poster"]["hotshot-url"] = "" - config.node["batch-poster"]["light-client-address"] = "" - config.node["transaction-streamer"] = { + baseConfig.node['block-validator']["espresso"] = false + baseConfig.node['block-validator']["light-client-address"] = "" + baseConfig.node["batch-poster"]["hotshot-url"] = "" + baseConfig.node["batch-poster"]["light-client-address"] = "" + baseConfig.node["transaction-streamer"] = { "sovereign-sequencer-enabled": false, - "hotshot-url": "", + "hotshot-url": argv.espressoUrl, "espresso-namespace": 412346, } } @@ -278,10 +277,6 @@ function writeConfigs(argv: any) { simpleConfig.node["delayed-sequencer"].enable = true simpleConfig.node["batch-poster"].enable = true simpleConfig.node["batch-poster"]["redis-url"] = "" - if (argv.espresso) { - simpleConfig.node["transaction-streamer"]["hotshot-url"] = argv.espressoUrl - simpleConfig.node["transaction-streamer"]["sovereign-sequencer-enabled"] = true - } simpleConfig.execution["sequencer"].enable = true fs.writeFileSync(path.join(consts.configpath, "sequencer_config.json"), JSON.stringify(simpleConfig)) } else { diff --git a/smoke-test-seperate-components.bash b/smoke-test-seperate-components.bash new file mode 100644 index 00000000..c7cee9fd --- /dev/null +++ b/smoke-test-seperate-components.bash @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -euo pipefail + +# no-simple runs a full +./test-node.bash --espresso --latest-espresso-image --validate --tokenbridge --init-force --detach --no-simple + +# Sending L2 transaction +./test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait + +rollupAddress=$(docker compose run --entrypoint sh poster -c "jq -r '.[0].rollup.rollup' /config/deployed_chain_info.json | tail -n 1 | tr -d '\r\n'") +while true; do + confirmed=$(cast call --rpc-url http://localhost:8545 $rollupAddress 'latestConfirmed()(uint256)') + echo "Number of confirmed staking nodes: $confirmed" + if [ "$confirmed" -gt 0 ]; then + break + else + echo "Waiting for more confirmed nodes ..." + fi + sleep 5 +done + +docker compose down