Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 35 additions & 3 deletions .github/workflows/latest_asmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Latest ASMap file
on:
pull_request:
paths:
- '*.dat'
- '**/*.dat'

jobs:
validate:
Expand All @@ -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: |
Expand All @@ -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
Expand Down
Binary file added 2024/1704463200_asmap_unfilled.dat
Binary file not shown.
Binary file added 2024/1706536800_asmap_unfilled.dat
Binary file not shown.
Binary file added 2024/1710770400_asmap_unfilled.dat
Binary file not shown.
Binary file added 2024/1724248800_asmap_unfilled.dat
Binary file not shown.
Binary file added 2024/1730210400_asmap_unfilled.dat
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.