Skip to content

Commit

Permalink
Merge pull request #317 from oasisprotocol/aefhm-patch-1
Browse files Browse the repository at this point in the history
Update Python client instructions
  • Loading branch information
aefhm committed May 28, 2024
2 parents 4e7499e + a796cbc commit 4170cc6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions clients/py/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ make
from web3 import Web3
from sapphirepy import sapphire

# Setup your Web3 provider with a signing account
# Setup your Web3 provider with a signing account.
w3 = Web3(Web3.HTTPProvider('http://localhost:8545'))
w3.middleware_onion.add(construct_sign_and_send_raw_middleware(account))

# Finally, wrap the provider to add Sapphire end-to-end encryption
# Finally, wrap the provider to add Sapphire end-to-end encryption.
w3 = sapphire.wrap(w3)
# Optionally, query Oasis Web3 Gateway for the gas price.
# from web3.gas_strategies.rpc import rpc_gas_price_strategy
# w3.eth.set_gas_price_strategy(rpc_gas_price_strategy)
```

The Sapphire middleware for Web3.py ensures all transactions, gas estimates and
Expand Down

0 comments on commit 4170cc6

Please sign in to comment.