diff --git a/.github/workflows/check-bootnode-consistency.yml b/.github/workflows/check-bootnode-consistency.yml new file mode 100644 index 0000000..23c2ca9 --- /dev/null +++ b/.github/workflows/check-bootnode-consistency.yml @@ -0,0 +1,61 @@ + +name: Check bootnode consistency + +on: + pull_request: + branches: [ "main" ] + workflow_dispatch: + +jobs: + check_consistency: + name: Run bootnode consistency checks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Check bootnode consistency + run: | + cl_bootnodes=$(cat metadata/bootstrap_nodes.yaml | yq ".[]") + el_bootnodes=$(cat metadata/enodes.yaml | yq ".[]") + + echo "cl bootnodes ($(echo "$cl_bootnodes" | wc -l)):" + echo "$cl_bootnodes" + echo "" + + echo "el bootnodes ($(echo "$el_bootnodes" | wc -l)):" + echo "$el_bootnodes" + echo "" + + # check duplicate cl bootnodes + cl_duplicates=$(echo "$cl_bootnodes" | sort | uniq -d) + if [ ! -z "$cl_duplicates" ]; then + echo "duplicate cl bootnodes:" + echo "$cl_duplicates" + exit 1 + fi + + # check duplicate el bootnodes + el_duplicates=$(echo "$el_bootnodes" | sort | uniq -d) + if [ ! -z "$el_duplicates" ]; then + echo "duplicate el bootnodes:" + echo "$el_duplicates" + exit 1 + fi + + # check if bootnodes in besu.json match the bootnodes in metadata/enodes.yaml + besu_bootnodes=$(cat metadata/besu.json | jq -r ".config.discovery.bootnodes[]") + besu_bootnodes_diff=$(diff <(echo "$el_bootnodes") <(echo "$besu_bootnodes")) + if [ ! -z "$besu_bootnodes_diff" ]; then + echo "bootnodes in metadata/besu.json do not match the bootnodes in metadata/enodes.yaml" + echo "$besu_bootnodes_diff" + exit 1 + fi + + # check if bootnodes in chainspec.json match the bootnodes in metadata/enodes.yaml + chainspec_bootnodes=$(cat metadata/chainspec.json | jq -r ".nodes[]") + chainspec_bootnodes_diff=$(diff <(echo "$el_bootnodes") <(echo "$chainspec_bootnodes")) + if [ ! -z "$chainspec_bootnodes_diff" ]; then + echo "bootnodes in metadata/chainspec.json do not match the bootnodes in metadata/enodes.yaml" + echo "$chainspec_bootnodes_diff" + exit 1 + fi diff --git a/metadata/bootstrap_nodes.txt b/metadata/bootstrap_nodes.txt deleted file mode 100644 index 4336738..0000000 --- a/metadata/bootstrap_nodes.txt +++ /dev/null @@ -1,9 +0,0 @@ -enr:-Ku4QDZ_rCowZFsozeWr60WwLgOfHzv1Fz2cuMvJqN5iJzLxKtVjoIURY42X_YTokMi3IGstW5v32uSYZyGUXj9Q_IECh2F0dG5ldHOIAAAAAAAAAACEZXRoMpCo_ujukAAAaf__________gmlkgnY0gmlwhIpEe5iJc2VjcDI1NmsxoQNHTpFdaNSCEWiN_QqT396nb0PzcUpLe3OVtLph-AciBYN1ZHCCIy0 -enr:-Ku4QHRyRwEPT7s0XLYzJ_EeeWvZTXBQb4UCGy1F_3m-YtCNTtDlGsCMr4UTgo4uR89pv11uM-xq4w6GKfKhqU31hTgCh2F0dG5ldHOIAAAAAAAAAACEZXRoMpCo_ujukAAAaf__________gmlkgnY0gmlwhIrFM7WJc2VjcDI1NmsxoQI4diTwChN3zAAkarf7smOHCdFb1q3DSwdiQ_Lc_FdzFIN1ZHCCIy0 -enr:-Ku4QOkvvf0u5Hg4-HhY-SJmEyft77G5h3rUM8VF_e-Hag5cAma3jtmFoX4WElLAqdILCA-UWFRN1ZCDJJVuEHrFeLkDh2F0dG5ldHOIAAAAAAAAAACEZXRoMpCo_ujukAAAaf__________gmlkgnY0gmlwhJK-AWeJc2VjcDI1NmsxoQLFcT5VE_NMiIC8Ll7GypWDnQ4UEmuzD7hF_Hf4veDJwIN1ZHCCIy0 -enr:-Ku4QH6tYsHKITYeHUu5kdfXgEZWI18EWk_2RtGOn1jBPlx2UlS_uF3Pm5Dx7tnjOvla_zs-wwlPgjnEOcQDWXey51QCh2F0dG5ldHOIAAAAAAAAAACEZXRoMpCo_ujukAAAaf__________gmlkgnY0gmlwhIs7Mc6Jc2VjcDI1NmsxoQIET4Mlv9YzhrYhX_H9D7aWMemUrvki6W4J2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oaHEzMkvm4K6k6iHN5bmNuZXRzD4N0Y3CCIyiDdWRwgiMo diff --git a/metadata/enodes.txt b/metadata/enodes.txt deleted file mode 100644 index d4d0d15..0000000 --- a/metadata/enodes.txt +++ /dev/null @@ -1,5 +0,0 @@ -enode://4e5e92199ee224a01932a377160aa432f31d0b351f84ab413a8e0a42f4f36476f8fb1cbe914af0d9aef0d51665c214cf653c651c4bbd9d5550a934f241f1682b@138.197.51.181:30303 -enode://143e11fb766781d22d92a2e33f8f104cddae4411a122295ed1fdb6638de96a6ce65f5b7c964ba3763bba27961738fef7d3ecc739268f3e5e771fb4c87b6234ba@146.190.1.103:30303 -enode://8b61dc2d06c3f96fddcbebb0efb29d60d3598650275dc469c22229d3e5620369b0d3dedafd929835fe7f489618f19f456fe7c0df572bf2d914a9f4e006f783a9@170.64.250.88:30303 -enode://10d62eff032205fcef19497f35ca8477bea0eadfff6d769a147e895d8b2b8f8ae6341630c645c30f5df6e67547c03494ced3d9c5764e8622a26587b083b028e8@139.59.49.206:30303 -enode://9e9492e2e8836114cc75f5b929784f4f46c324ad01daf87d956f98b3b6c5fcba95524d6e5cf9861dc96a2c8a171ea7105bb554a197455058de185fa870970c7c@138.68.123.152:30303