mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-05-28 23:20:55 +08:00
110 lines
7.1 KiB
YAML
110 lines
7.1 KiB
YAML
##
|
|
## This workflow is used to help facilitate the V1 -> V2 migration.
|
|
## It pulls down the latest V1 export, commits the new chainstate file to a feature branch,
|
|
## and opens a PR against the master branch.
|
|
##
|
|
|
|
name: V1 to V2 Migration
|
|
|
|
env:
|
|
COMMIT_USER: Hiro DevOps
|
|
COMMIT_EMAIL: 45208873+blockstack-devops@users.noreply.github.com
|
|
UPDATE_BRANCH: auto/v1-v2-migration
|
|
GENESIS_DIR: stx-genesis
|
|
CHAINSTATE_URL: https://storage.googleapis.com/blockstack-v1-migration-data/chainstate.txt
|
|
CHAINSTATE_METADATA_URL: https://storage.googleapis.com/storage/v1/b/blockstack-v1-migration-data/o/chainstate.txt
|
|
CHAINSTATE_HASH_URL: https://storage.googleapis.com/blockstack-v1-migration-data/chainstate.txt.sha256
|
|
CHAINSTATE_HASH_METADATA_URL: https://storage.googleapis.com/storage/v1/b/blockstack-v1-migration-data/o/chainstate.txt.sha256
|
|
NAME_ZONEFILES_URL: https://storage.googleapis.com/blockstack-v1-migration-data/name_zonefiles.txt
|
|
NAME_ZONEFILES_METADATA_URL: https://storage.googleapis.com/storage/v1/b/blockstack-v1-migration-data/o/name_zonefiles.txt
|
|
NAME_ZONEFILES_HASH_URL: https://storage.googleapis.com/blockstack-v1-migration-data/name_zonefiles.txt.sha256
|
|
NAME_ZONEFILES_HASH_METADATA_URL: https://storage.googleapis.com/storage/v1/b/blockstack-v1-migration-data/o/name_zonefiles.txt.sha256
|
|
MD5_VERIFY_SCRIPT_URL: https://gist.github.com/wileyj/93b4222576cb702053ebfcd3cf9f570b
|
|
on:
|
|
repository_dispatch:
|
|
types:
|
|
- migration
|
|
|
|
jobs:
|
|
run:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout stacks-blockchain
|
|
uses: actions/checkout@v2
|
|
with:
|
|
token: ${{ secrets.GH_TOKEN }}
|
|
ref: next
|
|
|
|
- name: Update files
|
|
run: |
|
|
mkdir -p ${GENESIS_DIR}
|
|
curl -s ${CHAINSTATE_URL} > ${GENESIS_DIR}/chainstate.txt
|
|
echo "CHAINSTATE_TIME_CREATED=$(curl -s ${CHAINSTATE_METADATA_URL} | jq -r '.timeCreated')" >> $GITHUB_ENV
|
|
echo "CHAINSTATE_SIZE=$(curl -s ${CHAINSTATE_METADATA_URL} | jq -r '.size')" >> $GITHUB_ENV
|
|
echo "CHAINSTATE_MD5=$(curl -s ${CHAINSTATE_METADATA_URL} | jq -r '.md5Hash')" >> $GITHUB_ENV
|
|
echo "CHAINSTATE_DOWNLOAD_LINK=$(curl -s ${CHAINSTATE_METADATA_URL} | jq -r '.mediaLink')" >> $GITHUB_ENV
|
|
|
|
curl -s ${CHAINSTATE_HASH_URL} > ${GENESIS_DIR}/chainstate.txt.sha256
|
|
echo "CHAINSTATE_HASH_TIME_CREATED=$(curl -s ${CHAINSTATE_HASH_METADATA_URL} | jq -r '.timeCreated')" >> $GITHUB_ENV
|
|
echo "CHAINSTATE_HASH_SIZE=$(curl -s ${CHAINSTATE_HASH_METADATA_URL} | jq -r '.size')" >> $GITHUB_ENV
|
|
echo "CHAINSTATE_HASH_MD5=$(curl -s ${CHAINSTATE_HASH_METADATA_URL} | jq -r '.md5Hash')" >> $GITHUB_ENV
|
|
echo "CHAINSTATE_HASH_DOWNLOAD_LINK=$(curl -s ${CHAINSTATE_HASH_METADATA_URL} | jq -r '.mediaLink')" >> $GITHUB_ENV
|
|
|
|
curl -s ${NAME_ZONEFILES_URL} > ${GENESIS_DIR}/name_zonefiles.txt
|
|
echo "NAME_ZONEFILES_TIME_CREATED=$(curl -s ${NAME_ZONEFILES_METADATA_URL} | jq -r '.timeCreated')" >> $GITHUB_ENV
|
|
echo "NAME_ZONEFILES_SIZE=$(curl -s ${NAME_ZONEFILES_METADATA_URL} | jq -r '.size')" >> $GITHUB_ENV
|
|
echo "NAME_ZONEFILES_MD5=$(curl -s ${NAME_ZONEFILES_METADATA_URL} | jq -r '.md5Hash')" >> $GITHUB_ENV
|
|
echo "NAME_ZONEFILES_DOWNLOAD_LINK=$(curl -s ${NAME_ZONEFILES_METADATA_URL} | jq -r '.mediaLink')" >> $GITHUB_ENV
|
|
|
|
curl -s ${NAME_ZONEFILES_HASH_URL} > ${GENESIS_DIR}/name_zonefiles.txt.sha256
|
|
echo "NAME_ZONEFILES_HASH_TIME_CREATED=$(curl -s ${NAME_ZONEFILES_HASH_METADATA_URL} | jq -r '.timeCreated')" >> $GITHUB_ENV
|
|
echo "NAME_ZONEFILES_HASH_SIZE=$(curl -s ${NAME_ZONEFILES_HASH_METADATA_URL} | jq -r '.size')" >> $GITHUB_ENV
|
|
echo "NAME_ZONEFILES_HASH_MD5=$(curl -s ${NAME_ZONEFILES_HASH_METADATA_URL} | jq -r '.md5Hash')" >> $GITHUB_ENV
|
|
echo "NAME_ZONEFILES_HASH_DOWNLOAD_LINK=$(curl -s ${NAME_ZONEFILES_HASH_METADATA_URL} | jq -r '.mediaLink')" >> $GITHUB_ENV
|
|
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@v3
|
|
with:
|
|
token: ${{ secrets.GH_TOKEN }}
|
|
commit-message: Update v2 chainstate files
|
|
committer: ${{ env.COMMIT_USER }} <${{ env.COMMIT_EMAIL }}>
|
|
author: ${{ env.COMMIT_USER }} <${{ env.COMMIT_EMAIL }}>
|
|
branch: ${{ env.UPDATE_BRANCH }}
|
|
title: "[Stacks v1 → v2 Upgrade] Final update to chainstate files"
|
|
body: |
|
|
:robot: This is an automated pull request created from reaching the threshold of BNS names registered under the `.miner` namespace.
|
|
|
|
**Export triggered at block height: `${{ github.event.client_payload.block_height }}`**
|
|
|
|
This PR updates the chainstate file, chainstate consensus hash file, name_zonefile file, and name_zonefile consensus hash file to be used in the creation of the genesis block in the Stacks V2 network:
|
|
* [chainstate.txt](${{ env.CHAINSTATE_URL }})
|
|
* Time created: `${{ env.CHAINSTATE_TIME_CREATED }}`
|
|
* File size: `${{ env.CHAINSTATE_SIZE }} bytes`
|
|
* MD5 Hash: `${{ env.CHAINSTATE_MD5 }}`
|
|
* [Verify the MD5 hash with this script](${{ env.MD5_VERIFY_SCRIPT_URL }})
|
|
* [Download file](${{ env.CHAINSTATE_DOWNLOAD_LINK }})
|
|
* [chainstate.txt.sha256](${{ env.CHAINSTATE_HASH_URL }})
|
|
* Time created: `${{ env.CHAINSTATE_HASH_TIME_CREATED }}`
|
|
* File size: `${{ env.CHAINSTATE_HASH_SIZE }} bytes`
|
|
* MD5 Hash: `${{ env.CHAINSTATE_HASH_MD5 }}`
|
|
* [Verify the MD5 hash with this script](${{ env.MD5_VERIFY_SCRIPT_URL }})
|
|
* [Download file](${{ env.CHAINSTATE_HASH_DOWNLOAD_LINK }})
|
|
* [name_zonefiles.txt](${{ env.NAME_ZONEFILES_URL }})
|
|
* Time created: `${{ env.NAME_ZONEFILES_TIME_CREATED }}`
|
|
* File size: `${{ env.NAME_ZONEFILES_SIZE }} bytes`
|
|
* MD5 Hash: `${{ env.NAME_ZONEFILES_MD5 }}`
|
|
* [Verify the MD5 hash with this script](${{ env.MD5_VERIFY_SCRIPT_URL }})
|
|
* [Download file](${{ env.NAME_ZONEFILES_DOWNLOAD_LINK }})
|
|
* [name_zonefiles.txt.sha256](${{ env.NAME_ZONEFILES_HASH_URL }})
|
|
* Time created: `${{ env.NAME_ZONEFILES_HASH_TIME_CREATED }}`
|
|
* File size: `${{ env.NAME_ZONEFILES_HASH_SIZE }} bytes`
|
|
* MD5 Hash: `${{ env.NAME_ZONEFILES_HASH_MD5 }}`
|
|
* [Verify the MD5 hash with this script](${{ env.MD5_VERIFY_SCRIPT_URL }})
|
|
* [Download file](${{ env.NAME_ZONEFILES_HASH_DOWNLOAD_LINK }})
|
|
|
|
Once these changes are eventually merged into the `master` branch, a new tag will need to be created. This can be done one of two ways:
|
|
* Trigger this [Github workflow](https://github.com/blockstack/stacks-blockchain/actions?query=workflow%3Astacks-blockchain) from the `master` branch by selecting "Run Workflow", passing in the desired tag to be created as an argument
|
|
* Create the new tag from the `master` branch locally and push it up
|
|
assignees: jcnelson,kantai,lgalabru,diwakergupta
|
|
reviewers: CharlieC3,wileyj,zone117x,jcnelson,kantai,lgalabru,diwakergupta
|