-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
54 lines (45 loc) · 1.63 KB
/
Copy pathmain.py
File metadata and controls
54 lines (45 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import sys
import logging
from PySide6.QtWidgets import QApplication
from gui.main_window import MainWindow
from backend.wallet_manager import WalletManager
# Configure logging to show all levels
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
def main():
"""
Entry point for the Bitcoin XPUB Monitor app.
Connects to Electrum server for real data.
"""
logger = logging.getLogger(__name__)
logger.info("Starting Bitcoin XPUB Monitor application...")
app = QApplication(sys.argv)
try:
# Initialize wallet manager with real Electrum connection
logger.info("Initializing WalletManager...")
wallet_manager = WalletManager()
# Get real data from Electrum server
logger.info("Getting wallet balance...")
balance = wallet_manager.get_wallet_balance()
logger.info(f"Wallet balance retrieved: {balance} BTC")
xpub = wallet_manager.get_xpub()
logger.info(f"XPUB retrieved: {xpub[:20]}...")
# Launch the main window with real data
logger.info("Launching main window...")
window = MainWindow(
electrs_client=wallet_manager,
db_manager=None,
balance=balance,
transactions=[], # Empty for now
xpub=xpub
)
window.show()
logger.info("Application started successfully")
sys.exit(app.exec())
except Exception as e:
logger.error(f"Failed to start application: {e}", exc_info=True)
sys.exit(1)
if __name__ == "__main__":
main()