Skip to content

Instantly share code, notes, and snippets.

@fjahr
fjahr / asmap_release.md
Last active March 11, 2023 18:16
Thoughts on ASMap for Bitcoin Core releases

ASMap in Bitcoin Core releases/ASMap data sources

Background

To get a general overview/refresher of the ASMap project please (re)read the post from Gleb on the Bitmex blog [1]. What is described there is still the status of ASMap file data sources to my knowledge.

Some further questions of mine about the process were discussed in November 2021 in an IRC meeting [2]. It was discussed that fresh ASMap files will be generated for and shipped with every release. The historic files that are part of the releases should be available in a separate repository under the bitcoin core GitHub organization. It was also discussed where the tools used during the release process should be maintained.

Since then, my focus has been on what would be the best possible data sources and quality assurance process for the input data of the ASMap file, i.e., a prefix to AS mapping that most accurately reflect the reality of the internet and that stays up to date for as long as possible.

#!/usr/bin/env python3
# show heights and timestamps of empty blocks, most recent first (so if using a pruned node,
# this will stop when we reach the start of the prune window)
from bitcoinrpc.authproxy import AuthServiceProxy
import json
from datetime import datetime
api = AuthServiceProxy("http://lmr:lmr@127.0.0.1:8332")
latest_height = api.getblockcount()
for i in range(latest_height, 1, -1):
bhash = api.getblockhash(i)