Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic Stargate wasmd scripts #539

Closed
wants to merge 11 commits into from
Closed

Conversation

willclarktech
Copy link
Contributor

Part of #515

sleep 1
echo "Waiting for height to be > 1 ..."
sleep 10
# timeout 20 bash -c "until test $(curl -s localhost:1319/blocks/latest | jq -r '.block.header.height // 0') -gt 1; do sleep 0.5; done"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@webmaster128 I think I'm doing something stupid here, but I can't get this line to work with the timeout.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, [, the nice syntax for test always needs a space before the end. Maybe an issue here?

Suggested change
# timeout 20 bash -c "until test $(curl -s localhost:1319/blocks/latest | jq -r '.block.header.height // 0') -gt 1; do sleep 0.5; done"
# timeout 20 bash -c "until [ $(curl -s localhost:1319/blocks/latest | jq -r '.block.header.height // 0') -gt 1 ]; do sleep 0.5; done"

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 tried that syntax before test.

Copy link
Member

Choose a reason for hiding this comment

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

Ahh, $(curl -s localhost:1319/blocks/latest | jq -r '.block.header.height // 0') is executed only once and then the following runs:

timeout 20 bash -c "until test 1 -gt 1; do sleep 0.5; done"

Copy link
Member

Choose a reason for hiding this comment

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

Found a way to fix the script. I just wonder why we need min height 2 instead of min height 1?

Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

Could you add the new ports to HACKING.md

scripts/wasmd/generate_template.sh Outdated Show resolved Hide resolved
scripts/wasmd/generate_template.sh Outdated Show resolved Hide resolved
scripts/wasmd/deploy_cw3.js Outdated Show resolved Hide resolved
scripts/wasmd/generate_addresses.js Show resolved Hide resolved
sleep 1
echo "Waiting for height to be > 1 ..."
sleep 10
# timeout 20 bash -c "until test $(curl -s localhost:1319/blocks/latest | jq -r '.block.header.height // 0') -gt 1; do sleep 0.5; done"
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, [, the nice syntax for test always needs a space before the end. Maybe an issue here?

Suggested change
# timeout 20 bash -c "until test $(curl -s localhost:1319/blocks/latest | jq -r '.block.header.height // 0') -gt 1; do sleep 0.5; done"
# timeout 20 bash -c "until [ $(curl -s localhost:1319/blocks/latest | jq -r '.block.header.height // 0') -gt 1 ]; do sleep 0.5; done"

scripts/wasmd/manual_start.sh Outdated Show resolved Hide resolved
@willclarktech willclarktech deleted the 515-wasmd-stargate branch November 20, 2020 17:15
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