A very cool project by Daniel Hinton and Steve Jeffress that allows us to get a very precise approxiamation of the Bitcoin $USD price from the blockchain alone - without accessing any external site/exchange.
The sript is taken from the UTXO.live website run by the creators. A Bitcoin Magazine article explaining the concepts available here In short the script is based on the fact that many utxos (15 percent on average) are in round $usd amounts ($100 and $50 mostly), so it should hold until hyperbitcoinisation :)
Status: Tested v3
This script can be run by user “admin” without root privileges, it requires access to bitcoin-cli and server=1 option in bitcoin.conf as well as python3
$ sudo apt install python3
Download the script.
$ cd /tmp/ $ wget https://raw.githubusercontent.com/raspibolt/raspibolt/master/resources/UTXOracle.py
Read the script to see what it does (the script is very human readable so it is recommended) Exit with
$ less /tmp/UTXOracle.py
Install the script and make it executable
$ sudo install UTXOracle.py /usr/local/bin
You can now run the script with user “admin”
$ cd ~ $ UTXOracle.py