Skip to content

Export mainnet genesis #238

Export mainnet genesis

Export mainnet genesis #238

---
name: Export mainnet genesis
on:
workflow_dispatch:
schedule:
# At 05:30 on Monday.
- cron: '30 5 * * 1'
jobs:
build:
runs-on: ubuntu-22.04
steps:
# Get system info
- run: ifconfig
- run: arp -a
- run: sudo dmidecode
- run: df -h
- run: free -m
- run: uname -a
- run: lsb_release -a
- run: echo "GitHub branch is ${{ github.ref }}"
- run: whoami
- run: pwd
- name: Bypass the grub-efi-amd64-signed package
run: sudo apt-mark hold grub-efi-amd64-signed
- name: Set SSH key
run: |
if [ ! -d ~/.ssh ]
then
mkdir -m 700 ~/.ssh
fi
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ansible toml
- name: Checkout repo
uses: actions/checkout@master
- name: Install ansible-galaxy requirements
run: ansible-galaxy install -r requirements.yml
- name: Provision VM
run: ansible-playbook gaia-mainnet-export.yml -i examples/inventory-exporting-genesis-do.yml --extra-vars "digitalocean_api_key=${{ secrets.DO_API_KEY }}"
- name: Save node_key.json
run: echo "${{ secrets.MAINNET_NODE_KEY }}" | base64 --decode > ~/node_key.json
- name: Save priv_validator_key.json
run: echo "${{ secrets.MAINNET_PRIV_VALIDATOR_KEY }}" | base64 --decode > ~/priv_validator_key.json
- name: Install Gaia and configure for mainnet
run: ansible-playbook node.yml -i examples/inventory-cosmos-hub.yml --extra-vars "target=mainnet-export chain_start=false chain_binary_source=release statesync_rpc_servers=${{ secrets.MAINNET_RPC_SERVERS }} p2p_persistent_peers=${{ secrets.MAINNET_PERSISTENT_PEERS }} node_key_file=~/node_key.json priv_validator_key_file=~/priv_validator_key.json chain_registry=https://files.polypore.xyz/chain-registry/cosmoshub.json"
- name: Copy export_genesis.sh to VM
run: |
scp /tmp/export_genesis.sh root@mainnet-export:/tmp/export_genesis.sh
- name: Copy SSH key to VM
run: |
scp ~/.ssh/id_rsa root@mainnet-export:/root/.ssh/
- name: Run export_genesis.sh on VM in a screen session
run: |
ssh root@mainnet-export screen -L -Logfile /root/export_genesis.log -S export_genesis -d -m bash '/tmp/export_genesis.sh ${{ github.ref_name }}'