fix: Update renewal plugin to get IP from env
All checks were successful
Build Docker / Build Image (push) Successful in 46s
All checks were successful
Build Docker / Build Image (push) Successful in 46s
This commit is contained in:
parent
35d3ccd0c0
commit
5c61bad9a2
@ -500,10 +500,6 @@ def advancedChangeLookahead(params, authentication):
|
|||||||
lookahead = int(lookahead)
|
lookahead = int(lookahead)
|
||||||
wallet = authentication.split(":")[0]
|
wallet = authentication.split(":")[0]
|
||||||
password = ":".join(authentication.split(":")[1:])
|
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")
|
APIKEY = os.getenv("hsd_api")
|
||||||
ip = os.getenv("hsd_ip")
|
ip = os.getenv("hsd_ip")
|
||||||
if ip is None:
|
if ip is None:
|
||||||
|
@ -51,10 +51,11 @@ def main(params, authentication):
|
|||||||
|
|
||||||
# Unlock wallet
|
# Unlock wallet
|
||||||
api_key = os.getenv("hsd_api")
|
api_key = os.getenv("hsd_api")
|
||||||
|
ip = os.getenv("hsd_ip")
|
||||||
if api_key is None:
|
if api_key is None:
|
||||||
print("API key not set")
|
print("API key not set")
|
||||||
return {"status": "API key not set", "transaction": "None"}
|
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})
|
json={'passphrase': password, 'timeout': 600})
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
print("Failed to unlock wallet")
|
print("Failed to unlock wallet")
|
||||||
@ -73,7 +74,7 @@ def main(params, authentication):
|
|||||||
|
|
||||||
batchTX = "[" + ", ".join(batch) + "]"
|
batchTX = "[" + ", ".join(batch) + "]"
|
||||||
responseContent = f'{{"method": "sendbatch","params":[ {batchTX} ]}}'
|
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:
|
if response.status_code != 200:
|
||||||
print("Failed to create batch")
|
print("Failed to create batch")
|
||||||
print(f'Status code: {response.status_code}')
|
print(f'Status code: {response.status_code}')
|
||||||
|
Loading…
Reference in New Issue
Block a user