Skip to content

Commit

Permalink
client: add "autonity-helloworld" network config to client
Browse files Browse the repository at this point in the history
  • Loading branch information
dtebbs committed Aug 21, 2020
1 parent 50f749e commit b487bc1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/commands/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

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

ETH_NETWORK_FILE_DEFAULT = "eth-network"
Expand Down
8 changes: 8 additions & 0 deletions client/test_commands/fund_eth_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ def fund_eth_address(
# Use the first hosted address.
source_addr = web3.eth.accounts[0] # pylint: disable=no-member

if eth_network.name == "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 b487bc1

Please sign in to comment.