Skip to content

Commit

Permalink
chore(e2e): configure local-network to start in babbage instead of co…
Browse files Browse the repository at this point in the history
…nway
  • Loading branch information
mirceahasegan committed May 7, 2024
1 parent 7419ff8 commit d918355
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/cardano-services/environments/.env.local
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
METADATA_FETCH_MODE="direct"
SMASH_URL="http://cardano-smash:3100/api/v1"
PRE_CONWAY=stable
5 changes: 5 additions & 0 deletions packages/e2e/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,8 @@ SCHEDULES="/config/schedules.json"

# Required by test:long-running
STAKE_POOL_PROJECTOR_URL='http://localhost:4002/'

# PRE_CONWAY=stable starts the local-network in babbage era. If this variable is not set, the local-network will start in conway era.
# TODO: Once conway era is stable, remove this variable and start the local-network in conway era by default.
#
PRE_CONWAY=stable
1 change: 1 addition & 0 deletions packages/e2e/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ services:
environment:
CARDANO_NODE_LOG_LEVEL: ${CARDANO_NODE_LOG_LEVEL:-Info}
CARDANO_NODE_CHAINDB_LOG_LEVEL: ${CARDANO_NODE_CHAINDB_LOG_LEVEL:-Notice}
PRE_CONWAY: ${PRE_CONWAY}
ports:
- 3001:3001
volumes:
Expand Down
16 changes: 16 additions & 0 deletions packages/e2e/local-network/scripts/make-babbage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,22 @@ echo "TestConwayHardForkAtEpoch: 0" >> "${ROOT}/configuration.yaml"
echo "ExperimentalHardForksEnabled: True" >> "${ROOT}/configuration.yaml"
echo "ExperimentalProtocolsEnabled: True" >> "${ROOT}/configuration.yaml"

# TODO: Remove once mainnet is hardforked to conway-era and we don't need to run the e2e tests on pre-conway too.
# If we want the network to start in Babbage era we need to configure it to hardfork to Conway very far in the future.
# We also need to update the conway transaction cli commands to babbage cli commands.
if [ -n "$PRE_CONWAY" ]; then
echo "Updating scripts for pre-conway eras"
# Start in Babbage era
sed -i '/TestConwayHardForkAtEpoch/d' ./templates/babbage/node-config.json
sed -i '/TestConwayHardForkAtEpoch/d' ${ROOT}/configuration.yaml

# Convert all cardano-cli conway cmds to babbage
find ./scripts/ -type f -name "*.sh" -exec sed -i 's/cardano-cli conway /cardano-cli babbage /g' {} +

# Remove cardano-cli conway specific args
sed -i '/--key-reg-deposit-amt/d' ./scripts/setup-new-delegator-keys.sh
fi

# Copy the cost mode
cardano-cli genesis create-staked --genesis-dir "${ROOT}" \
--testnet-magic "${NETWORK_MAGIC}" \
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"test:web-extension:watch:run": "yarn test:web-extension:run --watch",
"test:web-extension:watch": "run-s test:web-extension:build test:web-extension:watch:bg",
"test:web-extension:watch:bg": "run-p test:web-extension:watch:build test:web-extension:watch:run",
"local-network:common": "DISABLE_DB_CACHE=${DISABLE_DB_CACHE:-true} SUBMIT_API_ARGS='--testnet-magic 888' USE_BLOCKFROST=false __FIX_UMASK__=$(chmod -R a+r ../../compose/placeholder-secrets) docker compose --env-file ../cardano-services/environments/.env.local -p local-network-e2e -f docker-compose.yml -f ../../compose/common.yml -f ../../compose/$(uname -m).yml $FILES up",
"local-network:common": "PRE_CONWAY=${PRE_CONWAY:-stable} DISABLE_DB_CACHE=${DISABLE_DB_CACHE:-true} SUBMIT_API_ARGS='--testnet-magic 888' USE_BLOCKFROST=false __FIX_UMASK__=$(chmod -R a+r ../../compose/placeholder-secrets) docker compose --env-file ../cardano-services/environments/.env.local -p local-network-e2e -f docker-compose.yml -f ../../compose/common.yml -f ../../compose/$(uname -m).yml $FILES up",
"local-network:up": "FILES='' yarn local-network:common",
"local-network:dev": "FILES='-f ../../compose/dev.yml' yarn local-network:common",
"local-network:profile:up": "FILES='-f ../../compose/pg-agent.yml' yarn local-network:common",
Expand Down

0 comments on commit d918355

Please sign in to comment.