Discv4 Crawl and DNS Update #11929
This file contains 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: Discv4 Crawl and DNS Update | |
on: | |
schedule: | |
- cron: '0 */4 * * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
if: github.repository == 'etclabscore/discv4-dns-lists' | |
name: Discv4-DNS-Crawler | |
runs-on: ubuntu-20.04 | |
env: | |
ETH_DNS_DISCV4_CRAWLTIME: 30m | |
ETH_DNS_DISCV4_PARENT_DOMAIN: blockd.info | |
ETH_DNS_DISCV4_KEY_PATH: ./secrets/dnskey.json | |
ETH_DNS_DISCV4_KEYPASS_PATH: ./secrets/dnskey_password.txt | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
ETH_DNS_CLOUDFLARE_ZONEID: ${{ secrets.ETH_DNS_CLOUDFLARE_ZONEID }} | |
ETH_DNS_DISCV4_KEY: ${{ secrets.ETH_DNS_DISCV4_KEY }} | |
ETH_DNS_DISCV4_KEYPASS: ${{ secrets.ETH_DNS_DISCV4_KEYPASS }} | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.22.4 | |
id: go | |
- run: go version | |
- run: sudo apt-get install -y jq | |
- name: Check out code | |
uses: actions/checkout@v2 | |
with: | |
ref: etccore | |
token: ${{ secrets.PAT_REPO_MEOWSBITS }} | |
- uses: actions/checkout@v2 | |
with: | |
ref: etccore | |
token: ${{ secrets.PAT_REPO_MEOWSBITS }} | |
- name: Checkout submodules | |
shell: bash | |
run: | | |
# If your submodules are configured to use SSH instead of HTTPS please uncomment the following line | |
# git config --global url."https://github.com/".insteadOf "git@github.com:" | |
auth_header="$(git config --local --get http.https://github.com/.extraheader)" | |
git submodule sync --recursive | |
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --depth=1 | |
cd core-geth | |
git fetch | |
git fetch --tags | |
# checkout_ref="$(git for-each-ref --count=1 --sort=-taggerdate --format '%(tag)' refs/tags)" | |
# git checkout ${checkout_ref} | |
checkout_ref="$(git for-each-ref --count=1 --sort=-committerdate --format '%(objectname)' refs/heads/master)" | |
git checkout ${checkout_ref} | |
make all | |
echo "$(pwd)/build/bin" >> $GITHUB_PATH | |
cd .. | |
git diff --quiet || { git add core-geth && git -c user.name='meows' -c user.email='b5c6@protonmail.com' commit --author='crawler <>' -m "ci update (core-geth:${checkout_ref}) $GITHUB_RUN_ID:$GITHUB_RUN_NUMBER"; } | |
- name: Setup secrets | |
run: | | |
mkdir secrets | |
echo "$ETH_DNS_DISCV4_KEY" > "$ETH_DNS_DISCV4_KEY_PATH" | |
echo "$ETH_DNS_DISCV4_KEYPASS" > "$ETH_DNS_DISCV4_KEYPASS_PATH" | |
- name: Check env and secrets | |
run: | | |
./.ci/deps.sh | |
export ETH_DNS_DISCV4_KEY_PUBLICINFO="$(cat $ETH_DNS_DISCV4_KEYPASS_PATH | ethkey inspect $ETH_DNS_DISCV4_KEY_PATH | grep -E '(Addr|Pub)')" | |
echo "$ETH_DNS_DISCV4_KEY_PUBLICINFO" | |
- name: Condense Classic (ETC) nodes list | |
run: | | |
cat \ | |
all.classic.blockd.info/nodes.json \ | |
all.mordor.blockd.info/nodes.json \ | |
| jq -s add \ | |
> all.json | |
- name: Crawl | |
run: | | |
./.ci/crawl.sh | |
- name: Filter and sign | |
run: | | |
./.ci/filter_and_sign.sh classic mordor | |
- name: Deploy to DNS | |
run: | | |
./.ci/deploy.sh classic mordor | |
- name: Push | |
env: | |
GITHUB_PAT: ${{ secrets.PAT_REPO_MEOWSBITS }} | |
run: | | |
git config --local user.name 'meows' | |
git config --local user.email 'b5c6@protonmail.com' | |
git remote set-url origin https://meowsbits:${GITHUB_PAT}@github.com/${GITHUB_REPOSITORY}.git | |
git push origin etccore | |
- uses: actions/checkout@v2 | |
- name: HandleIfFailure | |
if: failure() | |
uses: JasonEtco/create-an-issue@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
filename: .github/issue-on-failure.md |