Skip to content

Commit

Permalink
client: suport for 'autonity-helloworld' network
Browse files Browse the repository at this point in the history
  • Loading branch information
dtebbs committed Aug 21, 2020
1 parent 13cabc1 commit c078488
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/commands/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

ETH_RPC_ENDPOINT_DEFAULTS = {
"gnache": "http://localhost:8545",
"autonity-helloworld": "http://localhost:8541",
}

ETH_NETWORK_DEFAULT = "gnache"
ETH_NETWORK_DEFAULT = "autonity-helloworld"
PROVER_SERVER_ENDPOINT_DEFAULT = "localhost:50051"

ADDRESS_FILE_DEFAULT = "zeth-address.json"
Expand Down
12 changes: 12 additions & 0 deletions client/test_commands/fund_eth_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ def fund_eth_address(
eth_network = ctx.obj["eth_network"]
web3 = open_web3(ctx.obj["eth_rpc_endpoint"])

if not source_addr:
# Use the first hosted address.
source_addr = web3.eth.accounts[0] # pylint: disable=no-member

if eth_network == "autonity-helloworld":
# The Autonity helloworld network supplies hosted accounts, secured
# with the password 'test'. Attempt to unlock it.
# pylint: disable=import-outside-toplevel, no-member
from web3.middleware import geth_poa_middleware # type: ignore
web3.middleware_stack.inject(geth_poa_middleware, layer=0)
web3.personal.unlockAccount(source_addr, "test")

print(f"eth_addr = {eth_addr}")
print(f"source_addr = {source_addr}")
print(f"amount = {amount}")
Expand Down
5 changes: 5 additions & 0 deletions zeth_contracts/truffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ module.exports = {
gasprice: 0x1,
network_id: "*" // Match any network id
},
autonityhelloworld: {
host: "localhost",
port: 8541,
network_id: "*",
},
},
mocha: {
useColors: true,
Expand Down

0 comments on commit c078488

Please sign in to comment.