2026-07-21 10:25:38 +02:00
|
|
|
"""Manual smoke test: connect to the configured Electrum server, do the
|
|
|
|
|
server.version handshake, subscribe to headers and confirm a sane tip height.
|
|
|
|
|
|
|
|
|
|
Usage: PYTHONPATH=. python scripts/electrum_smoke_test.py
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
import asyncio
|
|
|
|
|
|
|
|
|
|
from app.config import settings
|
2026-11-16 15:31:47 +01:00
|
|
|
from plm_engine.electrum.client import ElectrumClient
|
2026-07-21 10:25:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
async def main() -> None:
|
|
|
|
|
client = ElectrumClient(settings.electrum_host, settings.electrum_port, settings.electrum_use_ssl)
|
|
|
|
|
await client.connect()
|
|
|
|
|
print("connected + handshake OK")
|
|
|
|
|
|
|
|
|
|
header = await client.subscribe_headers()
|
|
|
|
|
print("tip:", header)
|
|
|
|
|
assert header["height"] > 0
|
|
|
|
|
|
|
|
|
|
await client.close()
|
|
|
|
|
print("OK")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
asyncio.run(main())
|