Connects to an active BitCoin Peer, and locates a predetermined block number (height) by downloading block headers. Once required block height is required, the program will display information regarding the specific block such as block hash, merkle root hash, and transaction details.
Log.txt contains output example of a run.
- Clone onto local machine
git clone https://github.com/henryxsong/BitCoin-Peer-Client.git
Navigate to local repository directory
Run the program
- (Optional) Edit global variables to change block lookup number in lab5.py
# change FIND_THIS_BLOCK to the block height you want to find # currently locates block #2021. # per updated instructions in Teams, an arbitrary block height over 1000 is used :) # set FIND_THIS_BLOCK = MY_SUID % 700000 to lookup originally specified block height FIND_THIS_BLOCK = 712500#2021 # MY_SUID % 700000
- (Optional) Edit BitCoin peer address in lab5.py
# Hardcoded Bitcoin peer to connect to # Usually works consistently, but sometimes stalls and never finishes # Change this IP address if this peer is not functional # List of known working peers: # - 126.96.36.199 # - 188.8.131.52 # - 184.108.40.206 # - 220.127.116.11 # - 18.104.22.168 PEER_HOST = ('22.214.171.124', 8333)