Skip to content

Instantly share code, notes, and snippets.

@traderbagel
Last active July 21, 2018 07:46
Show Gist options
  • Save traderbagel/5adda43c97a2ecc86355d4e6c87522d8 to your computer and use it in GitHub Desktop.
Save traderbagel/5adda43c97a2ecc86355d4e6c87522d8 to your computer and use it in GitHub Desktop.
Initial web3.py
>>> from web3 import HTTPProvider, Web3
>>> from web3.utils.datastructures import AttributeDict
>>> FULL_NODE_HOSTS = 'https://mainnet.infura.io/v3/5ed2f03bbff64000b84fef413614c437'
>>> provider = HTTPProvider(FULL_NODE_HOSTS)
>>> web3 = Web3(provider)
>>> web3.eth.blockNumber
6002659
>>> web3.version.node
"Geth/v1.8.6-patched-leveldb-8818ab0b/linux-amd64/go1.9.2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment