Skip to content

Commit

Permalink
E2E smoke test with nitro components running separately
Browse files Browse the repository at this point in the history
  • Loading branch information
Sneh1999 committed Sep 6, 2024
1 parent e650de3 commit de62dc9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
19 changes: 7 additions & 12 deletions scripts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
Expand All @@ -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 {
Expand Down
22 changes: 22 additions & 0 deletions smoke-test-seperate-components.bash
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit de62dc9

Please sign in to comment.