Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tpmccallum/9c1efaabaef96e92fb442342f5b6ba5d to your computer and use it in GitHub Desktop.
Save tpmccallum/9c1efaabaef96e92fb442342f5b6ba5d to your computer and use it in GitHub Desktop.
Prerequisite: mining setup instructions at https://gist.github.com/tpmccallum/8ffc14ce5bf131e366d985412257499d
sudo apt-get update
sudo apt-get upgrade
#Using docker ps -q because the -q flag just returns the ID which you will need later. Running docker ps (without the flag) verbosely returns everything.
docker ps -q
#Start the python interpreter using the Docker Id from the previous command as an argument
docker exec -it dockerContainerIdFromPreviousDockerPsCommandOutput python
#Then at the python prompt type
from web3 import Web3, HTTPProvider
web3 = Web3(HTTPProvider('http://localhost:8545'))
web3.eth.getBalance(web3.eth.accounts[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment