diff --git a/README.md b/README.md index 0823e09..5f100fd 100644 --- a/README.md +++ b/README.md @@ -21,4 +21,13 @@ python3 server.py python3 main.py ``` -Then access the wallet at http://localhost:5000 \ No newline at end of file +Then access the wallet at http://localhost:5000 + + +Also available as a docker image: + +To run using a HSD running directly on the host: + +```bash +sudo docker run --network=host -e HSD_API_KEY=yourapikeyhere git.woodburn.au/nathanwoodburn/firewallet:latest +``` \ No newline at end of file diff --git a/account.py b/account.py index 200f66a..1670648 100644 --- a/account.py +++ b/account.py @@ -11,8 +11,9 @@ import json dotenv.load_dotenv() APIKEY = os.getenv("hsd_api") -hsd = api.hsd(APIKEY) -hsw = api.hsw(APIKEY) +hsd = api.hsd(APIKEY,'localhost') +hsw = api.hsw(APIKEY,'localhost') + # Verify the connection response = hsd.getInfo() @@ -135,7 +136,7 @@ def getDomains(account): # return [] # use requests to get the domains - response = requests.get(f"http://x:{APIKEY}@127.0.0.1:12039/wallet/{account}/name?own=true") + response = requests.get(f"http://x:{APIKEY}@localhost:12039/wallet/{account}/name?own=true") info = response.json() return info @@ -158,7 +159,7 @@ def check_address(address: str, allow_name: bool = True, return_address: bool = return check_hip2(address[1:]) # Check if the address is a valid HNS address - response = requests.post(f"http://x:{APIKEY}@127.0.0.1:12037",json={ + response = requests.post(f"http://x:{APIKEY}@localhost:12037",json={ "method": "validateaddress", "params": [address] }).json() @@ -211,7 +212,7 @@ def send(account,address,amount): response = hsw.rpc_walletPassphrase(password,10) # Unlock the account - # response = requests.post(f"http://x:{APIKEY}@127.0.0.1:12039/wallet/{account_name}/unlock", + # response = requests.post(f"http://x:{APIKEY}@localhost:12039/wallet/{account_name}/unlock", # json={"passphrase": password,"timeout": 10}) if response['error'] is not None: return {