SPV support & add internal HSD node #4

Merged
nathanwoodburn merged 9 commits from feat/internal_hsd into main 2025-08-29 13:04:31 +10:00
3 changed files with 15 additions and 12 deletions
Showing only changes of commit 4c84bc2bbe - Show all commits

View File

@@ -13,14 +13,11 @@ dotenv.load_dotenv()
HSD_API = os.getenv("HSD_API","")
HSD_IP = os.getenv("HSD_IP","localhost")
HSD_NETWORK = os.getenv("HSD_NETWORK")
HSD_NETWORK = os.getenv("HSD_NETWORK", "main")
HSD_WALLET_PORT = 12039
HSD_NODE_PORT = 12037
if not HSD_NETWORK:
HSD_NETWORK = "main"
else:
HSD_NETWORK = HSD_NETWORK.lower()
HSD_NETWORK = HSD_NETWORK.lower()
if HSD_NETWORK == "simnet":
HSD_WALLET_PORT = 15039
@@ -32,6 +29,12 @@ elif HSD_NETWORK == "regtest":
HSD_WALLET_PORT = 14039
HSD_NODE_PORT = 14037
INTERNAL_NODE = os.getenv("INTERNAL_HSD","false").lower() in ["1","true","yes"]
if INTERNAL_NODE:
if HSD_API == "":
# Use a random API KEY
HSD_API = "firewallet-" + str(int(time.time()))
SHOW_EXPIRED = os.getenv("SHOW_EXPIRED")
if SHOW_EXPIRED is None:

View File

@@ -56,10 +56,6 @@ def blocks_to_time(blocks: int) -> str:
if hours == 0:
return f"{days} days"
return f"{days} days {hours} hrs"
@app.route('/')
def index():
@@ -82,6 +78,8 @@ def index():
return render_template("index.html", account=account, plugins=plugins)
info = gitinfo.get_git_info()
if info is None:
return render_template("index.html", account=account, plugins=plugins)
branch = info['refs']
commit = info['commit']
if commit != latestVersion(branch):

View File

@@ -6,7 +6,7 @@ from domainLookup import punycode_to_emoji
import os
from handywrapper import api
import threading
import account
import requests
# Get Explorer URL
TX_EXPLORER_URL = os.getenv("EXPLORER_TX")
@@ -535,8 +535,10 @@ def renderDomainAsync(namehash: str) -> None:
if namehash in cache:
return
# Fetch the name outside the lock (network call)
name = account.hsd.rpc_getNameByHash(namehash)
# Fetch the name outside the lock (network call) using hsd.hns.au
# name = account.hsd.rpc_getNameByHash(namehash)
name = requests.get(f"https://hsd.hns.au/api/v1/namehash/{namehash}").json()
if name["error"] is None:
name = name["result"]
rendered = renderDomain(name)