feat: Update readme to have docker
All checks were successful
Build Docker / Build Image (push) Successful in 31s

This commit is contained in:
Nathan Woodburn 2024-01-29 15:42:54 +11:00
parent 200e2318d3
commit 2076cb6d0c
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
2 changed files with 16 additions and 6 deletions

View File

@ -21,4 +21,13 @@ python3 server.py
python3 main.py
```
Then access the wallet at http://localhost:5000
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
```

View File

@ -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 {