Join Enoki Testnet #154
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Join Enoki Testnet | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| # At 14:30 on Tuesday and Thursday. | |
| - cron: '30 14 * * 2,4' | |
| pull_request: | |
| paths: | |
| - testnet/join-enoki.sh | |
| - .github/workflows/join-testnet.yml | |
| jobs: | |
| test-sync: | |
| runs-on: ubuntu-22.04 | |
| env: | |
| RPC_ENDPOINT: https://rpc.sentry-01.enoki.polypore.xyz | |
| steps: | |
| - name: Bypass the grub-efi-amd64-signed package | |
| run: sudo apt-mark hold grub-efi-amd64-signed | |
| - name: Check out repository code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install ansible toml | |
| - name: Run testnet script | |
| run: | | |
| testnet/join-enoki.sh | |
| - name: Check sync status | |
| run: | | |
| sleep 3m | |
| echo "> Node log:" | |
| journalctl -u enokid | tail -n 100 | |
| echo "> enokid service status:" | |
| systemctl status enokid | |
| echo "> Sync status:" | |
| curl -s http://127.0.0.1:26657/status | jq -r '.result.sync_info' | |
| chain_height=$(curl -s $RPC_ENDPOINT/block | jq -r '.result.block.header.height') | |
| node_height=$(curl -s http://127.0.0.1:26657/block | jq -r '.result.block.header.height') | |
| echo "> Chain height: $chain_height" | |
| echo "> Node height: $node_height" | |
| if [ "$chain_height" -ne "$node_height" ]; then | |
| echo "Node is not synced with the testnet." | |
| exit 1 | |
| fi |