Skip to content

Commit

Permalink
Add network constants to class.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZigaMr committed Sep 10, 2024
1 parent aa5ea27 commit 45c01f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clients/py/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ from web3 import Web3
from sapphirepy import sapphire

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

# Finally, wrap the provider to add Sapphire end-to-end encryption.
Expand Down
6 changes: 6 additions & 0 deletions clients/py/sapphirepy/sapphire.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@

from .envelope import TransactionCipher

NETWORKS = {
"sapphire": "https://sapphire.oasis.io",
"sapphire-testnet": "https://testnet.sapphire.oasis.io",
"sapphire-localnet": "http://localhost:8545",
}

# Should transactions which deploy contracts be encrypted?
ENCRYPT_DEPLOYS = False

Expand Down

0 comments on commit 45c01f1

Please sign in to comment.