git clone https://github.com/xujiahuayz/fork.git
cd fork
chmod +x setup_repo.sh
./setup_repo.sh
. venv/bin/activate
or follow the step-by-step instructions below between the two horizontal rules:
- MacOS / Linux
python3 -m venv venv- Windows
python -m venv venv- MacOS / Linux
. venv/bin/activate- Windows (in Command Prompt, NOT Powershell)
venv\Scripts\activate.batpip install toml
pip install -e ".[dev]"mkdir data
cd data
wget https://raw.githubusercontent.com/blockchain/Blockchain-Known-Pools/master/pools.json
wget https://raw.githubusercontent.com/bitcoin-data/stale-blocks/refs/heads/master/stale-blocks.csv
<!-- wget https://api.blockchain.info/charts/n-orphaned-blocks?timespan=all&sampled=true&metadata=false&daysAverageString=1d&cors=true&format=json -->
curl -H "authority: www.antpool.com" "https://www.antpool.com/api/v3/minerInfo/miner/list/all" > miner_rank.json
wget https://raw.githubusercontent.com/coinmetrics/data/refs/heads/master/csv/btc.csv
<!-- curl "https://api.blockchain.info/charts/n-orphaned-blocks?timespan=all&sampled=true&metadata=false&daysAverageString=1d&cors=true&format=json" -> "orphans.json" -->
python scripts/get_miner_freq.pypython scripts/get_fork.pypython scripts/build_hash_panel.pypython scripts/tabulate_hash.pypython scripts/plot_miner_freq.pypython scripts/plot_miner_freq_zero.pyput your APIs in .env:
CLOVERPOOL_API_1="t123"
CLOVERPOOL_API_2='t456'
export $(cat .env | xargs)