Skip to content

Add advance-epoch.sh script to localnet Docker images#795

Merged
abukosek merged 1 commit intomainfrom
andrej/feature/localnet-advance-epoch
Oct 9, 2025
Merged

Add advance-epoch.sh script to localnet Docker images#795
abukosek merged 1 commit intomainfrom
andrej/feature/localnet-advance-epoch

Conversation

@abukosek
Copy link
Contributor

@abukosek abukosek commented Oct 9, 2025

This PR adds a helper script to the localnet Docker images, /advance-epoch.sh, which advances the mock epoch by 1 or by the argument given.

@abukosek abukosek requested review from kostko and ptrus as code owners October 9, 2025 07:50
Copy link
Member

@ptrus ptrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 just one suggesrion

# Wait for the Oasis Node to start.
while [[ ! -S ${OASIS_NODE_SOCKET} ]]; do sleep 1; done

old_epoch=`${OASIS_NODE_BINARY} control status -a unix:${OASIS_NODE_SOCKET} | jq '.consensus.latest_epoch'`
Copy link
Member

@ptrus ptrus Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe ensure that mock epoch backend is configured (I think this can be seen via control status iirc), and if mock backend is not used print a nice error to the user.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked and unfortunately that isn't exported in the control status :(
I can check the BEACON_BACKEND variable though -- if it's set and if it's set to anything other than mock, the error message will be printed, otherwise the start script assumes a mock backend.

Copy link
Member

@ptrus ptrus Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh for some reason i thought we expose the consensus parameters. Maybe could check via oasis-cli network show?

But your suggestion is fine with me as well 👍

Copy link
Contributor Author

@abukosek abukosek Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the control status output there's just the consensus backend (which is always tendermint) 🤷‍♂️

The check for the BEACON_BACKEND variable that I just added should work fine, since the startup script also uses that :)
(And it's much simpler than parsing output from the CLI.)

@abukosek abukosek force-pushed the andrej/feature/localnet-advance-epoch branch from ccd41bc to 23c45ae Compare October 9, 2025 08:41
@abukosek abukosek enabled auto-merge October 9, 2025 08:44
@abukosek abukosek merged commit 28c15c8 into main Oct 9, 2025
6 checks passed
@abukosek abukosek deleted the andrej/feature/localnet-advance-epoch branch October 9, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants