diff --git a/plugins/batching.py b/plugins/batching.py index 4d24414..e1770b2 100644 --- a/plugins/batching.py +++ b/plugins/batching.py @@ -500,10 +500,6 @@ def advancedChangeLookahead(params, authentication): lookahead = int(lookahead) wallet = authentication.split(":")[0] password = ":".join(authentication.split(":")[1:]) - # curl http://x:api-key@127.0.0.1:14039/wallet/$id/account/$name \ - # -X PATCH \ - # --data '{"lookahead": $lookahead}' - APIKEY = os.getenv("hsd_api") ip = os.getenv("hsd_ip") if ip is None: diff --git a/plugins/renewal.py b/plugins/renewal.py index ac4ef44..349fa8f 100644 --- a/plugins/renewal.py +++ b/plugins/renewal.py @@ -51,10 +51,11 @@ def main(params, authentication): # Unlock wallet api_key = os.getenv("hsd_api") + ip = os.getenv("hsd_ip") if api_key is None: print("API key not set") return {"status": "API key not set", "transaction": "None"} - response = requests.post(f'http://x:{api_key}@127.0.0.1:12039/wallet/{wallet}/unlock', + response = requests.post(f'http://x:{api_key}@{ip}:12039/wallet/{wallet}/unlock', json={'passphrase': password, 'timeout': 600}) if response.status_code != 200: print("Failed to unlock wallet") @@ -73,7 +74,7 @@ def main(params, authentication): batchTX = "[" + ", ".join(batch) + "]" responseContent = f'{{"method": "sendbatch","params":[ {batchTX} ]}}' - response = requests.post(f'http://x:{api_key}@127.0.0.1:12039', data=responseContent) + response = requests.post(f'http://x:{api_key}@{ip}:12039', data=responseContent) if response.status_code != 200: print("Failed to create batch") print(f'Status code: {response.status_code}')