diff --git a/.github/workflows/latest_asmap.yml b/.github/workflows/latest_asmap.yml index e01ef246d0..b834307c76 100644 --- a/.github/workflows/latest_asmap.yml +++ b/.github/workflows/latest_asmap.yml @@ -3,7 +3,7 @@ name: Latest ASMap file on: pull_request: paths: - - '*.dat' + - '**/*.dat' jobs: validate: @@ -15,8 +15,30 @@ jobs: - name: Find lastest ASMap file by timestamp id: find_latest run: | - LATEST_FILE=$(ls -1 *_asmap.dat | grep -v "latest_asmap.dat" | sort -r | head -n 1) - echo "LATEST_FILE=$LATEST_FILE" >> $GITHUB_ENV + set -euo pipefail + + # Find all *_asmap.dat except latest_asmap.dat, anywhere in the repo + LATEST_FILE="$( + find . -type f -name '*_asmap.dat' ! -name 'latest_asmap.dat' -print0 \ + | xargs -0 -I{} basename "{}" \ + | sort -r \ + | head -n 1 + )" + + if [ -z "${LATEST_FILE}" ]; then + echo "Error: No timestamped *_asmap.dat files found (excluding latest_asmap.dat)." + exit 1 + fi + + # Resolve the path of that file + LATEST_PATH="$(find . -type f -name "${LATEST_FILE}" ! -name 'latest_asmap.dat' | head -n 1)" + + if [ -z "${LATEST_PATH}" ]; then + echo "Error: Could not resolve path for latest file '${LATEST_FILE}'." + exit 1 + fi + + echo "LATEST_FILE=${LATEST_PATH#./}" >> "$GITHUB_ENV" - name: Check latest_asmap.dat exists and matches the highest timestamped file run: | @@ -25,6 +47,16 @@ jobs: exit 1 fi + if [ -z "${LATEST_FILE:-}" ]; then + echo "Error: LATEST_FILE env var is empty (find_latest step failed)." + exit 1 + fi + + if [ ! -f "$LATEST_FILE" ]; then + echo "Error: Resolved latest timestamped file does not exist: $LATEST_FILE" + exit 1 + fi + if ! cmp -s "$LATEST_FILE" "latest_asmap.dat"; then echo "Error: latest_asmap.dat does not match the content of $LATEST_FILE." exit 1 diff --git a/2024/1704463200_asmap_unfilled.dat b/2024/1704463200_asmap_unfilled.dat new file mode 100644 index 0000000000..ce94c6c8cc Binary files /dev/null and b/2024/1704463200_asmap_unfilled.dat differ diff --git a/2024/1706536800_asmap_unfilled.dat b/2024/1706536800_asmap_unfilled.dat new file mode 100644 index 0000000000..a448fbe259 Binary files /dev/null and b/2024/1706536800_asmap_unfilled.dat differ diff --git a/2024/1710770400_asmap_unfilled.dat b/2024/1710770400_asmap_unfilled.dat new file mode 100644 index 0000000000..19c42c8e6f Binary files /dev/null and b/2024/1710770400_asmap_unfilled.dat differ diff --git a/2024/1724248800_asmap_unfilled.dat b/2024/1724248800_asmap_unfilled.dat new file mode 100644 index 0000000000..4e1870d8f1 Binary files /dev/null and b/2024/1724248800_asmap_unfilled.dat differ diff --git a/2024/1730210400_asmap_unfilled.dat b/2024/1730210400_asmap_unfilled.dat new file mode 100644 index 0000000000..03eac1146f Binary files /dev/null and b/2024/1730210400_asmap_unfilled.dat differ diff --git a/1733234400_asmap.dat b/2024/1733234400_asmap_unfilled.dat similarity index 100% rename from 1733234400_asmap.dat rename to 2024/1733234400_asmap_unfilled.dat diff --git a/1742572800_asmap.dat b/2025/1742572800_asmap.dat similarity index 100% rename from 1742572800_asmap.dat rename to 2025/1742572800_asmap.dat diff --git a/1755187200_asmap.dat b/2025/1755187200_asmap.dat similarity index 100% rename from 1755187200_asmap.dat rename to 2025/1755187200_asmap.dat diff --git a/1755187200_asmap_unfilled.dat b/2025/1755187200_asmap_unfilled.dat similarity index 100% rename from 1755187200_asmap_unfilled.dat rename to 2025/1755187200_asmap_unfilled.dat diff --git a/1757606400_asmap.dat b/2025/1757606400_asmap.dat similarity index 100% rename from 1757606400_asmap.dat rename to 2025/1757606400_asmap.dat diff --git a/1757606400_asmap_unfilled.dat b/2025/1757606400_asmap_unfilled.dat similarity index 100% rename from 1757606400_asmap_unfilled.dat rename to 2025/1757606400_asmap_unfilled.dat diff --git a/1762444800_asmap.dat b/2025/1762444800_asmap.dat similarity index 100% rename from 1762444800_asmap.dat rename to 2025/1762444800_asmap.dat diff --git a/1762444800_asmap_unfilled.dat b/2025/1762444800_asmap_unfilled.dat similarity index 100% rename from 1762444800_asmap_unfilled.dat rename to 2025/1762444800_asmap_unfilled.dat diff --git a/1764864000_asmap.dat b/2025/1764864000_asmap.dat similarity index 100% rename from 1764864000_asmap.dat rename to 2025/1764864000_asmap.dat diff --git a/1764864000_asmap_unfilled.dat b/2025/1764864000_asmap_unfilled.dat similarity index 100% rename from 1764864000_asmap_unfilled.dat rename to 2025/1764864000_asmap_unfilled.dat diff --git a/README.md b/README.md index 524a9ae233..d3fc5ed748 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,12 @@ This repository holds recently created ASMap files encoded for use in Bitcoin Core. Any map included here has been created collaboratively between multiple participants (coordinated in an issue) and verified (in the follow-up pull request). The process is outlined in further detail on [Delving Bitcoin](https://delvingbitcoin.org/t/asmap-creation-process/548). +## Format + +ASmap files are provided in binary form, suitable for use with Bitcoin Core's `-asmap` flag. + +The files are organized by year. The `latest_asmap.dat` at the root of the project maps to the latest ASmap produced in these folders. An `_unfilled.dat` map means that only the networks sourced from the data are provided (see the [asmap-tool](https://github.com/bitcoin/bitcoin/blob/master/contrib/asmap/README.md) docs). The default is to use `--fill` when encoding the file to reduce the file size. + ## Tools for analysis of maps Users can further verify the integrity of the data with some of the [analysis commands](https://github.com/bitcoin/bitcoin/blob/master/contrib/asmap/README.md) available in `contrib/asmap/asmap-tool.py` (part of Bitcoin Core). There is also a ASMap health check log printed every 24 hours by Bitcoin Core nodes.