2020-05-10 21:11:21 -03:00
#Developer: Curly60e
2021-11-28 14:32:02 -03:00
#Tester: __B__T__C__
2022-02-12 11:25:12 -03:00
#ℙ 𝕪 𝔹 𝕃 𝕆 ℂ 𝕂 𝕚 𝕥 𝕤 𝕒 𝔹 𝕚 𝕥 𝕔 𝕠 𝕚 𝕟 𝔻 𝕒 𝕤 𝕙 𝕓 𝕠 𝕒 𝕣 𝕕 𝕨 𝕚 𝕥 𝕙 ℂ 𝕪 𝕡 𝕙 𝕖 𝕣 𝕡 𝕦 𝕟 𝕜 𝕒 𝕖 𝕤 𝕥 𝕙 𝕖 𝕥 𝕚 𝕔 .
2020-05-10 21:11:21 -03:00
2026-04-01 15:17:58 -03:00
import codecs
2020-05-06 16:34:55 -03:00
import os
2020-05-16 00:21:47 -03:00
import os . path
2020-05-06 16:34:55 -03:00
import time as t
2023-01-10 20:05:21 +01:00
import html2text
2020-05-29 11:52:29 -03:00
import qrcode
2020-06-19 17:51:28 -03:00
import random
2026-04-02 14:28:30 -03:00
import shlex
2020-06-24 17:08:28 -03:00
import sys
Security audit round 2: eliminate shell=True, mask secrets, fix race conditions
- Replace all shell=True subprocess calls with Python-native processing
(nodeconnection.py, SPV/nodeconnection.py, SPV/ppi.py)
- Mask sensitive inputs (private keys, passwords, tokens) with getpass
- Add threading.Lock to block_explorer.py shared state
- Use json.loads() instead of fragile string splitting in apisnd.py
- Add path validation before file open in apisnd.py
- Replace random.randint with secrets.randbelow for mining nonces
- Fix destructive exception handlers in clone.py and feed.py
- Replace bare except clauses with specific exceptions + logging
- Remove unused imports (psutil, xmltodict, block_visualizer, base64, say)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:15:59 -03:00
import getpass
2020-06-25 11:25:36 -03:00
import subprocess
2020-07-13 19:28:56 -03:00
import requests
import json
2024-07-26 10:47:28 -03:00
import lastblockdetail
2024-07-26 14:39:30 -03:00
import mempool_monitor
import asyncio
2024-07-29 18:21:21 -03:00
import peers_monitor
import tx_search
2024-07-30 14:49:21 -03:00
from block_explorer import call_blocks
2024-07-26 17:06:38 -03:00
from node_monitor import run_display_node_info
2026-04-01 12:03:52 -03:00
from imgterminal import createimagebitaxe , set_terminal_background
2024-04-12 16:13:38 -03:00
from datetime import datetime , timedelta
2026-04-01 12:03:52 -03:00
from sha256 import ex
2020-07-15 22:44:08 -03:00
from cfonts import render , say
2026-04-01 12:03:52 -03:00
from clone import gitclone , satnode
from donation import donationAddr , donationPayNym , donationLN , donationAddrTst , donationLNTst , decodeQR
from feed import readFile
from logos import logoA , logoB , logoC
from sysinf import sysinfoDetail
from pblogo import blogo , tick
from apisnd import apisender , apisenderFile
from ppi import (
opreturnOnchainONLY , opreturn , opreturn_view , opretminer , gameroom ,
statsConn , pgpConn , mtConn , satoshiConn , whalalConn , bwtConn ,
datesConn , quotesConn , miningConn , stalnConn , ranConn , CoingeckoPP ,
OwnNodeMinerComputer , OwnNodeMinerRaspberry , wttrDataV1 , wttrDataV2 ,
rateSXList , rateSXGraph , lnbitCreateNewInvoice , lnbitPayInvoice ,
lnbitCreatePayWall , lnbitDeletePayWall , lnbitsLNURLw , lnbitsLNURLwList ,
lnbitListPawWall , createFileConnOpenNode , OpenNodecreatecharge ,
OpenNodeiniciatewithdrawal , OpenNodelistfunds , OpenNodeListPayments ,
OpenNodeCheckStatus , tippinmeGetInvoice , blocks , fee ,
)
2020-08-25 20:08:40 -03:00
from termcolor import colored , cprint
2026-04-01 12:03:52 -03:00
from nodeconnection import (
remoteHalving , remotegetblock , remotegetblockcount , remoteconsole ,
runthenumbersConn , consoleLN , localaddinvoice , localpayinvoice ,
localkeysend , localnewaddress , locallistinvoices , localchannelbalance ,
locallistchannels , localrebalancelnd , locallistpeersQQ , localconnectpeer ,
localbalanceOC , locallistchaintxns , localgetinfo , localgetnetworkinfo ,
localchatsendA , localchatnewA , localchatlistA , localchatsendB ,
localchatnewB , localchatlistB , localchatsendC , localchatnewC ,
localchatlistC , getnewinvoice , payinvoice , getnewaddress , listinvoice ,
getinfo , channels , channelbalance , listonchaintxs , balanceOC ,
)
from terminal_matrix . matrix import doit
2020-12-07 20:56:35 -03:00
from PIL import Image
from robohash import Robohash
2022-12-21 21:47:49 +01:00
from binascii import unhexlify
from embit import bip39
from embit . wordlists . bip39 import WORDLIST
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
from config import cfg
from menu import select_color
from log import get_logger
from shared . display import clear , close , sysinfo , rectangle , delay_print
from shared . formatting import get_ansi_color_code , get_color
2026-04-01 13:09:21 -03:00
from shared . ui import status_bar , show_error , loading
2026-04-01 13:29:40 -03:00
from shared . rich_ui import (
2026-04-02 09:23:09 -03:00
console as rich_console , rich_status_bar , rich_header , rich_menu , rich_error , rich_prompt
2026-04-01 13:29:40 -03:00
)
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger = get_logger ( " PyBlock " )
2020-05-06 16:34:55 -03:00
2020-05-09 18:22:43 -03:00
2025-03-16 00:23:02 -03:00
version = " 4.0 "
2021-09-24 09:00:59 -03:00
2026-04-01 11:59:22 -03:00
def rpc ( method , params = None ) :
if params is None :
params = [ ]
2020-10-18 17:57:46 -03:00
payload = json . dumps ( {
" jsonrpc " : " 2.0 " ,
" id " : " minebet " ,
" method " : method ,
" params " : params
} )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
return requests . post ( cfg . path [ ' ip_port ' ] , auth = ( cfg . path [ ' rpcuser ' ] , cfg . path [ ' rpcpass ' ] ) , data = payload ) . json ( ) [ ' result ' ]
2020-10-18 17:57:46 -03:00
2022-03-17 21:37:11 -03:00
def pathexec ( ) :
global path
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
path = cfg . path
2022-03-07 00:04:06 -03:00
2022-03-17 21:37:11 -03:00
def lndconnectexec ( ) :
global lndconnectload
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
lndconnectload = cfg . lndconnectload
2026-04-03 10:57:20 -03:00
def _load_macaroon ( ) :
""" Load and hex-encode the LND macaroon from config. """
with open ( lndconnectload [ " macaroon " ] , ' rb ' ) as _mf :
return codecs . encode ( _mf . read ( ) , ' hex ' )
def _load_lnd_config ( ) :
""" Load LND connection config from blndconnect.conf. """
with open ( " config/blndconnect.conf " , " r " ) as f :
return json . load ( f )
2026-04-02 17:35:03 -03:00
def _run_btc ( command ) :
""" Run bitcoin-cli safely with shlex-parsed args. """
# nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit
return subprocess . run (
[ path [ ' bitcoincli ' ] ] + shlex . split ( command ) ,
capture_output = True , text = True
) . stdout
def _run_ln ( command ) :
""" Run lightning CLI safely with shlex-parsed args. """
# nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit
return subprocess . run (
[ lndconnectload [ ' ln ' ] ] + shlex . split ( command ) ,
capture_output = True , text = True
) . stdout
2022-03-07 23:51:30 +01:00
#-----------------------------Slush--------------------------------
2022-03-18 18:44:47 -03:00
def counttxs ( ) :
2022-03-20 20:29:22 -03:00
try :
2026-04-02 17:35:03 -03:00
block = subprocess . run ( [ path [ " bitcoincli " ] , " getblockcount " ] , capture_output = True , text = True ) . stdout
2022-03-20 16:47:23 -03:00
b = block
2022-03-20 20:29:22 -03:00
a = b
2022-03-20 16:47:23 -03:00
pathexec ( )
2022-03-20 20:29:22 -03:00
clear ( )
2026-04-02 17:35:03 -03:00
gnaa = subprocess . run ( [ path [ ' bitcoincli ' ] , " getrawmempool " ] , capture_output = True , text = True ) . stdout
2022-03-20 16:47:23 -03:00
gna1 = str ( gnaa )
d = json . loads ( gna1 )
e = len ( d )
n = e / 10
2022-03-20 20:29:22 -03:00
nn = n
2022-03-22 22:20:00 +00:00
getrawmempool = " getrawmempool "
2022-03-20 20:29:22 -03:00
while True :
x = a
2026-04-02 17:35:03 -03:00
block = subprocess . run ( [ path [ " bitcoincli " ] , " getblockcount " ] , capture_output = True , text = True ) . stdout
2022-03-20 20:29:22 -03:00
b = block
pathexec ( )
2026-04-02 17:35:03 -03:00
gnaa = subprocess . run ( [ path [ ' bitcoincli ' ] , " getrawmempool " ] , capture_output = True , text = True ) . stdout
2022-03-20 20:29:22 -03:00
gna1 = str ( gnaa )
d = json . loads ( gna1 )
e = len ( d )
n = e / 10
if e > nn :
clear ( )
2022-03-22 22:20:00 +00:00
outputtxs = render (
f ' { e } txs ' ,
colors = [ settingsClock [ ' colorA ' ] , settingsClock [ ' colorB ' ] ] ,
align = ' center ' ,
font = ' tiny ' ,
)
2022-03-20 20:29:22 -03:00
print ( " \x1b [?25l " + outputtxs )
shq = int ( n )
ss = str ( rectangle ( shq ) )
qq = ss . replace ( " None " , " " )
print ( f " \033 [A { qq } \033 [A " )
nn = e
if b > a :
print ( " \n \n \n " )
output = render ( str ( b ) , colors = [ settingsClock [ ' colorA ' ] , settingsClock [ ' colorB ' ] ] , align = ' center ' , font = ' tiny ' )
print ( " \a \x1b [?25l " + output )
2026-04-02 17:35:03 -03:00
bb = subprocess . run ( [ path [ " bitcoincli " ] , " getbestblockhash " ] , capture_output = True , text = True ) . stdout
ll = bb . strip ( )
qq = subprocess . run ( [ path [ " bitcoincli " ] , " getblock " , ll ] , capture_output = True , text = True ) . stdout
2022-03-20 20:29:22 -03:00
yy = json . loads ( qq )
mm = yy
outputtxs = render ( str ( mm [ ' nTx ' ] ) + " txs " , colors = [ settingsClock [ ' colorA ' ] , settingsClock [ ' colorB ' ] ] , align = ' center ' , font = ' tiny ' )
print ( " \x1b [?25l " + outputtxs )
2022-03-20 20:33:32 -03:00
sh = int ( mm [ ' nTx ' ] ) / 10
2022-03-20 20:29:22 -03:00
shq = int ( sh )
ss = str ( rectangle ( shq ) )
print ( ss . replace ( " None " , " " ) )
t . sleep ( 5 )
2022-03-21 10:27:19 -03:00
txs = str ( mm [ ' nTx ' ] )
if txs == " 1 " :
try :
2026-04-01 10:24:47 -03:00
p = subprocess . Popen ( [ ' curl ' , ' https://ascii.live/forrest ' ] )
2022-03-21 10:27:19 -03:00
p . wait ( 5 )
except subprocess . TimeoutExpired :
p . kill ( )
print ( " \033 [0;37;40m \x1b [?25l " )
2022-03-25 11:28:03 -03:00
clear ( )
2022-03-20 20:29:22 -03:00
a = b
nn = e
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2022-03-18 18:44:47 -03:00
2022-03-07 23:51:30 +01:00
def slDIFFConn ( ) :
try :
2022-03-09 08:59:25 -03:00
conn = """ curl -s https://insights.braiins.com/api/v1.0/difficulty-stats """
2026-04-02 17:35:03 -03:00
a = subprocess . run ( shlex . split ( conn ) , capture_output = True , text = True ) . stdout
2022-03-07 23:51:30 +01:00
clear ( )
blogo ( )
closed ( )
2022-03-08 23:03:11 +00:00
output = render ( " difficulty " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
2022-03-07 23:51:30 +01:00
print ( output )
2022-03-09 08:59:25 -03:00
b = json . loads ( a )
print ( f """ \n
2024-03-12 04:26:40 +01:00
Block epoch : { b [ ' block_epoch ' ] }
2022-03-09 08:59:25 -03:00
Difficulty : { b [ ' difficulty ' ] }
Epoch block time : { b [ ' epoch_block_time ' ] }
Estimated adjustment : { b [ ' estimated_adjustment ' ] }
Estimated adjustemnt date : { b [ ' estimated_adjustment_date ' ] }
Estimated next differece : { b [ ' estimated_next_diff ' ] }
Previous adjustment : { b [ ' previous_adjustment ' ] }
""" )
2022-03-07 23:51:30 +01:00
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2022-03-07 23:51:30 +01:00
def slPOOLConn ( ) :
try :
conn = """ curl -s https://insights.braiins.com/api/v1.0/pool-stats?json=1 | jq -C ' .[] ' | tr -d ' { |}|]|, ' | xargs -L 1 | grep -E " " """
2026-04-02 17:35:03 -03:00
a = subprocess . run ( shlex . split ( conn ) , capture_output = True , text = True ) . stdout
2022-03-07 23:51:30 +01:00
clear ( )
blogo ( )
closed ( )
2022-03-08 23:03:11 +00:00
output = render ( " pool " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
2022-03-07 23:51:30 +01:00
print ( output )
print ( a )
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2022-03-07 21:51:32 -03:00
2022-03-07 00:04:06 -03:00
def getPoolSlushCheck ( ) :
s = " "
sq = s
api = " "
2022-03-08 20:36:01 -03:00
try :
2024-03-08 23:32:07 +01:00
if os . path . isfile ( " config/braiinsAPI.conf " ) :
2026-04-02 14:38:18 -03:00
with open ( " config/braiinsAPI.conf " , " r " ) as f : apiv = json . load ( f )
2022-03-08 20:36:01 -03:00
api = apiv
else :
clear ( )
blogo ( )
2024-03-08 23:32:07 +01:00
api = input ( " Insert Braiins API KEY: " )
2026-04-01 10:24:47 -03:00
with open ( " config/braiinsAPI.conf " , " w " ) as f : json . dump ( api , f , indent = 2 )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2022-03-07 00:04:06 -03:00
while True :
try :
2024-03-10 01:55:25 +01:00
slushpoolbtc = f " curl https://pool.braiins.com/accounts/profile/json/btc/ -H ' SlushPool-Auth-Token: { api } ' 2>/dev/null "
2022-03-12 02:05:30 +00:00
2024-03-10 01:55:25 +01:00
slushpoolbtcblock = f " curl https://pool.braiins.com/stats/json/btc/ -H ' SlushPool-Auth-Token: { api } ' 2>/dev/null "
2022-03-12 02:05:30 +00:00
2022-03-07 00:04:06 -03:00
2026-04-02 17:35:03 -03:00
c = subprocess . run ( shlex . split ( slushpoolbtc ) , capture_output = True , text = True ) . stdout
2022-03-07 00:04:06 -03:00
d = json . loads ( c )
f = d [ ' btc ' ]
2026-04-02 17:35:03 -03:00
cblock = subprocess . run ( shlex . split ( slushpoolbtcblock ) , capture_output = True , text = True ) . stdout
2022-03-07 00:04:06 -03:00
dblock = json . loads ( cblock )
fblock = dblock [ ' btc ' ]
eblock = fblock [ ' blocks ' ]
for i in eblock :
qnq = sorted ( eblock )
for n in qnq :
s = n
if s > sq :
2022-09-27 19:39:22 +00:00
newblock = f " \a \n \n \t \t \u001b [31;1m New Block Mined \u001b [38;5;27m { s } \u001b [31;1m! \u001b [38;5;202mFresh sats for you! \033 [0;37;40m "
sq = s
2022-03-07 00:04:06 -03:00
else :
2022-09-27 19:39:22 +00:00
newblock = s
2022-03-07 00:04:06 -03:00
clear ( )
blogo ( )
print ( """ \033 [A
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2022-10-04 11:06:07 -03:00
\033 [ 0 ; 37 ; 40 mBraiins Pool
2022-03-07 00:04:06 -03:00
Username : { }
2024-03-10 02:05:17 +01:00
All Time reward : \u001b [ 38 ; 5 ; 40 m { } \033 [ 0 ; 37 ; 40 m BTC
Today reward : \u001b [ 33 ; 1 m { } \033 [ 0 ; 37 ; 40 m BTC
2022-03-07 00:04:06 -03:00
Estimated reward : { } BTC
All Time reward : { } BTC
Hash Rate 5 m : { } Gh / s
Hash Rate 60 m : { } Gh / s
Hash Rate 24 h : { } Gh / s
Hash Rate Scoring : \u001b [ 38 ; 5 ; 27 m { } \033 [ 0 ; 37 ; 40 m Gh / s
Hash Rate Yesterday : { } Gh / s
Connected Workers : { }
Disconnected Workers : { }
Last Block discovered : { }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2024-03-10 02:05:17 +01:00
\033 [ A """ .format(d[ ' username ' ], f[ ' all_time_reward ' ], f[ ' today_reward ' ], f[ ' estimated_reward ' ], f[ ' all_time_reward ' ], f[ ' hash_rate_5m ' ], f[ ' hash_rate_60m ' ], f[ ' hash_rate_24h ' ], f[ ' shares_yesterday ' ], f[ ' hash_rate_yesterday ' ], f[ ' ok_workers ' ], f[ ' off_workers ' ],newblock))
2022-03-07 00:04:06 -03:00
t . sleep ( 10 )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Loop interrupted: %s " , e )
2022-03-07 00:04:06 -03:00
break
2022-03-07 23:56:34 +01:00
#-----------------------------END Slush--------------------------------
2022-03-07 23:51:30 +01:00
2022-03-17 20:13:43 -03:00
def ckpoolpoolLOCALOnchainONLY ( ) :
2022-03-17 21:21:37 +01:00
s = " "
sq = s
api = " "
try :
if os . path . isfile ( " config/CKPOOLAPI.conf " ) :
2026-04-02 14:38:18 -03:00
with open ( " config/CKPOOLAPI.conf " , " r " ) as f : apiv = json . load ( f )
2022-03-17 21:21:37 +01:00
api = apiv
else :
clear ( )
blogo ( )
api = input ( " Insert CKPool Wallet.Worker: " )
2026-04-01 10:24:47 -03:00
with open ( " config/CKPOOLAPI.conf " , " w " ) as f : json . dump ( api , f , indent = 2 )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2022-03-17 21:21:37 +01:00
while True :
try :
2022-03-17 20:13:43 -03:00
ckpool = f " curl https://solo.ckpool.org/users/ { api } 2>/dev/null "
2022-03-17 21:21:37 +01:00
2026-04-02 17:35:03 -03:00
c = subprocess . run ( shlex . split ( ckpool ) , capture_output = True , text = True ) . stdout
2022-03-17 21:21:37 +01:00
d = json . loads ( c )
2022-03-17 19:48:04 -03:00
f = d [ ' worker ' ]
e = f [ 0 ]
2022-03-17 21:21:37 +01:00
clear ( )
blogo ( )
print ( """ \033 [A
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\033 [ 0 ; 37 ; 40 mCKPool BTC
Username : { }
2022-03-17 19:48:04 -03:00
Hash Rate 1 m : { }
Hash Rate 5 m : { }
Hash Rate 1 h : { }
Hash Rate 1 d : { }
Hash Rate 7 d : { }
Last Share : \u001b [ 38 ; 5 ; 27 m { } \033 [ 0 ; 37 ; 40 m
Shares : { }
Best Share : { }
Best Ever : { }
Workers : { }
2022-03-17 21:21:37 +01:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2022-03-17 19:48:04 -03:00
\033 [ A """ .format(e[ ' workername ' ], e[ ' hashrate1m ' ], e[ ' hashrate5m ' ], e[ ' hashrate1hr ' ], e[ ' hashrate1d ' ], e[ ' hashrate7d ' ], e[ ' lastshare ' ], e[ ' shares ' ], e[ ' bestshare ' ], e[ ' bestever ' ], d[ ' workers ' ]))
2022-03-17 21:21:37 +01:00
2022-03-17 19:58:42 -03:00
t . sleep ( 10 )
2022-03-17 21:21:37 +01:00
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Loop interrupted: %s " , e )
2022-03-17 21:21:37 +01:00
break
2022-03-07 23:51:30 +01:00
2024-07-23 18:21:11 +02:00
def callMemL ( ) :
2024-07-19 02:40:33 +02:00
try :
clear ( )
blogo ( )
2024-07-23 18:21:11 +02:00
output = render (
" Mempool-cli " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
if os . path . isdir ( ' mempoolcli ' ) :
2026-04-01 12:51:41 -03:00
subprocess . run ( [ " rm " , " -rf " , " mempool-cli_2.0.4_Linux_x86_64.tar.gz " ] , cwd = " mempoolcli " )
subprocess . run ( [ " wget " , " https://github.com/mempool/mempool-cli/releases/download/v2.0.4/mempool-cli_2.0.4_Linux_x86_64.tar.gz " ] , cwd = " mempoolcli " )
2024-07-23 18:21:11 +02:00
else : # Check if the file 'bclock.conf' is in the same folder
2026-04-01 12:51:41 -03:00
os . makedirs ( " mempoolcli " , exist_ok = True )
subprocess . run ( [ " wget " , " https://github.com/mempool/mempool-cli/releases/download/v2.0.4/mempool-cli_2.0.4_Linux_x86_64.tar.gz " ] , cwd = " mempoolcli " )
subprocess . run ( [ " tar " , " -xvf " , " mempool-cli_2.0.4_Linux_x86_64.tar.gz " ] , cwd = " mempoolcli " )
2024-07-23 18:21:11 +02:00
clear ( )
blogo ( )
print ( output )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./mempool-cli " ] , cwd = " mempoolcli " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2024-07-23 18:21:11 +02:00
menuSelection ( )
def callMemR ( ) :
try :
clear ( )
blogo ( )
output = render (
" Mempool-cli " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
if os . path . isdir ( ' mempoolcli ' ) :
2026-04-01 12:51:41 -03:00
subprocess . run ( [ " rm " , " -rf " , " mempool-cli_2.0.4_Linux_arm64.tar.gz " ] , cwd = " mempoolcli " )
subprocess . run ( [ " wget " , " https://github.com/mempool/mempool-cli/releases/download/v2.0.4/mempool-cli_2.0.4_Linux_arm64.tar.gz " ] , cwd = " mempoolcli " )
2024-07-23 18:21:11 +02:00
else : # Check if the file 'bclock.conf' is in the same folder
2026-04-01 12:51:41 -03:00
os . makedirs ( " mempoolcli " , exist_ok = True )
subprocess . run ( [ " wget " , " https://github.com/mempool/mempool-cli/releases/download/v2.0.4/mempool-cli_2.0.4_Linux_arm64.tar.gz " ] , cwd = " mempoolcli " )
subprocess . run ( [ " tar " , " -xvf " , " mempool-cli_2.0.4_Linux_arm64.tar.gz " ] , cwd = " mempoolcli " )
2024-07-23 18:21:11 +02:00
clear ( )
blogo ( )
print ( output )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./mempool-cli " ] , cwd = " mempoolcli " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2024-07-23 18:21:11 +02:00
menuSelection ( )
def MemShellMenu ( menunos ) :
if menunos in [ " A " , " a " ] :
callMemL ( )
elif menunos in [ " B " , " b " ] :
callMemR ( )
elif platf in [ " R " , " r " ] :
menuSelection ( )
2024-08-14 23:23:39 +02:00
def SHS ( ) :
try :
clear ( )
blogo ( )
output = render ( " SHS - Symbolic Hash Satoshi " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
2024-08-15 02:07:08 +02:00
print ( output )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " SHS.py " ] )
2024-08-14 23:23:39 +02:00
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2024-08-14 23:23:39 +02:00
menuSelection ( )
2024-07-23 18:21:11 +02:00
def MemShell ( ) :
clear ( )
blogo ( )
sysinfo ( )
pathexec ( )
#lndconnectexec()
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2024-07-23 18:21:11 +02:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2024-07-23 18:21:11 +02:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Linux
\u001b [ 38 ; 5 ; 202 mB . \033 [ 0 ; 37 ; 40 m Raspberry - Pi
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version ))
MemShellMenu ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2024-07-26 10:47:28 -03:00
2024-07-19 02:40:33 +02:00
2023-12-19 01:57:15 +01:00
def pyblockpoolpoolLOCALOnchainONLY ( ) :
2024-03-12 02:46:23 +01:00
2024-03-12 03:23:37 +01:00
s = " "
sq = s
api = " "
try :
if os . path . isfile ( " config/PYBLOCKPOOLAPI.conf " ) :
2026-04-02 14:38:18 -03:00
with open ( " config/PYBLOCKPOOLAPI.conf " , " r " ) as f : apiv = json . load ( f )
2024-03-12 03:23:37 +01:00
api = apiv
else :
clear ( )
blogo ( )
api = input ( " Insert your PyBLOCK Pool Wallet: " )
2026-04-01 10:24:47 -03:00
with open ( " config/PYBLOCKPOOLAPI.conf " , " w " ) as f : json . dump ( api , f , indent = 2 )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2023-12-19 01:57:15 +01:00
2024-03-12 03:23:37 +01:00
while True :
try :
2025-06-22 19:03:58 +02:00
pyblockpool = f " curl https://pyblock.xyz:8443/users/ { api } 2>/dev/null "
2024-03-12 03:23:37 +01:00
2026-04-02 17:35:03 -03:00
c = subprocess . run ( shlex . split ( pyblockpool ) , capture_output = True , text = True ) . stdout
2024-03-12 03:23:37 +01:00
d = json . loads ( c )
f = d [ ' worker ' ]
e = f [ 0 ]
clear ( )
blogo ( )
print ( """ \033 [A
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\033 [ 0 ; 37 ; 40 mPYBLOCK Pool Miner Stats
Username : { }
Hash Rate 1 m : { }
Hash Rate 5 m : { }
Hash Rate 1 h : { }
Hash Rate 1 d : { }
Hash Rate 7 d : { }
Last Share : \u001b [ 38 ; 5 ; 27 m { } \033 [ 0 ; 37 ; 40 m
Shares : { }
Best Share : { }
Best Ever : { }
Workers : { }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\033 [ A """ .format(e[ ' workername ' ], e[ ' hashrate1m ' ], e[ ' hashrate5m ' ], e[ ' hashrate1hr ' ], e[ ' hashrate1d ' ], e[ ' hashrate7d ' ], e[ ' lastshare ' ], e[ ' shares ' ], e[ ' bestshare ' ], e[ ' bestever ' ], d[ ' workers ' ]))
t . sleep ( 10 )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Loop interrupted: %s " , e )
2024-03-12 03:23:37 +01:00
break
2020-05-30 21:46:11 -03:00
def getblock ( ) : # get access to bitcoin-cli with the command getblockchaininfo
2020-11-15 20:24:59 -03:00
while True :
try :
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-15 20:24:59 -03:00
b = json . loads ( a )
d = b
print ( d )
clear ( )
blogo ( )
2021-09-24 09:00:59 -03:00
close ( )
2022-03-08 23:03:11 +00:00
output = render ( " CHAIN INFO " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
2021-11-27 10:53:51 -03:00
print ( output )
2020-11-15 20:24:59 -03:00
print ( """
2021-09-24 09:00:59 -03:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2020-11-15 20:24:59 -03:00
Chain : { }
Blocks : { }
Best BlockHash : { }
Difficulty : { }
Verification Progress : { }
Size on Disk : { }
Pruned : { }
2021-09-24 09:00:59 -03:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2020-11-15 20:24:59 -03:00
""" .format(d[ ' chain ' ], d[ ' blocks ' ], d[ ' bestblockhash ' ], d[ ' difficulty ' ], d[ ' verificationprogress ' ], d[ ' size_on_disk ' ], d[ ' pruned ' ]))
t . sleep ( 10 )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Loop interrupted: %s " , e )
2020-11-15 20:24:59 -03:00
break
2021-12-11 15:53:43 -03:00
def searchTXS ( ) :
2021-12-20 16:29:23 -03:00
try :
2022-09-27 19:39:22 +00:00
gettxout = " gettxout "
2021-12-11 15:53:43 -03:00
while True :
clear ( )
blogo ( )
closed ( )
2022-03-08 23:03:11 +00:00
output = render ( " search txs " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
2021-12-11 15:53:43 -03:00
print ( output )
tx = input ( " Search Tx ID: " )
2026-04-02 17:35:03 -03:00
gnta = _run_btc ( gettxout + tx + " 1 " )
2021-12-20 16:29:23 -03:00
gnt1 = str ( gnta )
gnt2 = json . loads ( gnt1 )
if gnt2 [ ' bestblock ' ] :
clear ( )
blogo ( )
closed ( )
2022-03-08 23:03:11 +00:00
output = render ( " search txs " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
2021-12-20 16:29:23 -03:00
print ( output )
2022-09-27 19:39:22 +00:00
scriptPubKey = gnt2 [ ' scriptPubKey ' ]
2021-12-20 16:29:23 -03:00
print ( """
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Tx : \u001b [ 38 ; 5 ; 40 m { } \033 [ 0 ; 37 ; 40 m
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\u001b [ 31 ; 1 mBestblockhash : \u001b [ 31 ; 1 m { }
\u001b [ 31 ; 1 mConfirmations : \u001b [ 38 ; 5 ; 27 m { }
\u001b [ 31 ; 1 mAmount : \u001b [ 38 ; 5 ; 202 m { } BTC
\u001b [ 31 ; 1 mAddress : \u001b [ 33 ; 1 m { } \033 [ 0 ; 37 ; 40 m
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
""" .format(tx, gnt2[ ' bestblock ' ], gnt2[ ' confirmations ' ], gnt2[ ' value ' ], scriptPubKey[ ' address ' ]))
else :
print ( " Is this a \u001b [38;5;40m Coinbase \033 [0;37;40m tx? " )
input ( " \n \033 [?25l \033 [0;37;40m \n \033 [AContinue... \033 [A " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2021-12-11 15:53:43 -03:00
2021-11-26 00:57:45 -03:00
def untxsConn ( ) :
try :
while True :
clear ( )
blogo ( )
closed ( )
2022-03-08 23:03:11 +00:00
output = render (
" unconfirmed txs " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
2021-11-26 17:23:28 -03:00
print ( output )
2021-11-26 00:57:45 -03:00
getrawmempool = " getrawmempool "
2026-04-02 17:35:03 -03:00
gnaa = _run_btc ( getrawmempool )
2021-11-26 00:57:45 -03:00
gna1 = str ( gnaa )
d = json . loads ( gna1 )
2021-11-26 20:25:00 +00:00
getrawtrans = " getrawtransaction "
2021-11-26 00:57:45 -03:00
for b in d :
n = " " . join ( map ( str , b ) )
m = getrawtrans + n + " 1 "
2026-04-02 17:35:03 -03:00
gnba = _run_btc ( m )
2021-11-26 00:57:45 -03:00
gnb1 = str ( gnba )
2021-11-26 17:23:28 -03:00
abc = json . loads ( gnb1 )
ab = abc [ ' vout ' ]
2021-11-26 22:21:14 +00:00
knz = ' address '
2021-12-06 20:29:23 +00:00
for value in ab :
2021-11-26 17:23:28 -03:00
knx = value [ ' scriptPubKey ' ]
2021-11-26 19:20:09 -03:00
if knz in knx :
2022-09-27 19:39:22 +00:00
print (
f " TxID: \u001b [38;5;40m { b } \033 [0;37;40m| \u001b [31;1mAmount: \u001b [38;5;202m { value [ ' value ' ] } BTC \033 [0;37;40m| \u001b [31;1mAddress: \u001b [33;1m { knx [ ' address ' ] } \033 [0;37;40m | \u001b [31;1mType: \u001b [31;1m { knx [ ' type ' ] } \u001b [33;1m "
)
2021-11-26 19:20:09 -03:00
else :
2022-09-27 19:39:22 +00:00
print (
f " TxID: \u001b [38;5;40m { b } \033 [0;37;40m| \u001b [31;1mAmount: \u001b [38;5;202m { value [ ' value ' ] } BTC \033 [0;37;40m| \u001b [31;1mOP_RETURN: \u001b [38;5;27m { knx [ ' asm ' ] } \033 [0;37;40m | \u001b [31;1mType: \u001b [31;1m { knx [ ' type ' ] } \u001b [33;1m "
)
2021-11-30 15:01:15 -03:00
print ( " OP_RETURN Hex: " )
2026-04-02 14:28:30 -03:00
if _is_hex ( b ) :
cli = shlex . split ( path [ ' bitcoincli ' ] )
raw = subprocess . run ( cli + [ " getrawtransaction " , b ] , capture_output = True ) . stdout
xxd = subprocess . run ( [ " xxd " , " -r " , " -p " ] , input = raw , capture_output = True )
subprocess . run ( [ " hexyl " , " -n " , " 256 " ] , input = xxd . stdout )
2021-11-30 15:01:15 -03:00
input ( " \n \033 [?25l \033 [0;37;40m \n \033 [AContinue... \033 [A " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2021-11-26 00:57:45 -03:00
2021-11-24 07:47:40 -03:00
def getnewaddressOnchain ( ) :
2021-11-24 19:56:39 -03:00
try :
clear ( )
blogo ( )
close ( )
qr = qrcode . QRCode (
version = 1 ,
error_correction = qrcode . constants . ERROR_CORRECT_L ,
box_size = 10 ,
border = 4 ,
)
getadd = " getnewaddress "
getbal = " getbalance "
getfeemempool = " getmempoolinfo "
getunconfirm = " getunconfirmedbalance "
2026-04-02 17:35:03 -03:00
gnaa = _run_btc ( getadd )
2021-11-24 19:56:39 -03:00
gna1 = str ( gnaa )
2026-04-02 17:35:03 -03:00
gnbb = _run_btc ( getbal )
2021-11-22 14:48:21 -03:00
gnb1 = str ( gnbb )
2026-04-02 17:35:03 -03:00
gnua = _run_btc ( getunconfirm )
2021-11-24 19:56:39 -03:00
gnub = str ( gnua )
2022-02-12 14:26:59 +00:00
output = render (
str ( f ' { gnb1 } BTC ' ) , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
2021-11-24 19:56:39 -03:00
print ( """ ---------------------------------------------------------------
{ }
2021-11-22 14:48:21 -03:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - """ .format(output))
2021-11-24 19:56:39 -03:00
print ( " Unconfrmed: \u001b [31;1m {} BTC \033 [0;37;40m " . format ( gnub . replace ( " \n " , " " ) ) )
print ( " --------------------------------------------------------------- " )
print ( " \033 [1;30;47m " )
qr . add_data ( gna1 . replace ( " \n " , " " ) )
qr . print_ascii ( )
print ( " \033 [0;37;40m " )
qr . clear ( )
print ( " \x1b [?25l " + " Bitcoin Address: " + gna1 )
gna . close ( )
a = gnub
b = gnb1
getbal = " getbalance "
while True :
x = a
z = b
2026-04-02 17:35:03 -03:00
gnbb = _run_btc ( getbal )
2021-11-24 19:56:39 -03:00
gnb1 = str ( gnbb )
2026-04-02 17:35:03 -03:00
gnaaq = _run_btc ( getfeemempool )
2021-11-24 07:47:40 -03:00
gna1q = str ( gnaaq )
2026-04-02 17:35:03 -03:00
gnua = _run_btc ( getunconfirm )
2021-11-24 19:56:39 -03:00
gnub = str ( gnua )
2021-11-24 07:47:40 -03:00
d = json . loads ( gna1q )
2021-11-24 19:56:39 -03:00
if gnub > a or gnb1 > b :
clear ( )
blogo ( )
close ( )
getadd = " getnewaddress "
2026-04-02 17:35:03 -03:00
gnaa = _run_btc ( getadd )
2021-11-24 19:56:39 -03:00
gna1 = str ( gnaa )
2022-02-12 14:29:58 +00:00
output = render (
str ( f ' { gnb1 } BTC ' ) ,
colors = [ ' yellow ' ] ,
align = ' left ' ,
font = ' tiny ' ,
)
2021-11-24 19:56:39 -03:00
print ( """ ---------------------------------------------------------------
{ }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - """ .format(output))
print ( " Unconfrmed: \u001b [31;1m {} BTC \033 [0;37;40m " . format ( gnub . replace ( " \n " , " " ) ) )
print ( " --------------------------------------------------------------- " )
getfeemempool = " getmempoolinfo "
2026-04-02 17:35:03 -03:00
gnaaq = _run_btc ( getfeemempool )
2021-11-24 19:56:39 -03:00
gna1q = str ( gnaaq )
d = json . loads ( gna1q )
print ( " \033 [1;30;47m " )
qr . add_data ( gna1 . replace ( " \n " , " " ) )
qr . print_ascii ( )
print ( " \033 [0;37;40m " )
qr . clear ( )
print ( " \x1b [?25l " + " Bitcoin Address: " + gna1 )
gna . close ( )
a = gnub
b = gnb1
2021-12-02 08:30:19 -03:00
nn = float ( d [ ' total_fee ' ] ) / float ( d [ ' bytes ' ] ) * float ( 100000000 )
2022-09-27 19:39:22 +00:00
print ( f " \n \033 [ALive Fee: ~ { nn } sat/vB \033 [A " )
2021-12-02 08:30:19 -03:00
t . sleep ( 10 )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Wallet menu error: %s " , e )
2021-11-24 19:56:39 -03:00
walletmenuLOCALOnchainONLY ( )
2021-11-24 07:47:40 -03:00
def gettransactionsOnchain ( ) :
2021-11-24 19:56:39 -03:00
try :
2022-03-07 22:57:31 +00:00
listtxs = " listunspent "
2021-11-24 19:56:39 -03:00
while True :
clear ( )
blogo ( )
close ( )
2026-04-02 17:35:03 -03:00
gnaa = _run_btc ( listtxs )
2021-11-24 19:56:39 -03:00
gna1 = str ( gnaa )
d = json . loads ( gna1 )
2026-04-01 10:24:47 -03:00
gnbb = subprocess . run ( [ path [ ' bitcoincli ' ] , ' getbalance ' ] , capture_output = True , text = True ) . stdout
2021-11-24 19:56:39 -03:00
gnb1 = str ( gnbb )
2021-11-24 22:48:14 -03:00
sort_order = sorted ( d , key = lambda x : x [ ' confirmations ' ] , reverse = True )
2022-03-08 23:03:11 +00:00
output = render ( " transactions " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
2021-11-26 17:23:28 -03:00
print ( output )
2021-11-24 19:56:39 -03:00
for q in sort_order :
2022-03-08 23:03:11 +00:00
print (
2022-09-27 19:39:22 +00:00
(
(
(
(
f " TxID: \u001b [38;5;40m { str ( q [ ' txid ' ] ) } \033 [0;37;40m | Amount: "
+ f " \u001b [38;5;202m { str ( q [ ' amount ' ] ) } BTC \033 [0;37;40m "
)
+ " | "
)
+ " Conf: "
)
+ f " \u001b [33;1m { str ( q [ ' confirmations ' ] ) } \033 [0;37;40m "
2022-03-08 23:03:11 +00:00
)
)
2021-11-24 19:56:39 -03:00
2022-09-27 19:39:22 +00:00
2021-11-24 19:56:39 -03:00
print ( " \n Total Balance: \u001b [38;5;202m {} BTC \033 [0;37;40m " . format ( gnb1 . replace ( " \n " , " " ) ) )
input ( " \n Refresh... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Wallet menu error: %s " , e )
2021-11-24 19:56:39 -03:00
walletmenuLOCALOnchainONLY ( )
2022-12-24 11:24:44 -03:00
def dumppk ( ) : #
2022-12-23 02:42:46 +01:00
try :
clear ( )
blogo ( )
output = render ( " Dumpprivkey " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
print ( output )
responseC = input ( " Bitcoin Address: " )
2024-10-17 20:46:40 +02:00
bitcoincli = " dumpprivkey "
2026-04-02 17:35:03 -03:00
_run_btc ( bitcoincli + responseC )
2022-12-23 02:42:46 +01:00
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Wallet menu error: %s " , e )
2022-12-23 02:42:46 +01:00
walletmenuLOCALOnchainONLY ( )
2022-12-24 11:24:44 -03:00
2022-12-25 03:32:46 +01:00
def wallmenu ( ) : #
try :
clear ( )
blogo ( )
2023-01-08 16:19:13 +01:00
output = render ( " Your Wallet info " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
2022-12-25 03:32:46 +01:00
print ( output )
bitcoincli = " getwalletinfo "
2026-04-02 17:35:03 -03:00
_run_btc ( bitcoincli )
2022-12-25 03:32:46 +01:00
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Wallet menu error: %s " , e )
2022-12-25 03:32:46 +01:00
walletmenuLOCALOnchainONLY ( )
2023-09-20 19:40:35 -03:00
2023-01-08 16:19:13 +01:00
def inffmenu ( ) : #
try :
clear ( )
blogo ( )
output = render ( " Address info " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
print ( output )
responseC = input ( " Bitcoin Address: " )
2024-10-17 20:46:40 +02:00
bitcoincli = " getaddressinfo "
2026-04-02 17:35:03 -03:00
_run_btc ( bitcoincli + responseC )
2023-01-08 16:19:13 +01:00
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Wallet menu error: %s " , e )
2023-01-08 16:19:13 +01:00
walletmenuLOCALOnchainONLY ( )
def miningmenu ( ) : #
try :
clear ( )
blogo ( )
output = render ( " Minning info " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
print ( output )
bitcoincli = " getmininginfo "
2026-04-02 17:35:03 -03:00
_run_btc ( bitcoincli )
2023-01-08 16:19:13 +01:00
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Wallet menu error: %s " , e )
2023-01-08 16:19:13 +01:00
walletmenuLOCALOnchainONLY ( )
2021-11-22 14:48:21 -03:00
2020-05-30 21:46:11 -03:00
def getblockcount ( ) : # get access to bitcoin-cli with the command getblockcount
bitcoincli = " getblockcount "
2026-04-02 17:35:03 -03:00
_run_btc ( bitcoincli )
2020-05-30 21:46:11 -03:00
2020-11-15 20:24:59 -03:00
def getbestblockhash ( ) : # get access to bitcoin-cli with the command getblockcount
bitcoincli = " getbestblockhash "
2026-04-02 17:35:03 -03:00
_run_btc ( bitcoincli )
2020-11-15 20:24:59 -03:00
2020-06-10 19:02:49 -03:00
def getgenesis ( ) : # get and decode Genesis block
2022-03-08 23:03:11 +00:00
output = render ( " genesis " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
2021-11-28 14:32:02 -03:00
print ( output )
2020-05-30 21:46:11 -03:00
bitcoincli = " getblock 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f 0 | xxd -r -p | hexyl -n 256 "
2026-04-02 17:35:03 -03:00
_run_btc ( bitcoincli )
2020-06-10 19:02:49 -03:00
2026-04-02 14:28:30 -03:00
def _is_hex ( s ) :
""" Validate that a string is hexadecimal only (safe for CLI args). """
import re
return bool ( re . match ( r ' ^[0-9a-fA-F]+$ ' , s ) )
2022-03-12 02:05:30 +00:00
2026-04-02 14:28:30 -03:00
def readHexBlock ( ) : # Hex Decoder using Hexyl on local node
hexa = input ( " Add the Block Hash you want to decode: " ) . strip ( )
blocknumber = input ( " Add the Block number: " ) . strip ( )
if not _is_hex ( hexa ) or not blocknumber . isdigit ( ) :
print ( " \n Invalid input. Block hash must be hex, number must be numeric. \n " )
return
cli = shlex . split ( path [ ' bitcoincli ' ] )
raw = subprocess . run ( cli + [ " getblock " , hexa , blocknumber ] , capture_output = True ) . stdout
xxd = subprocess . run ( [ " xxd " , " -r " , " -p " ] , input = raw , capture_output = True )
subprocess . run ( [ " hexyl " , " -n " , " 256 " ] , input = xxd . stdout )
2020-06-10 19:02:49 -03:00
2020-05-30 21:46:11 -03:00
def readHexTx ( ) : # Hex Decoder using Hexyl on an external node
2026-04-02 14:28:30 -03:00
hexa = input ( " Add the Transaction ID you want to decode: " ) . strip ( )
if not _is_hex ( hexa ) :
print ( " \n Invalid input. Transaction ID must be hexadecimal. \n " )
return
cli = shlex . split ( path [ ' bitcoincli ' ] )
raw = subprocess . run ( cli + [ " getrawtransaction " , hexa ] , capture_output = True ) . stdout
xxd = subprocess . run ( [ " xxd " , " -r " , " -p " ] , input = raw , capture_output = True )
subprocess . run ( [ " hexyl " , " -n " , " 256 " ] , input = xxd . stdout )
2020-06-10 19:02:49 -03:00
2020-05-30 21:46:11 -03:00
def tmp ( ) :
t . sleep ( 15 )
2020-05-18 22:25:55 -03:00
def console ( ) : # get into the console from bitcoin-cli
2021-11-24 20:52:59 -03:00
print ( " \t \033 [0;37;40mThis is \033 [1;33;40mBitcoin-cli ' s \033 [0;37;40mconsole. Type ' help ' for more information. \n \n " )
2020-05-18 22:25:55 -03:00
while True :
2021-11-24 21:20:20 -03:00
cle = input ( " \u001b [38;5;202m₿ console >: \033 [0;37;40m " )
2021-11-24 22:48:14 -03:00
if cle == " clear " :
clear ( )
blogo ( )
sysinfo ( )
close ( )
console ( )
2026-04-02 17:35:03 -03:00
lsd0 = _run_btc ( cle )
2020-05-27 08:59:36 -03:00
lsd1 = str ( lsd0 )
print ( lsd1 )
2020-05-29 11:52:29 -03:00
def screensv ( ) :
try :
doit ( )
except ( KeyboardInterrupt , SystemExit ) :
matrix . close ( )
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-05-29 11:52:29 -03:00
menu ( )
2020-06-24 17:08:28 -03:00
2020-06-04 14:28:45 -03:00
#------------------------------------------------------
2020-05-06 17:04:20 -03:00
2024-07-29 18:21:21 -03:00
2024-07-26 17:06:38 -03:00
def some_other_function ( ) :
# Aquí puedes llamar a la función de node_monitor
run_display_node_info ( )
2024-07-26 11:39:24 -03:00
def execute_visualizer ( ) :
2026-04-02 09:23:09 -03:00
import block_viz
block_viz . interactive_visualizer ( use_cli = True )
2024-07-26 11:39:24 -03:00
2020-05-09 18:22:43 -03:00
def artist ( ) : # here we convert the result of the command 'getblockcount' on a random art design
2020-09-24 21:08:56 -03:00
while True :
try :
clear ( )
close ( )
design ( )
2026-04-01 15:22:50 -03:00
except KeyboardInterrupt :
break
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Loop interrupted: %s " , e )
2020-10-16 17:37:07 -03:00
break
2020-10-17 23:16:35 -03:00
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
def artist ( ) :
""" Launch the enhanced block clock. """
from clock import run_clock
mode = " remote " if not path . get ( " bitcoincli " ) else " local "
run_clock ( mode , path , cfg . settings_clock )
2020-12-25 08:41:51 -03:00
2021-01-28 22:58:08 -03:00
2020-05-16 00:21:47 -03:00
#--------------------------------- Hex Block Decoder Functions -------------------------------------
2020-05-25 19:35:24 -03:00
def getrawtx ( ) : # show confirmatins from transactions
while True :
try :
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-05-25 19:35:24 -03:00
close ( )
2020-11-15 20:24:59 -03:00
tx = input ( " Insert your TxID: " )
2020-05-27 17:34:26 -03:00
if tx == " 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b " :
print ( """ \t \t \n \033 [1;35;40mThis transaction it ' s the first one of the Bitcoin Blockchain on Block 0 by Satoshi Nakamoto.
You can decode that block in HEX and see what ' s inside. \033 [0;37;40m " " " )
else :
2020-06-25 18:53:52 +00:00
bitcoincli = " getrawtransaction "
2026-04-02 17:35:03 -03:00
lsd0 = _run_btc ( bitcoincli + tx + " 1 " )
2020-05-27 17:34:26 -03:00
lsd1 = str ( lsd0 )
lsda = lsd1 . split ( ' , ' )
lsdb = lsda [ - 3 ]
2020-06-10 19:02:49 -03:00
lsdc = str ( lsdb )
2022-09-27 19:39:22 +00:00
print (
" \033 [0;37;40mTransaction "
+ f " \033 [1;31;40m { tx } \033 [0;37;40m "
+ " has: \n "
+ f " \033 [1;31;40m { lsdc } \033 [0;37;40m "
)
2020-05-27 17:34:26 -03:00
tmp ( )
lsd . close ( )
2020-11-29 23:53:05 +00:00
input ( " Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Loop interrupted: %s " , e )
2020-11-15 20:24:59 -03:00
break
2020-08-25 20:08:40 -03:00
def runthenumbers ( ) :
bitcoincli = " gettxoutsetinfo "
2026-04-02 17:35:03 -03:00
_run_btc ( bitcoincli )
2020-08-25 20:08:40 -03:00
input ( " \n Continue... " )
2020-09-25 19:56:40 -03:00
def countdownblock ( ) :
2026-04-02 17:35:03 -03:00
block = _run_btc ( " getblockcount " )
2020-09-25 19:56:40 -03:00
b = block
2020-12-06 22:28:13 -03:00
try :
a = input ( " Insert your block target: " )
clear ( )
blogo ( )
print ( """
- - - - - - - - - - - - - - - - - - - - - BLOCK { } COUNTDOWN - - - - - - - - - - - - - - - - - - - - -
""" .format(a))
n = int ( b )
print ( " \n CountDown: " , b )
q = int ( a ) - int ( b )
2022-02-17 00:54:00 +00:00
print ( f ' Remaining: { str ( q ) } ' + " Blocks \n " )
2020-12-06 22:28:13 -03:00
while a > b :
try :
2026-04-02 17:35:03 -03:00
block = _run_btc ( " getblockcount " )
2020-12-06 22:28:13 -03:00
b = block
if a == b :
break
elif n != int ( b ) :
print ( " CountDown: " , b )
q = int ( a ) - int ( b )
2022-02-17 00:54:00 +00:00
print ( f ' Remaining: { str ( q ) } ' + " Blocks \n " )
2020-12-06 22:28:13 -03:00
n = int ( b )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Loop interrupted: %s " , e )
2020-09-25 19:56:40 -03:00
break
2022-02-17 00:54:00 +00:00
print ( f ' #RunTheNumbers { str ( a ) } PyBLOCK ' )
2020-12-06 22:28:13 -03:00
input ( " \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2020-12-06 22:28:13 -03:00
menuSelection ( )
2020-12-07 20:56:35 -03:00
2020-12-07 15:59:19 -03:00
def countdownblockConn ( ) :
b = rpc ( ' getblockcount ' )
c = str ( b )
try :
a = int ( input ( " Insert your block target: " ) )
clear ( )
blogo ( )
print ( """
- - - - - - - - - - - - - - - - - - - - - BLOCK { } COUNTDOWN - - - - - - - - - - - - - - - - - - - - -
""" .format(a))
print ( " \n CountDown: " , int ( c ) )
n = int ( c )
2022-03-08 23:03:11 +00:00
q = a - int ( c )
2022-02-17 00:54:00 +00:00
print ( f ' Remaining: { str ( q ) } ' + " Blocks \n " )
2020-12-07 15:59:19 -03:00
while a > int ( c ) :
try :
b = rpc ( ' getblockcount ' )
c = str ( b )
if a == c :
break
elif n != int ( c ) :
print ( " CountDown: " , c )
2022-03-08 23:03:11 +00:00
q = a - int ( c )
2022-02-17 00:54:00 +00:00
print ( f ' Remaining: { str ( q ) } ' + " Blocks \n " )
2020-12-07 15:59:19 -03:00
n = int ( c )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Loop interrupted: %s " , e )
2020-12-07 15:59:19 -03:00
break
2022-02-17 00:54:00 +00:00
print ( f ' #RunTheNumbers { a } PyBLOCK ' )
2020-12-07 15:59:19 -03:00
input ( " \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2020-12-07 15:59:19 -03:00
menuSelection ( )
2020-09-26 22:55:48 -03:00
2020-12-07 20:56:35 -03:00
2020-09-26 22:55:48 -03:00
def localHalving ( ) :
2026-04-02 17:35:03 -03:00
block_count = int ( _run_btc ( " getblockcount " ) . strip ( ) )
2024-04-12 16:13:38 -03:00
# Suponemos 64 halvings, aunque técnicamente podrían ser más
max_halvings = 64
blocks_per_halving = 210000
halving_interval = timedelta ( days = 365 * 4 ) # 4 años entre cada halving
next_halving_date = datetime ( 2024 , 4 , 20 ) # Fecha del próximo halving conocido
halving_blocks = [ ( blocks_per_halving * i , next_halving_date + halving_interval * ( i - ( block_count / / blocks_per_halving + 1 ) ) ) for i in range ( 1 , max_halvings + 1 ) ]
block_messages = [ ]
for index , ( halving_point , halving_date ) in enumerate ( halving_blocks , start = 1 ) :
blocks_to_halving = halving_point - block_count
if block_count > = halving_point :
status = f " \033 [1;32;40mCOMPLETE { halving_date . year } \033 [0;37;40m "
blocks_to_halving = 0
else :
status = f " \033 [1;35;40mPENDING { halving_date . year } \033 [0;37;40m "
block_messages . append ( f " { index } th Halving: in { blocks_to_halving } Blocks { status } , Est. Date: { halving_date . strftime ( ' % Y- % m- %d ' ) } " )
halving_info = " \n " . join ( block_messages )
q = f """
2020-10-12 22:36:56 -03:00
\033 [ 0 ; 37 ; 40 m - - - - - - - - - - - - - - - - - - - HALVING CLOCK - - - - - - - - - - - - - - - - - - -
2020-09-26 22:55:48 -03:00
2024-04-12 16:13:38 -03:00
{ halving_info }
2020-09-26 22:55:48 -03:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2024-04-12 16:13:38 -03:00
"""
2020-09-26 22:55:48 -03:00
print ( q )
input ( " \n Continue... " )
2022-10-03 22:45:05 +02:00
2024-04-12 16:13:38 -03:00
2022-10-03 22:45:05 +02:00
def epoch ( ) :
2023-09-21 17:27:35 -03:00
while True :
try :
clear ( )
blogo ( )
2023-09-22 17:34:51 +02:00
output = render ( " BITCOIN EPOCH CLOCK " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
2023-09-21 22:33:41 +02:00
print ( output )
2026-04-02 17:35:03 -03:00
block = _run_btc ( " getblockcount " )
2023-09-21 17:27:35 -03:00
b = block
c = b
oneh = 0 + int ( c ) / 2016
2022-12-20 10:14:37 -03:00
2023-09-21 17:27:35 -03:00
q = """
\033 [ 0 ; 37 ; 40 m - - - - - - - - - - - - - - - - - - - EPOCH CLOCK - - - - - - - - - - - - - - - - - - -
2022-10-03 22:45:05 +02:00
2023-09-21 17:27:35 -03:00
Epoch { } Status { }
2022-12-20 10:14:37 -03:00
2023-09-21 17:27:35 -03:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
""" .format( " 0 " if int(c) == 6930000 else oneh, " \033 [1;32;40mON \033 [0;37;40m " )
print ( q )
t . sleep ( 2 )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Loop interrupted: %s " , e )
2023-09-24 20:05:06 +02:00
break
2022-10-03 22:45:05 +02:00
2020-05-16 00:21:47 -03:00
#--------------------------------- End Hex Block Decoder Functions -------------------------------------
2020-05-24 14:15:12 -03:00
2021-01-28 22:58:08 -03:00
def pdfconvert ( ) :
path = { " ip_port " : " " , " rpcuser " : " " , " rpcpass " : " " , " bitcoincli " : " " }
2026-04-02 14:38:18 -03:00
with open ( " config/bclock.conf " , " r " ) as f : pathv = json . load ( f )
2021-01-28 22:58:08 -03:00
path = pathv # Copy the variable pathv to 'path'
2022-03-13 20:58:54 -03:00
if not os . path . isfile ( " config/bitcoin.pdf " ) :
2021-01-28 22:58:08 -03:00
clear ( )
blogo ( )
close ( )
print ( """
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
The Bitcoin Whitepaper
is not in this
directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
""" )
a = input ( " Do you want to download it from the Blockchain? Y/n: " )
if a in [ " y " , " Y " ] :
clear ( )
blogo ( )
close ( )
print ( """
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
You are going to
download the
Whitepaper from
the Blockchain
This file will
be save in the
main PyBLOCK
folder as
bitcoin . pdf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
""" )
input ( " Continue... " )
2026-04-02 14:28:30 -03:00
# Static pipeline to extract the Bitcoin whitepaper from the blockchain
# No user input — all values are hardcoded constants
2022-09-14 11:51:55 -03:00
bitcoincli = """ seq 0 947 | (while read -r n; do bitcoin-cli gettxout 54e48e5f5c656b26c3bca14a8c95aa583d07ebe84dde3b7dd4a78f4e4186e713 $n | jq -r ' .scriptPubKey.asm ' | awk ' { print $2 $3 $4 } ' ; done) | tr -d ' \n ' | cut -c 17-368600 | xxd -r -p > bitcoin.pdf """
2026-04-02 14:28:30 -03:00
subprocess . run ( bitcoincli , shell = True ) # nosemgrep: shell-true-static-command
2021-01-28 22:58:08 -03:00
clear ( )
blogo ( )
close ( )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " pdf2txt.py " , " bitcoin.pdf " ] )
2021-01-28 22:58:08 -03:00
input ( " Continue... " )
else :
clear ( )
blogo ( )
close ( )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " pdf2txt.py " , " bitcoin.pdf " ] )
2021-01-28 22:58:08 -03:00
input ( " Continue... " )
2023-09-20 19:40:35 -03:00
2023-01-24 21:53:16 +01:00
def bip39convert ( ) :
2023-03-26 22:04:57 +02:00
try :
clear ( )
blogo ( )
output = render (
2023-03-26 22:18:18 +02:00
" TinySeed " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
2023-03-26 22:04:57 +02:00
)
if os . path . isdir ( ' TinySeed ' ) :
print ( " ...pass... " )
else : # Check if the file 'bclock.conf' is in the same folder
2026-04-01 12:51:41 -03:00
os . makedirs ( " TinySeed " , exist_ok = True )
subprocess . run ( [ " wget " , " https://gist.githubusercontent.com/odudex/a29de0c91c4010a6b4c565d6f29fa0c6/raw/0349754c1b3f218ff61302acd1f346e0027ba215/TinySeed.py " ] , cwd = " TinySeed " )
2023-03-26 22:04:57 +02:00
clear ( )
blogo ( )
print ( output )
Security audit round 2: eliminate shell=True, mask secrets, fix race conditions
- Replace all shell=True subprocess calls with Python-native processing
(nodeconnection.py, SPV/nodeconnection.py, SPV/ppi.py)
- Mask sensitive inputs (private keys, passwords, tokens) with getpass
- Add threading.Lock to block_explorer.py shared state
- Use json.loads() instead of fragile string splitting in apisnd.py
- Add path validation before file open in apisnd.py
- Replace random.randint with secrets.randbelow for mining nonces
- Fix destructive exception handlers in clone.py and feed.py
- Replace bare except clauses with specific exceptions + logging
- Remove unused imports (psutil, xmltodict, block_visualizer, base64, say)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:15:59 -03:00
responseC = getpass . getpass ( " Words to Tiny Seed: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " TinySeed.py " , responseC ] , cwd = " TinySeed " )
2023-03-26 22:04:57 +02:00
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2023-03-26 22:04:57 +02:00
menuSelection ( )
2023-01-27 20:38:47 +01:00
2020-12-07 20:56:35 -03:00
#--------------------------------- NYMs -----------------------------------
def robotNym ( ) :
try :
if path [ ' bitcoincli ' ] :
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-12-07 20:56:35 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-12-07 20:56:35 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-12-07 20:56:35 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
hash = alias [ ' identity_pubkey ' ]
rh = Robohash ( hash )
rh . assemble ( roboset = ' set1 ' )
with open ( " file.png " , " wb " ) as f :
rh . img . save ( f , format = " png " )
img_path = open ( " file.png " , " rb " )
img = Image . open ( img_path )
h = 40
w = int ( ( img . width / img . height ) * 90 )
img = img . resize ( ( w , h ) , Image . ANTIALIAS )
img_arr = np . asarray ( img )
h , w , c = img_arr . shape
for x in range ( h ) :
for y in range ( w ) :
pix = img_arr [ x ] [ y ]
print ( get_color ( pix [ 0 ] , pix [ 1 ] , pix [ 2 ] ) , sep = ' ' , end = ' ' )
print ( )
image = " \n \t \t \t \t \t \u001b [31;1mNode \u001b [38;5;93mNym \033 [0;37;40m \n " + " \n \t \u001b [33;1m " + alias [ ' identity_pubkey ' ] + " \033 [0;37;40m "
print ( image )
input ( " \n \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2020-12-07 20:56:35 -03:00
menuSelection ( )
2020-12-12 18:48:14 -03:00
2022-04-12 23:03:35 +02:00
#---------------------------------Sat Sale----------------------------------
def callGitSatSale ( ) :
if not os . path . isdir ( ' SatSale ' ) :
2026-04-01 12:51:41 -03:00
subprocess . run ( [ " git " , " clone " , " https://github.com/nickfarrow/SatSale.git " ] )
2026-04-01 12:21:08 -03:00
subprocess . run ( [ " python3 " , " satsale.py " ] , cwd = " SatSale " )
2022-12-20 10:14:37 -03:00
2022-09-27 21:38:08 +02:00
#---------------------------------Cashu----------------------------------
def callGitCashu ( ) :
if not os . path . isdir ( ' Cashu ' ) :
2026-04-01 12:51:41 -03:00
subprocess . run ( [ " pip3 " , " install " , " cashu " ] )
os . makedirs ( " Cashu " , exist_ok = True )
2026-04-01 12:21:08 -03:00
subprocess . run ( [ " cashu " ] , cwd = " Cashu " )
2022-12-20 10:14:37 -03:00
2022-10-03 19:28:06 +02:00
#-----------------------------Block Templates--------------------------------
def blockTmpConn ( ) :
try :
conn = """ curl -s https://miningpool.observer/template-and-block | html2text | grep " Template and Block for " -A 13 """
2026-04-02 17:35:03 -03:00
a = subprocess . run ( shlex . split ( conn ) , capture_output = True , text = True ) . stdout
2022-10-03 19:28:06 +02:00
clear ( )
blogo ( )
closed ( )
output = render ( " Templates and Blocks " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
print ( output )
print ( a )
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2022-10-03 19:28:06 +02:00
2022-12-20 10:14:37 -03:00
#-----------------------------END Block Templates--------------------------------
2024-07-10 18:10:32 +02:00
#---------------------------------ocean pool----------------------------------
2024-07-18 22:54:21 -03:00
2024-07-10 18:10:32 +02:00
def oceanH ( ) : # show srings
try :
clear ( )
blogo ( )
output = render (
" Ocean Hashrate " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
print ( output )
responseC = input ( " Your Bitcoin Address: " )
2026-04-01 12:10:49 -03:00
cmd = f """ curl -s ' https://ocean.xyz/data/csv/hashrates/worker/ { responseC } ' | html2text """
2026-04-02 17:35:03 -03:00
a = subprocess . run ( shlex . split ( cmd ) , capture_output = True , text = True ) . stdout
2024-07-10 18:10:32 +02:00
print ( " \n Address: " + responseC )
2024-07-16 17:20:12 +02:00
print ( " \n Hashrate: \n " + a )
2024-07-10 18:10:32 +02:00
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2024-07-10 18:10:32 +02:00
def oceanB ( ) : # show srings
try :
clear ( )
blogo ( )
output = render (
" Ocean Blocks " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
print ( output )
2026-04-01 12:10:49 -03:00
cmd = f """ curl -s ' https://ocean.xyz/data/json/blocksfound ' | jq -C .[] """
2026-04-02 17:35:03 -03:00
a = subprocess . run ( shlex . split ( cmd ) , capture_output = True , text = True ) . stdout
2024-07-16 17:20:12 +02:00
print ( " \n Blocks: \n " + a )
2024-07-10 18:10:32 +02:00
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2024-07-10 18:10:32 +02:00
def oceanE ( ) : # show srings
try :
clear ( )
blogo ( )
output = render (
" Ocean Earnings " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
print ( output )
responseC = input ( " Your Bitcoin Address: " )
2026-04-01 12:10:49 -03:00
cmd = f """ curl -s ' https://ocean.xyz/template/workers/earningscards?user= { responseC } ' | html2text """
2026-04-02 17:35:03 -03:00
a = subprocess . run ( shlex . split ( cmd ) , capture_output = True , text = True ) . stdout
2024-07-10 18:10:32 +02:00
print ( " \n Address: " + responseC )
2024-07-16 17:20:12 +02:00
print ( " \n Earnings: \n " + a )
2024-07-10 18:10:32 +02:00
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2024-07-10 18:10:32 +02:00
#---------------------------------ocean pool end----------------------------------
2022-12-20 10:14:37 -03:00
2020-12-12 18:48:14 -03:00
#---------------------------------Warden Terminal----------------------------------
2024-07-10 18:10:32 +02:00
2020-12-12 18:48:14 -03:00
def callGitWardenTerminal ( ) :
2020-12-12 21:49:02 +00:00
if not os . path . isdir ( ' warden_terminal ' ) :
2026-04-01 12:51:41 -03:00
subprocess . run ( [ " git " , " clone " , " https://github.com/pxsocs/warden_terminal.git " ] )
2026-04-01 12:21:08 -03:00
subprocess . run ( [ " python3 " , " node_warden.py " ] , cwd = " warden_terminal " )
2022-12-20 10:14:37 -03:00
2022-12-19 16:02:43 +01:00
#---------------------------------Nostr Terminal----------------------------------
2022-12-31 00:01:25 +01:00
def callGitNostrLinTerminal ( ) :
2022-12-19 16:02:43 +01:00
try :
clear ( )
blogo ( )
output = render (
2022-12-31 00:01:25 +01:00
" Nostr Console Linux " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
2022-12-19 16:02:43 +01:00
)
2022-12-20 10:14:37 -03:00
if os . path . isdir ( ' nostr_console_pyblock ' ) :
2026-04-01 12:51:41 -03:00
subprocess . run ( [ " rm " , " -rf " , " nostr_console_linux_amd64 " ] , cwd = " nostr_console_pyblock " )
subprocess . run ( [ " wget " , " https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_linux_amd64 " ] , cwd = " nostr_console_pyblock " )
subprocess . run ( [ " chmod " , " +x " , " nostr_console_linux_amd64 " ] , cwd = " nostr_console_pyblock " )
2022-12-20 10:14:37 -03:00
else : # Check if the file 'bclock.conf' is in the same folder
2026-04-01 12:51:41 -03:00
os . makedirs ( " nostr_console_pyblock " , exist_ok = True )
subprocess . run ( [ " wget " , " https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_linux_amd64 " ] , cwd = " nostr_console_pyblock " )
subprocess . run ( [ " chmod " , " +x " , " nostr_console_linux_amd64 " ] , cwd = " nostr_console_pyblock " )
2022-12-20 10:14:37 -03:00
clear ( )
blogo ( )
2022-12-19 16:02:43 +01:00
print ( output )
Security audit round 2: eliminate shell=True, mask secrets, fix race conditions
- Replace all shell=True subprocess calls with Python-native processing
(nodeconnection.py, SPV/nodeconnection.py, SPV/ppi.py)
- Mask sensitive inputs (private keys, passwords, tokens) with getpass
- Add threading.Lock to block_explorer.py shared state
- Use json.loads() instead of fragile string splitting in apisnd.py
- Add path validation before file open in apisnd.py
- Replace random.randint with secrets.randbelow for mining nonces
- Fix destructive exception handlers in clone.py and feed.py
- Replace bare except clauses with specific exceptions + logging
- Remove unused imports (psutil, xmltodict, block_visualizer, base64, say)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:15:59 -03:00
responseC = getpass . getpass ( " Paste your PrivateKey: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./nostr_console_linux_amd64 " , " -k " , responseC , " -l " ] , cwd = " nostr_console_pyblock " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2022-12-19 15:18:44 -03:00
menuSelection ( )
2023-09-20 19:40:35 -03:00
2022-12-31 00:01:25 +01:00
def callGitNostrLinarmTerminal ( ) :
2022-12-19 16:02:43 +01:00
try :
clear ( )
blogo ( )
output = render (
2022-12-31 00:01:25 +01:00
" Nostr Console Linux " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
2022-12-19 16:02:43 +01:00
)
2022-12-20 10:14:37 -03:00
if os . path . isdir ( ' nostr_console_pyblock ' ) :
2026-04-01 12:51:41 -03:00
subprocess . run ( [ " rm " , " -rf " , " nostr_console_linux_arm64 " ] , cwd = " nostr_console_pyblock " )
subprocess . run ( [ " wget " , " https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_linux_arm64 " ] , cwd = " nostr_console_pyblock " )
subprocess . run ( [ " chmod " , " +x " , " nostr_console_linux_arm64 " ] , cwd = " nostr_console_pyblock " )
2022-12-20 10:14:37 -03:00
else : # Check if the file 'bclock.conf' is in the same folder
2026-04-01 12:51:41 -03:00
os . makedirs ( " nostr_console_pyblock " , exist_ok = True )
subprocess . run ( [ " wget " , " https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_linux_arm64 " ] , cwd = " nostr_console_pyblock " )
subprocess . run ( [ " chmod " , " +x " , " nostr_console_linux_arm64 " ] , cwd = " nostr_console_pyblock " )
2022-12-20 10:14:37 -03:00
clear ( )
blogo ( )
2022-12-19 16:02:43 +01:00
print ( output )
Security audit round 2: eliminate shell=True, mask secrets, fix race conditions
- Replace all shell=True subprocess calls with Python-native processing
(nodeconnection.py, SPV/nodeconnection.py, SPV/ppi.py)
- Mask sensitive inputs (private keys, passwords, tokens) with getpass
- Add threading.Lock to block_explorer.py shared state
- Use json.loads() instead of fragile string splitting in apisnd.py
- Add path validation before file open in apisnd.py
- Replace random.randint with secrets.randbelow for mining nonces
- Fix destructive exception handlers in clone.py and feed.py
- Replace bare except clauses with specific exceptions + logging
- Remove unused imports (psutil, xmltodict, block_visualizer, base64, say)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:15:59 -03:00
responseC = getpass . getpass ( " Paste your PrivateKey: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./nostr_console_linux_arm64 " , " -k " , responseC , " -l " ] , cwd = " nostr_console_pyblock " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2022-12-19 15:18:44 -03:00
menuSelection ( )
2023-09-20 19:40:35 -03:00
2022-12-31 00:01:25 +01:00
def callGitNostrMacTerminal ( ) :
2022-12-19 16:02:43 +01:00
try :
clear ( )
blogo ( )
output = render (
2022-12-31 00:01:25 +01:00
" Nostr Console macOS " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
2022-12-19 16:02:43 +01:00
)
2022-12-20 10:14:37 -03:00
if os . path . isdir ( ' nostr_console_pyblock ' ) :
2026-04-01 12:51:41 -03:00
subprocess . run ( [ " rm " , " -rf " , " nostr_console_macos_amd64 " ] , cwd = " nostr_console_pyblock " )
subprocess . run ( [ " wget " , " https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_macos_amd64 " ] , cwd = " nostr_console_pyblock " )
2022-12-20 10:14:37 -03:00
else : # Check if the file 'bclock.conf' is in the same folder
2026-04-01 12:51:41 -03:00
os . makedirs ( " nostr_console_pyblock " , exist_ok = True )
subprocess . run ( [ " wget " , " https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_macos_amd64 " ] , cwd = " nostr_console_pyblock " )
2022-12-20 10:14:37 -03:00
clear ( )
blogo ( )
2022-12-31 00:01:25 +01:00
2022-12-19 16:02:43 +01:00
print ( output )
Security audit round 2: eliminate shell=True, mask secrets, fix race conditions
- Replace all shell=True subprocess calls with Python-native processing
(nodeconnection.py, SPV/nodeconnection.py, SPV/ppi.py)
- Mask sensitive inputs (private keys, passwords, tokens) with getpass
- Add threading.Lock to block_explorer.py shared state
- Use json.loads() instead of fragile string splitting in apisnd.py
- Add path validation before file open in apisnd.py
- Replace random.randint with secrets.randbelow for mining nonces
- Fix destructive exception handlers in clone.py and feed.py
- Replace bare except clauses with specific exceptions + logging
- Remove unused imports (psutil, xmltodict, block_visualizer, base64, say)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:15:59 -03:00
responseC = getpass . getpass ( " Paste your PrivateKey: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./nostr_console_macos_amd64 " , " -k " , responseC , " -l " ] , cwd = " nostr_console_pyblock " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2022-12-19 15:18:44 -03:00
menuSelection ( )
2022-12-30 18:52:58 -03:00
2022-12-28 01:52:25 +01:00
def callGitNostrMacarmTerminal ( ) :
try :
clear ( )
blogo ( )
output = render (
2022-12-31 00:01:25 +01:00
" Nostr Console macOS " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
2022-12-28 01:52:25 +01:00
)
if os . path . isdir ( ' nostr_console_pyblock ' ) :
2026-04-01 12:51:41 -03:00
subprocess . run ( [ " rm " , " -rf " , " nostr_console_elf64 " ] , cwd = " nostr_console_pyblock " )
subprocess . run ( [ " wget " , " https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_elf64 " ] , cwd = " nostr_console_pyblock " )
subprocess . run ( [ " chmod " , " +x " , " nostr_console_elf64 " ] , cwd = " nostr_console_pyblock " )
2022-12-28 01:52:25 +01:00
else : # Check if the file 'bclock.conf' is in the same folder
2026-04-01 12:51:41 -03:00
os . makedirs ( " nostr_console_pyblock " , exist_ok = True )
subprocess . run ( [ " wget " , " https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_elf64 " ] , cwd = " nostr_console_pyblock " )
subprocess . run ( [ " chmod " , " +x " , " nostr_console_elf64 " ] , cwd = " nostr_console_pyblock " )
2022-12-28 01:52:25 +01:00
clear ( )
blogo ( )
print ( output )
Security audit round 2: eliminate shell=True, mask secrets, fix race conditions
- Replace all shell=True subprocess calls with Python-native processing
(nodeconnection.py, SPV/nodeconnection.py, SPV/ppi.py)
- Mask sensitive inputs (private keys, passwords, tokens) with getpass
- Add threading.Lock to block_explorer.py shared state
- Use json.loads() instead of fragile string splitting in apisnd.py
- Add path validation before file open in apisnd.py
- Replace random.randint with secrets.randbelow for mining nonces
- Fix destructive exception handlers in clone.py and feed.py
- Replace bare except clauses with specific exceptions + logging
- Remove unused imports (psutil, xmltodict, block_visualizer, base64, say)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:15:59 -03:00
responseC = getpass . getpass ( " Paste your PrivateKey: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./nostr_console_elf64 " , " -k " , responseC , " -l " ] , cwd = " nostr_console_pyblock " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2022-12-28 01:52:25 +01:00
menuSelection ( )
2023-09-20 19:40:35 -03:00
2022-12-31 00:01:25 +01:00
def callGitNostrWinTerminal ( ) :
2022-12-28 01:52:25 +01:00
try :
clear ( )
blogo ( )
output = render (
2022-12-31 00:01:25 +01:00
" Nostr Console Windows " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
2022-12-28 01:52:25 +01:00
)
if os . path . isdir ( ' nostr_console_pyblock ' ) :
2026-04-01 12:51:41 -03:00
subprocess . run ( [ " rm " , " -rf " , " nostr_console_windows_amd64.exe " ] , cwd = " nostr_console_pyblock " )
subprocess . run ( [ " wget " , " https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_windows_amd64.exe " ] , cwd = " nostr_console_pyblock " )
2022-12-28 01:52:25 +01:00
else : # Check if the file 'bclock.conf' is in the same folder
2026-04-01 12:51:41 -03:00
os . makedirs ( " nostr_console_pyblock " , exist_ok = True )
subprocess . run ( [ " wget " , " https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_windows_amd64.exe " ] , cwd = " nostr_console_pyblock " )
2022-12-28 01:52:25 +01:00
clear ( )
blogo ( )
print ( output )
Security audit round 2: eliminate shell=True, mask secrets, fix race conditions
- Replace all shell=True subprocess calls with Python-native processing
(nodeconnection.py, SPV/nodeconnection.py, SPV/ppi.py)
- Mask sensitive inputs (private keys, passwords, tokens) with getpass
- Add threading.Lock to block_explorer.py shared state
- Use json.loads() instead of fragile string splitting in apisnd.py
- Add path validation before file open in apisnd.py
- Replace random.randint with secrets.randbelow for mining nonces
- Fix destructive exception handlers in clone.py and feed.py
- Replace bare except clauses with specific exceptions + logging
- Remove unused imports (psutil, xmltodict, block_visualizer, base64, say)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:15:59 -03:00
responseC = getpass . getpass ( " Paste your PrivateKey: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./nostr_console_windows_amd64.exe " , " -k " , responseC , " -l " ] , cwd = " nostr_console_pyblock " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2022-12-28 01:52:25 +01:00
menuSelection ( )
2022-12-30 18:52:58 -03:00
2022-12-21 21:47:49 +01:00
def callGitNostrSeedTerminal ( ) :
try :
clear ( )
blogo ( )
output = render (
" Nostr BIP39 " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
if os . path . isdir ( ' nostr_seed ' ) :
print ( " ...pass... " )
else : # Check if the file 'bclock.conf' is in the same folder
2026-04-01 12:51:41 -03:00
os . makedirs ( " nostr_seed " , exist_ok = True )
subprocess . run ( [ " wget " , " https://gist.githubusercontent.com/odudex/93cfb5628b22f8675ab1939fd43133f4/raw/b48f047c0358a9ae50c2027106bdf5e37ee1fe5c/nostr_seed.py " ] , cwd = " nostr_seed " )
2022-12-21 21:47:49 +01:00
clear ( )
blogo ( )
print ( output )
2022-12-22 17:58:07 +01:00
responseC = input ( " Hex to BIP39 & BIP39 to Hex: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " nostr_seed.py " , responseC ] , cwd = " nostr_seed " )
2022-12-21 21:47:49 +01:00
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2022-12-22 09:16:03 -03:00
menuSelection ( )
2023-09-20 19:40:35 -03:00
2023-01-01 19:11:25 +01:00
def callGitNostrQRSeedTerminal ( ) :
try :
clear ( )
blogo ( )
output = render (
" QR " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
if os . path . isdir ( ' nostr_QRseed ' ) :
print ( " ...pass... " )
else : # Check if the file 'bclock.conf' is in the same folder
2026-04-01 12:51:41 -03:00
os . makedirs ( " nostr_QRseed " , exist_ok = True )
subprocess . run ( [ " wget " , " https://gist.githubusercontent.com/odudex/9e848a91d23e967309bd1719910021e6/raw/dbe04893f4ee2e0aa020735528f7f19bb2d13a7e/nostr_c_seed_qr.py " ] , cwd = " nostr_QRseed " )
2023-01-01 19:11:25 +01:00
clear ( )
blogo ( )
print ( output )
responseC = input ( " Hex to BIP39 QR & BIP39 to Hex QR: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " nostr_c_seed_qr.py " , responseC ] , cwd = " nostr_QRseed " )
2023-01-01 19:11:25 +01:00
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2023-01-15 17:10:50 +01:00
menuSelection ( )
2023-09-20 19:40:35 -03:00
2023-01-15 17:10:50 +01:00
def callGitBija ( ) :
if not os . path . isdir ( ' bija ' ) :
2026-04-01 12:51:41 -03:00
subprocess . run ( [ " git " , " clone " , " --recurse-submodules " , " https://github.com/BrightonBTC/bija " ] )
2026-04-01 12:21:08 -03:00
subprocess . run ( [ " docker-compose " , " up " ] , cwd = " bija " )
2023-01-15 17:10:50 +01:00
input ( " \a \n You can now access Bija at http://localhost:5000 " )
2023-06-15 01:13:44 +02:00
#---------------------------------Bpytop----------------------------------
def callGitBpytop ( ) :
2023-06-15 02:24:42 +02:00
if not os . path . isdir ( ' bpytop ' ) :
2026-04-01 12:51:41 -03:00
subprocess . run ( [ " pip3 " , " install " , " bpytop " ] )
subprocess . run ( [ " git " , " clone " , " https://github.com/aristocratos/bpytop.git " ] )
2026-04-01 12:21:08 -03:00
subprocess . run ( [ " sudo " , " make " , " install " ] , cwd = " bpytop " )
subprocess . run ( [ " bpytop " ] )
2024-04-30 01:10:50 +02:00
#----------------------------------------------------------------------PhoenixSta
def callPhoenixLin ( ) :
try :
clear ( )
blogo ( )
output = render (
" Phoenix Linux " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
if os . path . isdir ( ' phoenixwallet ' ) :
2026-04-01 12:51:41 -03:00
subprocess . run ( [ " rm " , " -rf " , " phoenix-0.3.0-linux-x64.zip " ] , cwd = " phoenixwallet " )
subprocess . run ( [ " wget " , " https://github.com/ACINQ/phoenixd/releases/download/v0.3.0/phoenix-0.3.0-linux-x64.zip " ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
else : # Check if the file 'bclock.conf' is in the same folder
2026-04-01 12:51:41 -03:00
os . makedirs ( " phoenixwallet " , exist_ok = True )
subprocess . run ( [ " wget " , " https://github.com/ACINQ/phoenixd/releases/download/v0.3.0/phoenix-0.3.0-linux-x64.zip " ] , cwd = " phoenixwallet " )
subprocess . run ( [ " unzip " , " -j " , " phoenix-0.3.0-linux-x64.zip " ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
clear ( )
blogo ( )
input ( " \a \n You are going to launch your own Phoenix. Press Enter to Continue. " )
input ( " \a \n Don ' t close this window to stay Online. Press Enter to Continue. " )
input ( " \a \n Open another Terminal and Select Manage in the Phoenix Menu. Press Enter to Continue. " )
clear ( )
blogo ( )
print ( output )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./phoenixd " ] , cwd = " phoenixwallet " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2024-04-30 01:10:50 +02:00
menuSelection ( )
def callPhoenixWin ( ) :
try :
clear ( )
blogo ( )
output = render (
" Phoenix Windows " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
if os . path . isdir ( ' phoenixwallet ' ) :
2026-04-01 12:51:41 -03:00
subprocess . run ( [ " rm " , " -rf " , " v0.3.0.zip " ] , cwd = " phoenixwallet " )
subprocess . run ( [ " wget " , " https://github.com/ACINQ/phoenixd/archive/refs/tags/v0.3.0.zip " ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
else : # Check if the file 'bclock.conf' is in the same folder
2026-04-01 12:51:41 -03:00
os . makedirs ( " phoenixwallet " , exist_ok = True )
subprocess . run ( [ " wget " , " https://github.com/ACINQ/phoenixd/archive/refs/tags/v0.3.0.zip " ] , cwd = " phoenixwallet " )
subprocess . run ( [ " unzip " , " -j " , " v0.3.0.zip " ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
clear ( )
blogo ( )
input ( " \a \n You are going to launch your own Phoenix. Press Enter to Continue. " )
input ( " \a \n Don ' t close this window to stay Online. Press Enter to Continue. " )
input ( " \a \n Open another Terminal and Select Manage in the Phoenix Menu. Press Enter to Continue. " )
clear ( )
blogo ( )
print ( output )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./phoenixd " ] , cwd = " phoenixwallet " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2024-04-30 01:10:50 +02:00
menuSelection ( )
def callPhoenixMacX64 ( ) :
try :
clear ( )
blogo ( )
output = render (
" Phoenix MacOSX64 " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
if os . path . isdir ( ' phoenixwallet ' ) :
2026-04-01 12:51:41 -03:00
subprocess . run ( [ " rm " , " -rf " , " phoenix-0.3.0-macos-x64.zip " ] , cwd = " phoenixwallet " )
subprocess . run ( [ " wget " , " https://github.com/ACINQ/phoenixd/releases/download/v0.3.0/phoenix-0.3.0-macos-x64.zip " ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
else : # Check if the file 'bclock.conf' is in the same folder
2026-04-01 12:51:41 -03:00
os . makedirs ( " phoenixwallet " , exist_ok = True )
subprocess . run ( [ " wget " , " https://github.com/ACINQ/phoenixd/releases/download/v0.3.0/phoenix-0.3.0-macos-x64.zip " ] , cwd = " phoenixwallet " )
subprocess . run ( [ " unzip " , " -j " , " phoenix-0.3.0-macos-x64.zip " ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
clear ( )
blogo ( )
input ( " \a \n You are going to launch your own Phoenix. Press Enter to Continue. " )
input ( " \a \n Don ' t close this window to stay Online. Press Enter to Continue. " )
input ( " \a \n Open another Terminal and Select Manage in the Phoenix Menu. Press Enter to Continue. " )
clear ( )
blogo ( )
print ( output )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./phoenixd " ] , cwd = " phoenixwallet " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2024-04-30 01:10:50 +02:00
menuSelection ( )
def callPhoenixMacARM ( ) :
try :
clear ( )
blogo ( )
output = render (
" Phoenix MacOSARM " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
if os . path . isdir ( ' phoenixwallet ' ) :
2026-04-01 12:51:41 -03:00
subprocess . run ( [ " rm " , " -rf " , " phoenix-0.3.0-macos-arm64.zip " ] , cwd = " phoenixwallet " )
subprocess . run ( [ " wget " , " https://github.com/ACINQ/phoenixd/releases/download/v0.3.0/phoenix-0.3.0-macos-arm64.zip " ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
else : # Check if the file 'bclock.conf' is in the same folder
2026-04-01 12:51:41 -03:00
os . makedirs ( " phoenixwallet " , exist_ok = True )
subprocess . run ( [ " wget " , " https://github.com/ACINQ/phoenixd/releases/download/v0.3.0/phoenix-0.3.0-macos-arm64.zip " ] , cwd = " phoenixwallet " )
subprocess . run ( [ " unzip " , " -j " , " phoenix-0.3.0-macos-arm64.zip " ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
clear ( )
blogo ( )
input ( " \a \n You are going to launch your own Phoenix. Press Enter to Continue. " )
input ( " \a \n Don ' t close this window to stay Online. Press Enter to Continue. " )
input ( " \a \n Open another Terminal and Select Manage in the Phoenix Menu. Press Enter to Continue. " )
clear ( )
blogo ( )
print ( output )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./phoenixd " ] , cwd = " phoenixwallet " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2024-04-30 01:10:50 +02:00
menuSelection ( )
def callPhoenix ( ) :
try :
clear ( )
blogo ( )
output = render (
" Manage your Phoenix " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
clear ( )
blogo ( )
print ( output )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./phoenix-cli " , " --help " ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
responseC = input ( " \a \n Type a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./phoenix-cli " , responseC ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
responseC = input ( " \a \n Type a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./phoenix-cli " , responseC ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
responseC = input ( " \a \n Type a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./phoenix-cli " , responseC ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
responseC = input ( " \a \n Type a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./phoenix-cli " , responseC ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
responseC = input ( " \a \n Type a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./phoenix-cli " , responseC ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
responseC = input ( " \a \n Type a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./phoenix-cli " , responseC ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
responseC = input ( " \a \n Type a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./phoenix-cli " , responseC ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
responseC = input ( " \a \n Type a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./phoenix-cli " , responseC ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
responseC = input ( " \a \n Type a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./phoenix-cli " , responseC ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
responseC = input ( " \a \n CType a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " ./phoenix-cli " , responseC ] , cwd = " phoenixwallet " )
2024-04-30 01:10:50 +02:00
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2024-04-30 01:10:50 +02:00
menuSelection ( )
2024-07-03 20:50:02 +02:00
def wallPhoenix ( ) :
try :
clear ( )
blogo ( )
output = render (
" PhoenixD Invoice Maker " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
Security audit round 2: eliminate shell=True, mask secrets, fix race conditions
- Replace all shell=True subprocess calls with Python-native processing
(nodeconnection.py, SPV/nodeconnection.py, SPV/ppi.py)
- Mask sensitive inputs (private keys, passwords, tokens) with getpass
- Add threading.Lock to block_explorer.py shared state
- Use json.loads() instead of fragile string splitting in apisnd.py
- Add path validation before file open in apisnd.py
- Replace random.randint with secrets.randbelow for mining nonces
- Fix destructive exception handlers in clone.py and feed.py
- Replace bare except clauses with specific exceptions + logging
- Remove unused imports (psutil, xmltodict, block_visualizer, base64, say)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:15:59 -03:00
responseC = getpass . getpass ( " Your PhoenixD Password: " )
2024-07-03 20:50:02 +02:00
responseD = input ( " Your Description: " )
responseE = input ( " Amount in Sats: " )
2026-04-01 10:24:47 -03:00
r = requests . post ( ' http://localhost:9740/createinvoice ' , auth = ( ' ' , responseC ) , data = { ' description ' : responseD , ' amountSat ' : responseE } )
print ( r . text )
2024-07-03 20:50:02 +02:00
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2024-07-03 22:31:26 +02:00
menuSelection ( )
2024-07-03 20:50:02 +02:00
def wallPhoenixBOLT12 ( ) :
try :
clear ( )
blogo ( )
output = render (
" PhoenixD BOLT12 Maker " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
Security audit round 2: eliminate shell=True, mask secrets, fix race conditions
- Replace all shell=True subprocess calls with Python-native processing
(nodeconnection.py, SPV/nodeconnection.py, SPV/ppi.py)
- Mask sensitive inputs (private keys, passwords, tokens) with getpass
- Add threading.Lock to block_explorer.py shared state
- Use json.loads() instead of fragile string splitting in apisnd.py
- Add path validation before file open in apisnd.py
- Replace random.randint with secrets.randbelow for mining nonces
- Fix destructive exception handlers in clone.py and feed.py
- Replace bare except clauses with specific exceptions + logging
- Remove unused imports (psutil, xmltodict, block_visualizer, base64, say)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:15:59 -03:00
responseC = getpass . getpass ( " Your PhoenixD Password: " )
2026-04-01 10:24:47 -03:00
r = requests . get ( ' http://localhost:9740/getoffer ' , auth = ( ' ' , responseC ) )
print ( r . text )
2024-07-03 20:50:02 +02:00
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2024-07-03 22:31:26 +02:00
menuSelection ( )
2024-07-03 20:50:02 +02:00
2024-04-30 01:10:50 +02:00
#----------------------------------------------------------------------PhoenixEnd
2024-09-20 00:56:05 +02:00
#-----------------------------STARTBLOCKS--------------------------------
def allblocksConn ( ) :
try :
conn = """ curl -s https://raw.githubusercontent.com/jlopp/bitcoin-blocks-by-mining-pool/master/blocks.csv """
2026-04-02 17:35:03 -03:00
a = subprocess . run ( shlex . split ( conn ) , capture_output = True , text = True ) . stdout
2024-09-20 00:56:05 +02:00
clear ( )
blogo ( )
closed ( )
output = render ( " All Blocks " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
print ( output )
print ( a )
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2024-09-20 00:56:05 +02:00
#-----------------------------ENDBLOCKS--------------------------------
2024-07-09 23:51:10 +02:00
#-----------------------------STRLuxor--------------------------------
def luxorstats ( ) :
try :
clear ( )
blogo ( )
output = render (
" Luxor Pool " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
if os . path . isdir ( ' luxor ' ) :
2026-04-01 12:21:08 -03:00
subprocess . run ( [ " python3 " , " luxor.py " , " --help " ] , cwd = os . path . join ( " luxor " , " graphql-python-client " ) )
2024-07-09 23:51:10 +02:00
else : # Check if the file 'bclock.conf' is in the same folder
2026-04-01 12:51:41 -03:00
os . makedirs ( " luxor " , exist_ok = True )
subprocess . run ( [ " git " , " clone " , " https://github.com/LuxorLabs/graphql-python-client.git " ] , cwd = " luxor " )
subprocess . run ( [ " pip3 " , " install " , " -r " , " requirements3.txt " ] , cwd = os . path . join ( " luxor " , " graphql-python-client " ) )
subprocess . run ( [ " python3 " , " luxor.py " , " --install-completion " ] , cwd = os . path . join ( " luxor " , " graphql-python-client " ) )
2024-07-09 23:51:10 +02:00
clear ( )
blogo ( )
input ( " \a \n You need to COPY the lines inside the file .env.example and create a NEW file .env with your Luxor API Key. Press Enter to Continue. " )
input ( " \a \n Other way is this 2 commands: 1 - mv .env.example .env 2 - nano .env and paste your Luxor Api Key. Press Enter to Continue. " )
clear ( )
blogo ( )
print ( output )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " luxor.py " , " --help " ] , cwd = " luxor/graphql-python-client " )
2024-07-09 23:51:10 +02:00
responseC = input ( " \a \n Type a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " luxor.py " , responseC ] , cwd = " luxor/graphql-python-client " )
2024-07-09 23:51:10 +02:00
responseC = input ( " \a \n Type a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " luxor.py " , responseC ] , cwd = " luxor/graphql-python-client " )
2024-07-09 23:51:10 +02:00
responseC = input ( " \a \n Type a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " luxor.py " , responseC ] , cwd = " luxor/graphql-python-client " )
2024-07-09 23:51:10 +02:00
responseC = input ( " \a \n Type a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " luxor.py " , responseC ] , cwd = " luxor/graphql-python-client " )
2024-07-09 23:51:10 +02:00
responseC = input ( " \a \n Type a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " luxor.py " , responseC ] , cwd = " luxor/graphql-python-client " )
2024-07-09 23:51:10 +02:00
responseC = input ( " \a \n Type a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " luxor.py " , responseC ] , cwd = " luxor/graphql-python-client " )
2024-07-09 23:51:10 +02:00
responseC = input ( " \a \n Type a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " luxor.py " , responseC ] , cwd = " luxor/graphql-python-client " )
2024-07-09 23:51:10 +02:00
responseC = input ( " \a \n Type a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " luxor.py " , responseC ] , cwd = " luxor/graphql-python-client " )
2024-07-09 23:51:10 +02:00
responseC = input ( " \a \n Type a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " luxor.py " , responseC ] , cwd = " luxor/graphql-python-client " )
2024-07-09 23:51:10 +02:00
responseC = input ( " \a \n CType a command of the list: " )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " luxor.py " , responseC ] , cwd = " luxor/graphql-python-client " )
2024-07-09 23:51:10 +02:00
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2024-07-09 23:51:10 +02:00
menuSelection ( )
2024-07-18 22:54:21 -03:00
2024-07-09 23:51:10 +02:00
#-----------------------------ENDLuxor--------------------------------
2023-09-21 19:32:01 +02:00
#---------------------------------UTXOracle----------------------------------
def callGitUTXOracle ( ) :
try :
clear ( )
blogo ( )
output = render (
" UTXORACLE " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
if os . path . isdir ( ' utxoracle ' ) :
print ( " ...Reading UTXOSet... " )
else : # Check if the file 'bclock.conf' is in the same folder
2026-04-01 12:51:41 -03:00
os . makedirs ( " utxoracle " , exist_ok = True )
subprocess . run ( [ " wget " , " https://raw.githubusercontent.com/Unbesteveable/UTXOracle/main/UTXOracle.py " ] , cwd = " utxoracle " )
2023-09-21 19:32:01 +02:00
clear ( )
blogo ( )
print ( output )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " UTXOracle.py " ] , cwd = " utxoracle " )
2023-09-21 19:32:01 +02:00
input ( " \a \n Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2023-09-21 19:32:01 +02:00
menuSelection ( )
2020-12-22 19:21:10 -03:00
#---------------------------------ColdCore-----------------------------------------
def callColdCore ( ) :
clear ( )
blogo ( )
close ( )
try :
2026-04-01 16:19:50 -03:00
from rich . panel import Panel as RPanel
from rich . text import Text as RText
home = os . path . expanduser ( " ~ " )
pyblock_dir = os . path . join ( home , " .pyblock " )
public_file = os . path . join ( pyblock_dir , " public.txt " )
coldcore_dir = os . path . join ( pyblock_dir , " coldcore " )
coldcore_bin = os . path . join ( home , " .local " , " bin " , " coldcore " )
has_public = os . path . isfile ( public_file )
has_coldcore = os . path . isfile ( coldcore_bin ) or subprocess . run (
[ " which " , " coldcore " ] , capture_output = True ) . returncode == 0
has_cli = bool ( path . get ( " bitcoincli " ) )
# Status panel
status = RText ( )
status . append ( " ColdCore Status \n \n " , style = " bold white " )
status . append ( " Bitcoin CLI: " , style = " dim " )
if has_cli :
status . append ( " Connected " , style = " bold green " )
try :
info = subprocess . run ( [ path [ " bitcoincli " ] , " getblockchaininfo " ] ,
capture_output = True , text = True , timeout = 5 )
if info . returncode == 0 :
d = json . loads ( info . stdout )
status . append ( f " (Block { d . get ( ' blocks ' , ' ? ' ) } ) " , style = " dim " )
except Exception :
pass
else :
status . append ( " Not configured " , style = " bold red " )
status . append ( " \n " )
status . append ( " ColdCore: " , style = " dim " )
status . append ( " Installed " if has_coldcore else " Not installed " ,
style = " bold green " if has_coldcore else " bold yellow " )
status . append ( " \n " )
status . append ( " Wallet File: " , style = " dim " )
if has_public :
status . append ( " Found " , style = " bold green " )
try :
status . append ( f " ( { os . path . getsize ( public_file ) : , } bytes) " , style = " dim " )
except Exception :
pass
2020-12-22 19:21:10 -03:00
else :
2026-04-01 16:19:50 -03:00
status . append ( " Not found " , style = " bold red " )
status . append ( " \n " )
rich_console . print ( RPanel ( status , title = " [bold cyan]ColdCore[/] " ,
style = " on default " , border_style = " cyan " ,
expand = False , padding = ( 1 , 2 ) ) )
if not has_public :
guide = RText ( )
guide . append ( " Setup Guide \n \n " , style = " bold yellow " )
guide . append ( " Step 1 " , style = " bold white " )
guide . append ( " On your Coldcard go to: \n " , style = " white " )
guide . append ( " Advanced > MicroSD > Dump Summary \n \n " , style = " bold cyan " )
guide . append ( " Step 2 " , style = " bold white " )
guide . append ( " Copy " , style = " white " )
guide . append ( " public.txt " , style = " bold white " )
guide . append ( " from SD card to: \n " , style = " white " )
guide . append ( f " { public_file } \n \n " , style = " bold cyan " )
guide . append ( " Step 3 " , style = " bold white " )
guide . append ( " Run this option again \n \n " , style = " white " )
guide . append ( " Docs: " , style = " dim " )
guide . append ( " coldcardwallet.com/docs/microsd#dump-summary-file \n " , style = " dim " )
rich_console . print ( RPanel ( guide , title = " [bold yellow]Setup Required[/] " ,
style = " on default " , border_style = " yellow " ,
expand = False , padding = ( 1 , 2 ) ) )
if not os . path . isdir ( pyblock_dir ) :
create = input ( " \n Create ~/.pyblock directory? (Y/n): " ) . strip ( ) . lower ( )
if create in ( " y " , " yes " , " " ) :
os . makedirs ( pyblock_dir , exist_ok = True )
rich_console . print ( " [green]Created ~/.pyblock/[/] " )
input ( " \n Press Enter to continue... " )
else :
if not has_coldcore :
rich_console . print ( " \n [yellow]Installing ColdCore...[/] " )
os . makedirs ( pyblock_dir , exist_ok = True )
if not os . path . isdir ( coldcore_dir ) :
subprocess . run ( [ " git " , " clone " , " --depth " , " 1 " ,
" https://github.com/jamesob/coldcore.git " ] , cwd = pyblock_dir )
subprocess . run ( [ " chmod " , " +x " , " coldcore " ] , cwd = coldcore_dir )
os . makedirs ( os . path . join ( home , " .local " , " bin " ) , exist_ok = True )
subprocess . run ( [ " cp " , " coldcore " , coldcore_bin ] , cwd = coldcore_dir )
rich_console . print ( " [green]ColdCore installed![/] \n " )
if has_cli :
try :
wallets = subprocess . run ( [ path [ " bitcoincli " ] , " listwallets " ] ,
capture_output = True , text = True , timeout = 5 )
if wallets . returncode == 0 :
wlist = json . loads ( wallets . stdout )
for wname in wlist [ : 3 ] :
bal = subprocess . run (
[ path [ " bitcoincli " ] , f " -rpcwallet= { wname } " , " getbalance " ] ,
capture_output = True , text = True , timeout = 5 )
if bal . returncode == 0 :
winfo = RText ( )
winfo . append ( f " Wallet: " , style = " dim " )
winfo . append ( f " { wname } \n " , style = " bold white " )
winfo . append ( f " Balance: " , style = " dim " )
winfo . append ( f " { bal . stdout . strip ( ) } BTC \n " , style = " bold green " )
rich_console . print ( RPanel ( winfo , style = " on default " ,
border_style = " green " , expand = False , padding = ( 0 , 2 ) ) )
except Exception :
pass
rich_console . print ( " \n [bold cyan]Launching ColdCore...[/] \n " )
2026-04-01 12:51:41 -03:00
subprocess . run ( [ " coldcore " ] )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 16:19:50 -03:00
show_error ( str ( e ) )
logger . debug ( " ColdCore error: %s " , e )
2020-12-22 19:21:10 -03:00
menuSelection ( )
2020-05-16 00:21:47 -03:00
#--------------------------------- Menu section -----------------------------------
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
def MainMenu ( mode ) : #Unified Main Menu - mode: "local", "onchain_only", or "remote"
2020-05-13 19:47:58 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-05-25 19:35:24 -03:00
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
2020-10-18 17:57:46 -03:00
2026-04-01 15:01:19 -03:00
# Validate bitcoincli path before attempting to use it
if mode in ( " local " , " onchain_only " ) and not path . get ( ' bitcoincli ' ) :
2026-04-01 15:18:46 -03:00
show_error ( " Bitcoin CLI path not configured. Redirecting to Lite Mode. " )
t . sleep ( 2 )
from SPV . spvblock import MainMenuCROPPED as _lite_menu
_lite_menu ( )
return
if mode == " remote " and not lndconnectload . get ( ' tls ' ) :
show_error ( " Remote node not configured. Redirecting to Lite Mode. " )
t . sleep ( 2 )
from SPV . spvblock import MainMenuCROPPED as _lite_menu
_lite_menu ( )
return
2026-04-01 15:01:19 -03:00
2026-04-01 13:09:21 -03:00
# Fetch BTC price for status bar
try :
_price_r = requests . get ( " https://mempool.space/api/v1/prices " , timeout = 3 )
_btc_price = f " { _price_r . json ( ) . get ( ' USD ' , ' ' ) : , } "
except Exception :
_btc_price = " "
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
if mode == " remote " :
lndconnectexec ( )
path_remote = { " ip_port " : " " , " rpcuser " : " " , " rpcpass " : " " , " bitcoincli " : " " }
2026-04-01 13:09:21 -03:00
with open ( " config/bclock.conf " , " r " ) as f :
pathv = json . load ( f )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
path_remote = pathv
n = " Local " if path_remote [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
2020-05-25 19:35:24 -03:00
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
elif mode == " local " :
lndconnectexec ( )
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
b = json . loads ( a )
d = b
2020-12-07 20:56:35 -03:00
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else : # onchain_only
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
b = json . loads ( a )
d = b
alias = None
2020-11-15 20:24:59 -03:00
2026-04-01 13:29:40 -03:00
# Rich status bar and header
rich_status_bar ( mode = mode , block_height = str ( d . get ( ' blocks ' , ' ' ) ) , btc_price = _btc_price )
alias_name = alias . get ( ' alias ' , ' ' ) if alias else None
rich_header ( n , str ( d . get ( ' blocks ' , ' ' ) ) , version , alias = alias_name )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
2026-04-01 13:29:40 -03:00
# Rich menu
items = [
( " A " , " PyBLOCK " , " red " ) ,
( " B " , " Bitcoin " , " rgb(255,102,0) " ) ,
]
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
if mode != " onchain_only " :
2026-04-01 13:29:40 -03:00
items . append ( ( " L " , " Lightning " , " yellow " ) )
items . extend ( [
( " P " , " Platforms " , " rgb(0,200,0) " ) ,
2026-04-02 10:48:25 -03:00
( " I " , " AI Assistant " , " cyan " ) ,
2026-04-01 13:29:40 -03:00
( " S " , " Settings " , " blue " ) ,
( " X " , " Donate " , " white " ) ,
( " Q " , " Exit " , " rgb(128,0,255) " ) ,
] )
rich_menu ( " Main Menu " , items )
print ( " \x1b [?25h " )
mainmenuControl ( rich_prompt ( " Select option " ) , mode )
2020-11-15 20:24:59 -03:00
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
def MainMenuLOCAL ( ) : #Main Menu
MainMenu ( " local " )
2020-11-15 20:24:59 -03:00
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
def MainMenuLOCALChainONLY ( ) : #Main Menu
MainMenu ( " onchain_only " )
2020-12-07 20:56:35 -03:00
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
def MainMenuREMOTE ( ) : #Main Menu
MainMenu ( " remote " )
2020-11-15 20:24:59 -03:00
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
def bitcoincoremenuLocal ( mode ) : #Unified Bitcoin Core menu for local/onchain_only modes
2020-11-15 20:24:59 -03:00
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
2020-11-15 20:24:59 -03:00
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-15 20:24:59 -03:00
b = json . loads ( a )
d = b
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
if mode == " local " :
lndconnectexec ( )
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
alias = None
2020-11-15 20:24:59 -03:00
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
# Build header
if alias is not None :
header = """ \t \t
2020-11-15 20:24:59 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { } """ .format(n, alias[ ' alias ' ], d[ ' blocks ' ], version)
else :
header = """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { } """ .format(n, d[ ' blocks ' ], version)
2026-04-02 09:23:09 -03:00
# Build Rich categorized menu
from rich . columns import Columns
from rich . text import Text as RText
print ( header )
# Blockchain section
col1 = RText ( )
col1 . append ( " BLOCKCHAIN \n " , style = " bold rgb(255,102,0) underline " )
col1 . append ( " A. " , style = " bold rgb(255,102,0) " )
col1 . append ( " Console \n " , style = " white " )
col1 . append ( " C. " , style = " bold rgb(255,102,0) " )
col1 . append ( " Blockchain Info \n " , style = " white " )
col1 . append ( " D. " , style = " bold rgb(255,102,0) " )
col1 . append ( " Run the Numbers \n " , style = " white " )
col1 . append ( " L. " , style = " bold rgb(255,102,0) " )
col1 . append ( " Latest Block \n " , style = " white " )
col1 . append ( " M. " , style = " bold rgb(255,102,0) " )
col1 . append ( " Moscow Time \n " , style = " white " )
col1 . append ( " B. " , style = " bold rgb(255,102,0) " )
col1 . append ( " Genesis Block \n " , style = " white " )
col1 . append ( " J. " , style = " bold rgb(255,102,0) " )
col1 . append ( " Whitepaper \n " , style = " white " )
# Monitoring section
col2 = RText ( )
col2 . append ( " MONITORING \n " , style = " bold cyan underline " )
col2 . append ( " S. " , style = " bold cyan " )
col2 . append ( " Mempool \n " , style = " white " )
col2 . append ( " U. " , style = " bold cyan " )
col2 . append ( " Unconfirmed Txs \n " , style = " white " )
col2 . append ( " V. " , style = " bold cyan " )
col2 . append ( " Block Visualizer \n " , style = " white " )
col2 . append ( " P. " , style = " bold cyan " )
col2 . append ( " Block Monitor \n " , style = " white " )
col2 . append ( " X. " , style = " bold cyan " )
col2 . append ( " Node Monitor \n " , style = " white " )
col2 . append ( " Y. " , style = " bold cyan " )
col2 . append ( " Mempool Monitor \n " , style = " white " )
col2 . append ( " K. " , style = " bold cyan " )
col2 . append ( " Peers Monitor \n " , style = " white " )
2026-06-21 10:02:04 -04:00
col2 . append ( " OV. " , style = " bold cyan " )
col2 . append ( " OracleVision \n " , style = " white " )
2026-04-02 09:23:09 -03:00
# Tools section
col3 = RText ( )
col3 . append ( " TOOLS \n " , style = " bold green underline " )
col3 . append ( " E. " , style = " bold green " )
col3 . append ( " Decode HEX \n " , style = " white " )
col3 . append ( " F. " , style = " bold green " )
col3 . append ( " QR from Address \n " , style = " white " )
col3 . append ( " G. " , style = " bold green " )
col3 . append ( " Tx Confirmations \n " , style = " white " )
col3 . append ( " N. " , style = " bold green " )
col3 . append ( " Mempool Search \n " , style = " white " )
col3 . append ( " O. " , style = " bold green " )
col3 . append ( " OP_RETURN \n " , style = " white " )
col3 . append ( " H. " , style = " bold green " )
col3 . append ( " Miscellaneous \n " , style = " white " )
Reorganize Bitcoin submenu into 4 categorized columns with Rich
Replace the flat 25-item single-column ANSI menu with Rich Columns
organized by category:
- BLOCKCHAIN: Console, Info, Run Numbers, Latest, Moscow Time, Genesis
- MONITORING: Mempool, Unconfirmed, Visualizer, Block/Node/Mempool/Peers
- TOOLS: Decode HEX, QR, Tx Confirm, Search, OP_RETURN, Misc, ColdCore
- STATS & MINING: Stats, Hashrate, CLI/OwnNode Miner, Vanity, Wallet
Each category has its own color (orange, cyan, green, yellow) and
header. Much easier to scan and find features.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 16:05:30 -03:00
col3 . append ( " I. " , style = " bold green " )
col3 . append ( " ColdCore \n " , style = " white " )
2026-04-02 09:23:09 -03:00
# Stats & Mining section
col4 = RText ( )
col4 . append ( " STATS & MINING \n " , style = " bold yellow underline " )
col4 . append ( " Z. " , style = " bold yellow " )
col4 . append ( " Stats \n " , style = " white " )
col4 . append ( " Q. " , style = " bold yellow " )
col4 . append ( " Hashrate \n " , style = " white " )
col4 . append ( " CM. " , style = " bold yellow " )
col4 . append ( " CLI Miner \n " , style = " white " )
col4 . append ( " ONM. " , style = " bold yellow " )
col4 . append ( " Own Node Miner \n " , style = " white " )
col4 . append ( " VG. " , style = " bold yellow " )
col4 . append ( " Vanity Generator \n " , style = " white " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
if mode == " onchain_only " :
2026-04-02 09:23:09 -03:00
col4 . append ( " W. " , style = " bold yellow " )
col4 . append ( " Wallet \n " , style = " white " )
rich_console . print ( )
rich_console . print ( Columns ( [ col1 , col2 , col3 , col4 ] , padding = ( 0 , 2 ) , expand = False ) )
rich_console . print ( )
rich_console . print ( " [dim]Enter.[/dim] [yellow]Return[/yellow] " )
rich_console . print ( )
print ( " \x1b [?25h " )
bitcoincoremenuLocalControl ( rich_prompt ( " Select option " ) , mode )
2021-11-18 23:32:22 -03:00
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
def bitcoincoremenuLOCAL ( ) :
bitcoincoremenuLocal ( " local " )
2021-11-18 23:32:22 -03:00
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
def bitcoincoremenuLOCALOnchainONLY ( ) :
bitcoincoremenuLocal ( " onchain_only " )
2021-11-18 23:32:22 -03:00
2023-09-20 18:56:54 +02:00
def OwnNodeMiner ( menuMin ) :
2023-09-10 18:34:51 +02:00
clear ( )
blogo ( )
sysinfo ( )
pathexec ( )
lndconnectexec ( )
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2023-09-10 18:34:51 +02:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2023-09-10 18:34:51 +02:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2023-09-10 18:34:51 +02:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Computer Miner
2023-09-20 19:02:32 +02:00
\033 [ 1 ; 32 ; 40 mB . \033 [ 0 ; 37 ; 40 m Raspberry Miner
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-22 19:29:44 +02:00
\n \n \x1b [ ? 25 h """ .format(n, alias[ ' alias ' ], d[ ' blocks ' ], version ))
2023-09-10 18:34:51 +02:00
OwnNodeMinerControl ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2023-09-20 19:40:35 -03:00
def OwnNodeMinerONCHAIN ( ) :
2023-09-20 18:56:54 +02:00
clear ( )
blogo ( )
sysinfo ( )
pathexec ( )
#lndconnectexec()
2023-09-20 23:21:51 +02:00
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2023-09-20 23:21:51 +02:00
b = json . loads ( a )
d = b
2023-09-20 19:40:35 -03:00
2023-09-20 18:56:54 +02:00
print ( """ \t \t
2023-09-20 19:40:35 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2023-09-20 18:56:54 +02:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Computer Miner
2023-09-20 19:02:32 +02:00
\033 [ 1 ; 32 ; 40 mB . \033 [ 0 ; 37 ; 40 m Raspberry Miner
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n,d[ ' blocks ' ], version))
2023-09-20 18:56:54 +02:00
OwnNodeMinerControlONCHAIN ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2021-11-24 07:47:40 -03:00
def walletmenuLOCALOnchainONLY ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-24 07:47:40 -03:00
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-24 07:47:40 -03:00
b = json . loads ( a )
d = b
2023-09-20 19:40:35 -03:00
2021-11-24 07:47:40 -03:00
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Deposit
\u001b [ 38 ; 5 ; 202 mB . \033 [ 0 ; 37 ; 40 m Show transactions
2022-12-23 02:42:46 +01:00
\u001b [ 38 ; 5 ; 202 mC . \033 [ 0 ; 37 ; 40 m Dump Private Key
2023-01-08 16:19:13 +01:00
\u001b [ 38 ; 5 ; 202 mD . \033 [ 0 ; 37 ; 40 m Wallet Info
\u001b [ 38 ; 5 ; 202 mE . \033 [ 0 ; 37 ; 40 m Address Info
\u001b [ 38 ; 5 ; 202 mF . \033 [ 0 ; 37 ; 40 m Mining Info
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n,d[ ' blocks ' ], version))
2021-11-24 07:47:40 -03:00
walletmenuLOCALcontrolAOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2021-05-17 15:00:06 -03:00
def bitcoincoremenuLOCALOPRETURN ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2021-05-17 15:00:06 -03:00
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-05-17 15:00:06 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2021-05-17 15:00:06 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Send OP_RETURN
\u001b [ 38 ; 5 ; 202 mB . \033 [ 0 ; 37 ; 40 m View OP_RETURN
2021-12-06 16:56:40 +01:00
\u001b [ 38 ; 5 ; 202 mC . \033 [ 0 ; 37 ; 40 m View Decoded Coinbase
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n, alias[ ' alias ' ], d[ ' blocks ' ], version ))
2021-05-17 15:00:06 -03:00
bitcoincoremenuLOCALcontrolO ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2021-12-01 16:57:56 -03:00
def bitcoincoremenuLOCALOPRETURNOnchainONLY ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-12-01 16:57:56 -03:00
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-12-01 16:57:56 -03:00
b = json . loads ( a )
d = b
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Send OP_RETURN
\u001b [ 38 ; 5 ; 202 mB . \033 [ 0 ; 37 ; 40 m View OP_RETURN
\u001b [ 38 ; 5 ; 202 mC . \033 [ 0 ; 37 ; 40 m View Decoded Coinbase
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2024-07-22 17:40:36 -03:00
\n \n \x1b [ ? 25 h """ .format(n,d[ ' blocks ' ], version ))
2021-12-01 16:57:56 -03:00
bitcoincoremenuLOCALcontrolOOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-11-15 20:24:59 -03:00
def bitcoincoremenuREMOTE ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-15 20:24:59 -03:00
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-15 20:24:59 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-15 20:24:59 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-11-24 22:04:22 -03:00
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Bitcoin - cli Console
\u001b [ 38 ; 5 ; 202 mB . \033 [ 0 ; 37 ; 40 m Show Blockchain Information
\u001b [ 38 ; 5 ; 202 mC . \033 [ 0 ; 37 ; 40 m Run the Numbers
\u001b [ 38 ; 5 ; 202 mD . \033 [ 0 ; 37 ; 40 m Show QR from a Bitcoin Address
\u001b [ 38 ; 5 ; 202 mE . \033 [ 0 ; 37 ; 40 m Miscellaneous
2022-05-09 20:40:50 +02:00
\u001b [ 38 ; 5 ; 202 mM . \033 [ 0 ; 37 ; 40 m Moscow Time
2021-05-17 15:00:06 -03:00
\u001b [ 38 ; 5 ; 202 mO . \033 [ 0 ; 37 ; 40 m OP_RETURN
2022-10-03 18:13:14 +02:00
\u001b [ 38 ; 5 ; 202 mR . \033 [ 0 ; 37 ; 40 m Hashrate
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(a, alias[ ' alias ' ], d[ ' blocks ' ], version ))
2020-11-15 20:24:59 -03:00
bitcoincoremenuREMOTEcontrol ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2021-05-17 15:00:06 -03:00
def bitcoincoremenuREMOTEOPRETURN ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2021-05-17 15:00:06 -03:00
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-05-17 15:00:06 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-05-17 15:00:06 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Send OP_RETURN
\u001b [ 38 ; 5 ; 202 mB . \033 [ 0 ; 37 ; 40 m View OP_RETURN
2021-12-06 16:56:40 +01:00
\u001b [ 38 ; 5 ; 202 mC . \033 [ 0 ; 37 ; 40 m View Decoded Coinbase
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(a, alias[ ' alias ' ], d[ ' blocks ' ], version ))
2021-05-17 15:00:06 -03:00
bitcoincoremenuREMOTEcontrolO ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-11-15 20:24:59 -03:00
def lightningnetworkLOCAL ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-15 20:24:59 -03:00
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-15 20:24:59 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-15 20:24:59 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
2026-04-02 09:23:09 -03:00
from rich . columns import Columns
from rich . text import Text as RText
header = """ \t \t
2020-11-15 20:24:59 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
2026-04-02 09:23:09 -03:00
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { } """ .format(n, alias[ ' alias ' ], d[ ' blocks ' ], version)
print ( header )
2026-04-01 16:14:58 -03:00
lnbitspaid = " UNLOCKED " if os . path . isfile ( " lnbitSN.conf " ) else " LOCKED "
2026-04-02 09:23:09 -03:00
# Invoices section
col1 = RText ( )
col1 . append ( " INVOICES \n " , style = " bold yellow underline " )
col1 . append ( " A. " , style = " bold yellow " )
col1 . append ( " Lncli Console \n " , style = " white " )
col1 . append ( " B. " , style = " bold yellow " )
col1 . append ( " New Invoice \n " , style = " white " )
col1 . append ( " C. " , style = " bold yellow " )
col1 . append ( " Pay Invoice \n " , style = " white " )
col1 . append ( " D. " , style = " bold yellow " )
col1 . append ( " Make a KeySend Payment \n " , style = " white " )
col1 . append ( " F. " , style = " bold yellow " )
col1 . append ( " List Invoices \n " , style = " white " )
# Channels section
col2 = RText ( )
col2 . append ( " CHANNELS \n " , style = " bold cyan underline " )
col2 . append ( " G. " , style = " bold cyan " )
col2 . append ( " Channel Balance \n " , style = " white " )
col2 . append ( " H. " , style = " bold cyan " )
col2 . append ( " Show Channels \n " , style = " white " )
col2 . append ( " I. " , style = " bold cyan " )
col2 . append ( " Rebalance Channel \n " , style = " white " )
col2 . append ( " E. " , style = " bold cyan " )
col2 . append ( " New Bitcoin Address \n " , style = " white " )
col2 . append ( " L. " , style = " bold cyan " )
col2 . append ( " Onchain Balance \n " , style = " white " )
col2 . append ( " M. " , style = " bold cyan " )
col2 . append ( " List Onchain Transactions \n " , style = " white " )
# Node section
col3 = RText ( )
col3 . append ( " NODE \n " , style = " bold green underline " )
col3 . append ( " N. " , style = " bold green " )
col3 . append ( " Get Node Info \n " , style = " white " )
col3 . append ( " O. " , style = " bold green " )
col3 . append ( " Get Network Information \n " , style = " white " )
col3 . append ( " J. " , style = " bold green " )
col3 . append ( " Show Peers \n " , style = " white " )
col3 . append ( " K. " , style = " bold green " )
col3 . append ( " Connect Peers \n " , style = " white " )
col3 . append ( " Z. " , style = " bold green " )
col3 . append ( " Stats \n " , style = " white " )
col3 . append ( " T. " , style = " bold green " )
col3 . append ( " Ranking \n " , style = " white " )
# Chat & LNBits section
col4 = RText ( )
col4 . append ( " CHAT & LNBITS \n " , style = " bold magenta underline " )
col4 . append ( " P. " , style = " bold magenta " )
col4 . append ( " PyChat \n " , style = " white " )
col4 . append ( " Q. " , style = " bold magenta " )
col4 . append ( f " LNBits List LNURL { lnbitspaid } \n " , style = " white " )
col4 . append ( " S. " , style = " bold magenta " )
col4 . append ( f " LNBits Create LNURL { lnbitspaid } \n " , style = " white " )
rich_console . print ( )
rich_console . print ( Columns ( [ col1 , col2 , col3 , col4 ] , padding = ( 0 , 2 ) , expand = False ) )
rich_console . print ( )
rich_console . print ( " [dim]Enter.[/dim] [yellow]Return[/yellow] " )
rich_console . print ( )
print ( " \x1b [?25h " )
lightningnetworkLOCALcontrol ( rich_prompt ( " Select option " ) )
2022-03-05 16:03:11 -03:00
2022-02-17 21:32:04 +01:00
def chatConn ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2022-02-17 21:32:04 +01:00
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2022-02-17 21:32:04 +01:00
b = json . loads ( a )
d = b
2022-03-05 16:03:11 -03:00
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2022-02-17 21:32:04 +01:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Open
\u001b [ 38 ; 5 ; 202 mB . \033 [ 0 ; 37 ; 40 m Close
2022-03-05 16:03:11 -03:00
\u001b [ 38 ; 5 ; 202 mC . \033 [ 0 ; 37 ; 40 m Hidden
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n, d[ ' blocks ' ], version ))
2022-03-05 16:41:53 -03:00
chatConnA ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2022-03-05 16:03:11 -03:00
2022-02-17 21:32:04 +01:00
def pyCHATA ( ) :
2022-02-17 01:52:56 +01:00
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2022-02-17 01:52:56 +01:00
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2022-02-17 01:52:56 +01:00
b = json . loads ( a )
d = b
2022-03-05 16:03:11 -03:00
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2022-02-17 01:52:56 +01:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Write
\u001b [ 38 ; 5 ; 202 mB . \033 [ 0 ; 37 ; 40 m Read
2022-03-05 16:03:11 -03:00
\u001b [ 38 ; 5 ; 202 mC . \033 [ 0 ; 37 ; 40 m List
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n, d[ ' blocks ' ], version ))
2022-03-05 16:41:53 -03:00
chatConnB ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2022-03-05 16:03:11 -03:00
2022-02-17 21:32:04 +01:00
def pyCHATB ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2022-02-17 21:32:04 +01:00
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2022-02-17 21:32:04 +01:00
b = json . loads ( a )
d = b
2022-03-05 16:03:11 -03:00
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2022-02-17 21:32:04 +01:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
2020-05-24 14:15:12 -03:00
2022-02-17 21:32:04 +01:00
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Write
\u001b [ 38 ; 5 ; 202 mB . \033 [ 0 ; 37 ; 40 m Read
2022-03-05 16:03:11 -03:00
\u001b [ 38 ; 5 ; 202 mC . \033 [ 0 ; 37 ; 40 m List
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n, d[ ' blocks ' ], version, ))
2022-03-05 16:41:53 -03:00
chatConnC ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2022-03-05 16:03:11 -03:00
2022-02-17 21:32:04 +01:00
def pyCHATC ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2022-02-17 21:32:04 +01:00
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2022-02-17 21:32:04 +01:00
b = json . loads ( a )
d = b
2022-03-05 16:03:11 -03:00
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2022-02-17 21:32:04 +01:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Write
\u001b [ 38 ; 5 ; 202 mB . \033 [ 0 ; 37 ; 40 m Read
2022-03-05 16:03:11 -03:00
\u001b [ 38 ; 5 ; 202 mC . \033 [ 0 ; 37 ; 40 m List
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n, d[ ' blocks ' ], version ))
2022-03-05 16:41:53 -03:00
chatConnD ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2022-03-05 16:03:11 -03:00
2020-11-15 20:24:59 -03:00
def lightningnetworkREMOTE ( ) :
2020-05-15 07:41:42 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-05-25 19:35:24 -03:00
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-10-18 20:58:29 +00:00
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
2020-10-18 17:57:46 -03:00
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-10-18 17:57:46 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-10-18 17:57:46 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2026-04-02 09:23:09 -03:00
from rich . columns import Columns
from rich . text import Text as RText
header = """ \t \t
2020-10-18 17:57:46 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
2026-04-02 09:23:09 -03:00
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { } """ .format(a, alias[ ' alias ' ], d[ ' blocks ' ], version)
print ( header )
2026-04-01 16:14:58 -03:00
lnbitspaid = " UNLOCKED " if os . path . isfile ( " lnbitSN.conf " ) else " LOCKED "
2026-04-02 09:23:09 -03:00
# Invoices section
col1 = RText ( )
col1 . append ( " INVOICES \n " , style = " bold yellow underline " )
col1 . append ( " A. " , style = " bold yellow " )
col1 . append ( " New Invoice \n " , style = " white " )
col1 . append ( " B. " , style = " bold yellow " )
col1 . append ( " Pay Invoice \n " , style = " white " )
col1 . append ( " D. " , style = " bold yellow " )
col1 . append ( " List Invoices \n " , style = " white " )
# Channels section
col2 = RText ( )
col2 . append ( " CHANNELS \n " , style = " bold cyan underline " )
col2 . append ( " E. " , style = " bold cyan " )
col2 . append ( " Channel Balance \n " , style = " white " )
col2 . append ( " F. " , style = " bold cyan " )
col2 . append ( " Show Channels \n " , style = " white " )
col2 . append ( " C. " , style = " bold cyan " )
col2 . append ( " New Bitcoin Address \n " , style = " white " )
col2 . append ( " G. " , style = " bold cyan " )
col2 . append ( " Onchain Balance \n " , style = " white " )
col2 . append ( " H. " , style = " bold cyan " )
col2 . append ( " List Onchain Transactions \n " , style = " white " )
# Node section
col3 = RText ( )
col3 . append ( " NODE \n " , style = " bold green underline " )
col3 . append ( " I. " , style = " bold green " )
col3 . append ( " Get Node Info \n " , style = " white " )
col3 . append ( " Z. " , style = " bold green " )
col3 . append ( " Stats \n " , style = " white " )
col3 . append ( " T. " , style = " bold green " )
col3 . append ( " Ranking \n " , style = " white " )
# LNBits section
col4 = RText ( )
col4 . append ( " LNBITS \n " , style = " bold magenta underline " )
col4 . append ( " Q. " , style = " bold magenta " )
col4 . append ( f " LNBits List LNURL { lnbitspaid } \n " , style = " white " )
col4 . append ( " S. " , style = " bold magenta " )
col4 . append ( f " LNBits Create LNURL { lnbitspaid } \n " , style = " white " )
rich_console . print ( )
rich_console . print ( Columns ( [ col1 , col2 , col3 , col4 ] , padding = ( 0 , 2 ) , expand = False ) )
rich_console . print ( )
rich_console . print ( " [dim]Enter.[/dim] [yellow]Return[/yellow] " )
rich_console . print ( )
print ( " \x1b [?25h " )
lightningnetworkREMOTEcontrol ( rich_prompt ( " Select option " ) )
2020-11-15 20:24:59 -03:00
def APIMenuLOCAL ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-26 13:05:51 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-26 13:05:51 -03:00
b = json . loads ( a )
d = b
2020-11-15 20:24:59 -03:00
2020-11-26 13:05:51 -03:00
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-26 13:05:51 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
2020-11-15 20:24:59 -03:00
2020-11-26 13:05:51 -03:00
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-26 13:05:51 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-26 13:05:51 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2026-04-02 09:23:09 -03:00
from rich . columns import Columns
from rich . text import Text as RText
header = """ \t \t
2020-11-24 22:04:22 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
2026-04-02 09:23:09 -03:00
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { } """ .format(n if path[ ' bitcoincli ' ] else a, alias[ ' alias ' ], d[ ' blocks ' ], version)
print ( header )
2026-04-01 16:14:58 -03:00
lnbitspaid = " PAID " if os . path . isfile ( " lnbitSN.conf " ) else " PREMIUM "
lnpaypaid = " PAID " if os . path . isfile ( " lnpaySN.conf " ) else " PREMIUM "
opennodepaid = " PAID " if os . path . isfile ( " opennodeSN.conf " ) else " PREMIUM "
2026-04-02 09:23:09 -03:00
# Lightning APIs section
col1 = RText ( )
col1 . append ( " LIGHTNING APIS \n " , style = " bold cyan underline " )
col1 . append ( " G. " , style = " bold cyan " )
2026-04-01 16:14:58 -03:00
col1 . append ( f " LNBits { lnbitspaid } \n " , style = " white " )
2026-04-02 09:23:09 -03:00
col1 . append ( " H. " , style = " bold cyan " )
2026-04-01 16:14:58 -03:00
col1 . append ( f " LNPay { lnpaypaid } \n " , style = " white " )
2026-04-02 09:23:09 -03:00
col1 . append ( " F. " , style = " bold cyan " )
col1 . append ( " BWT FREE \n " , style = " white " )
col1 . append ( " D. " , style = " bold cyan " )
col1 . append ( " CoinGecko FREE \n " , style = " white " )
col1 . append ( " L. " , style = " bold cyan " )
col1 . append ( " Arcade FREE \n " , style = " white " )
# Payment section
col2 = RText ( )
col2 . append ( " PAYMENT \n " , style = " bold green underline " )
col2 . append ( " I. " , style = " bold green " )
2026-04-01 16:14:58 -03:00
col2 . append ( f " OpenNode { opennodepaid } \n " , style = " white " )
2026-04-02 09:23:09 -03:00
col2 . append ( " A. " , style = " bold green " )
col2 . append ( " TippinMe FREE \n " , style = " white " )
col2 . append ( " B. " , style = " bold green " )
col2 . append ( " Tallycoin FREE \n " , style = " white " )
col2 . append ( " M. " , style = " bold green " )
col2 . append ( " Whale Alert FREE \n " , style = " white " )
col2 . append ( " T. " , style = " bold green " )
col2 . append ( " TinySeed FREE \n " , style = " white " )
# Data & Feeds section
col3 = RText ( )
col3 . append ( " DATA & FEEDS \n " , style = " bold yellow underline " )
col3 . append ( " K. " , style = " bold yellow " )
col3 . append ( " Weather FREE \n " , style = " white " )
col3 . append ( " E. " , style = " bold yellow " )
col3 . append ( " Rate.sx FREE \n " , style = " white " )
col3 . append ( " N. " , style = " bold yellow " )
col3 . append ( " Nostr FREE \n " , style = " white " )
col3 . append ( " U. " , style = " bold yellow " )
col3 . append ( " UTXOracle FREE \n " , style = " white " )
# Tools & Mining section
col4 = RText ( )
col4 . append ( " TOOLS & MINING \n " , style = " bold rgb(255,165,0) underline " )
col4 . append ( " J. " , style = " bold rgb(255,165,0) " )
col4 . append ( " SatNode FREE \n " , style = " white " )
col4 . append ( " C. " , style = " bold rgb(255,165,0) " )
col4 . append ( " Mempool FREE \n " , style = " white " )
col4 . append ( " Q. " , style = " bold rgb(255,165,0) " )
col4 . append ( " Ocean FREE \n " , style = " white " )
col4 . append ( " S. " , style = " bold rgb(255,165,0) " )
col4 . append ( " Braiins Pool FREE \n " , style = " white " )
col4 . append ( " W. " , style = " bold rgb(255,165,0) " )
col4 . append ( " CK Pool FREE \n " , style = " white " )
col4 . append ( " Z. " , style = " bold rgb(255,165,0) " )
col4 . append ( " PyBLOCK Pool FREE \n " , style = " white " )
rich_console . print ( )
rich_console . print ( Columns ( [ col1 , col2 , col3 , col4 ] , padding = ( 0 , 2 ) , expand = False ) )
rich_console . print ( )
rich_console . print ( " [dim]Enter.[/dim] [yellow]Return[/yellow] " )
rich_console . print ( )
print ( " \x1b [?25h " )
platfformsLOCALcontrol ( rich_prompt ( " Select option " ) )
2020-11-24 22:04:22 -03:00
2021-11-18 23:32:22 -03:00
def APIMenuLOCALOnchainONLY ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-18 23:32:22 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-18 23:32:22 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-18 23:32:22 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-18 23:32:22 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2026-04-02 09:23:09 -03:00
from rich . columns import Columns
from rich . text import Text as RText
header = """ \t \t
2021-11-18 23:32:22 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
2026-04-02 09:23:09 -03:00
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { } """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version)
print ( header )
2026-04-01 16:14:58 -03:00
lnbitspaid = " PAID " if os . path . isfile ( " lnbitSN.conf " ) else " PREMIUM "
lnpaypaid = " PAID " if os . path . isfile ( " lnpaySN.conf " ) else " PREMIUM "
opennodepaid = " PAID " if os . path . isfile ( " opennodeSN.conf " ) else " PREMIUM "
2026-04-02 09:23:09 -03:00
# Lightning APIs section
col1 = RText ( )
col1 . append ( " LIGHTNING APIS \n " , style = " bold cyan underline " )
col1 . append ( " G. " , style = " bold cyan " )
2026-04-01 16:14:58 -03:00
col1 . append ( f " LNBits { lnbitspaid } \n " , style = " white " )
2026-04-02 09:23:09 -03:00
col1 . append ( " H. " , style = " bold cyan " )
2026-04-01 16:14:58 -03:00
col1 . append ( f " LNPay { lnpaypaid } \n " , style = " white " )
2026-04-02 09:23:09 -03:00
col1 . append ( " F. " , style = " bold cyan " )
col1 . append ( " BWT FREE \n " , style = " white " )
col1 . append ( " D. " , style = " bold cyan " )
col1 . append ( " CoinGecko FREE \n " , style = " white " )
col1 . append ( " L. " , style = " bold cyan " )
col1 . append ( " Arcade FREE \n " , style = " white " )
col1 . append ( " P. " , style = " bold cyan " )
col1 . append ( " PhoenixD FREE \n " , style = " white " )
# Payment section
col2 = RText ( )
col2 . append ( " PAYMENT \n " , style = " bold green underline " )
col2 . append ( " I. " , style = " bold green " )
2026-04-01 16:14:58 -03:00
col2 . append ( f " OpenNode { opennodepaid } \n " , style = " white " )
2026-04-02 09:23:09 -03:00
col2 . append ( " A. " , style = " bold green " )
col2 . append ( " TippinMe FREE \n " , style = " white " )
col2 . append ( " B. " , style = " bold green " )
col2 . append ( " Tallycoin FREE \n " , style = " white " )
col2 . append ( " M. " , style = " bold green " )
col2 . append ( " Whale Alert FREE \n " , style = " white " )
col2 . append ( " T. " , style = " bold green " )
col2 . append ( " TinySeed FREE \n " , style = " white " )
# Data & Feeds section
col3 = RText ( )
col3 . append ( " DATA & FEEDS \n " , style = " bold yellow underline " )
col3 . append ( " K. " , style = " bold yellow " )
col3 . append ( " Weather FREE \n " , style = " white " )
col3 . append ( " E. " , style = " bold yellow " )
col3 . append ( " Rate.sx FREE \n " , style = " white " )
col3 . append ( " N. " , style = " bold yellow " )
col3 . append ( " Nostr FREE \n " , style = " white " )
col3 . append ( " U. " , style = " bold yellow " )
col3 . append ( " UTXOracle FREE \n " , style = " white " )
# Tools & Mining section
col4 = RText ( )
col4 . append ( " TOOLS & MINING \n " , style = " bold rgb(255,165,0) underline " )
col4 . append ( " J. " , style = " bold rgb(255,165,0) " )
col4 . append ( " SatNode FREE \n " , style = " white " )
col4 . append ( " C. " , style = " bold rgb(255,165,0) " )
col4 . append ( " Mempool FREE \n " , style = " white " )
col4 . append ( " Q. " , style = " bold rgb(255,165,0) " )
col4 . append ( " Ocean Pool FREE \n " , style = " white " )
col4 . append ( " R. " , style = " bold rgb(255,165,0) " )
col4 . append ( " Luxor Pool FREE \n " , style = " white " )
col4 . append ( " S. " , style = " bold rgb(255,165,0) " )
col4 . append ( " Braiins Pool FREE \n " , style = " white " )
col4 . append ( " W. " , style = " bold rgb(255,165,0) " )
col4 . append ( " CK Pool FREE \n " , style = " white " )
col4 . append ( " Z. " , style = " bold rgb(255,165,0) " )
col4 . append ( " PyBLOCK Pool FREE \n " , style = " white " )
rich_console . print ( )
rich_console . print ( Columns ( [ col1 , col2 , col3 , col4 ] , padding = ( 0 , 2 ) , expand = False ) )
rich_console . print ( )
rich_console . print ( " [dim]Enter.[/dim] [yellow]Return[/yellow] " )
rich_console . print ( )
print ( " \x1b [?25h " )
platfformsLOCALcontrolOnchainONLY ( rich_prompt ( " Select option " ) )
2021-11-18 23:32:22 -03:00
2020-11-24 22:04:22 -03:00
def decodeHex ( ) :
2020-11-15 20:24:59 -03:00
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-15 20:24:59 -03:00
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-15 20:24:59 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-15 20:24:59 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-11-24 22:04:22 -03:00
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Decode Blocks in HEX
\u001b [ 38 ; 5 ; 202 mB . \033 [ 0 ; 37 ; 40 m Decode Transactions in HEX
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n, alias[ ' alias ' ], d[ ' blocks ' ], version ))
2020-11-24 22:04:22 -03:00
decodeHexLOCAL ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-11-15 20:24:59 -03:00
2021-11-26 20:26:36 -03:00
def decodeHexOnchainONLY ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-26 20:26:36 -03:00
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-26 20:26:36 -03:00
b = json . loads ( a )
d = b
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Decode Blocks in HEX
\u001b [ 38 ; 5 ; 202 mB . \033 [ 0 ; 37 ; 40 m Decode Transactions in HEX
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n, d[ ' blocks ' ], version ))
2021-11-26 20:26:36 -03:00
decodeHexLOCALOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-11-24 22:04:22 -03:00
def miscellaneousLOCAL ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-26 13:05:51 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-26 13:05:51 -03:00
b = json . loads ( a )
d = b
2020-11-24 22:04:22 -03:00
2020-11-26 13:05:51 -03:00
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-26 13:05:51 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
2020-11-24 22:04:22 -03:00
2020-11-26 13:05:51 -03:00
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-26 13:05:51 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-26 13:05:51 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-11-24 22:04:22 -03:00
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2021-12-06 16:56:40 +01:00
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Ascii ₿
\u001b [ 38 ; 5 ; 202 mB . \033 [ 0 ; 37 ; 40 m System
\u001b [ 38 ; 5 ; 202 mC . \033 [ 0 ; 37 ; 40 m Dates
\u001b [ 38 ; 5 ; 202 mD . \033 [ 0 ; 37 ; 40 m Quotes
2023-12-21 13:00:52 -03:00
\u001b [ 38 ; 5 ; 202 mH . \033 [ 0 ; 37 ; 40 m SHA256
2024-07-25 21:20:11 +02:00
\u001b [ 38 ; 5 ; 202 mM . \033 [ 0 ; 37 ; 40 m Block Bitaxe
2022-03-12 16:31:38 +01:00
\u001b [ 38 ; 5 ; 202 mP . \033 [ 0 ; 37 ; 40 m PGP
2022-03-12 03:04:11 +01:00
\u001b [ 38 ; 5 ; 202 mS . \033 [ 0 ; 37 ; 40 m Satoshi Nakamoto
2024-09-20 00:56:05 +02:00
\u001b [ 38 ; 5 ; 202 mX . \033 [ 0 ; 37 ; 40 m All Blocks
2024-08-14 23:23:39 +02:00
\u001b [ 38 ; 5 ; 202 mSHS . \033 [ 0 ; 37 ; 40 m SHS
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ))
2020-11-24 22:04:22 -03:00
miscellaneousLOCALmenu ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2021-11-26 20:26:36 -03:00
def miscellaneousLOCALOnchainONLY ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-26 20:26:36 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-26 20:26:36 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-26 20:26:36 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-26 20:26:36 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2021-12-06 16:56:40 +01:00
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Ascii ₿
\u001b [ 38 ; 5 ; 202 mB . \033 [ 0 ; 37 ; 40 m System
\u001b [ 38 ; 5 ; 202 mC . \033 [ 0 ; 37 ; 40 m Dates
\u001b [ 38 ; 5 ; 202 mD . \033 [ 0 ; 37 ; 40 m Quotes
2023-12-21 13:00:52 -03:00
\u001b [ 38 ; 5 ; 202 mH . \033 [ 0 ; 37 ; 40 m SHA256
2024-07-25 21:20:11 +02:00
\u001b [ 38 ; 5 ; 202 mM . \033 [ 0 ; 37 ; 40 m Block Bitaxe
2022-03-12 16:31:38 +01:00
\u001b [ 38 ; 5 ; 202 mP . \033 [ 0 ; 37 ; 40 m PGP
2022-03-12 03:04:11 +01:00
\u001b [ 38 ; 5 ; 202 mS . \033 [ 0 ; 37 ; 40 m Satoshi Nakamoto
2024-09-20 00:56:05 +02:00
\u001b [ 38 ; 5 ; 202 mX . \033 [ 0 ; 37 ; 40 m All Blocks
2024-08-14 23:23:39 +02:00
\u001b [ 38 ; 5 ; 202 mSHS . \033 [ 0 ; 37 ; 40 m SHS
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version ))
2021-11-26 20:26:36 -03:00
miscellaneousLOCALmenuOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2022-03-08 20:36:01 -03:00
2024-04-30 01:10:50 +02:00
def PhoenixConn ( ) :
clear ( )
blogo ( )
sysinfo ( )
pathexec ( )
#lndconnectexec()
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2024-04-30 01:10:50 +02:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2024-04-30 01:10:50 +02:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Linux
\u001b [ 38 ; 5 ; 202 mB . \033 [ 0 ; 37 ; 40 m Mac arm64
\u001b [ 38 ; 5 ; 202 mC . \033 [ 0 ; 37 ; 40 m Mac x64
\u001b [ 38 ; 5 ; 202 mD . \033 [ 0 ; 37 ; 40 m Windows
\u001b [ 38 ; 5 ; 202 mE . \033 [ 0 ; 37 ; 40 m Manage
2024-07-03 20:50:02 +02:00
\u001b [ 38 ; 5 ; 202 mF . \033 [ 0 ; 37 ; 40 m Invoice Maker
\u001b [ 38 ; 5 ; 202 mG . \033 [ 0 ; 37 ; 40 m BOLT12
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2024-04-30 01:10:50 +02:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version ))
phoenixmenu ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2024-07-10 18:10:32 +02:00
def OceanConn ( ) :
clear ( )
blogo ( )
sysinfo ( )
pathexec ( )
#lndconnectexec()
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2024-07-10 18:10:32 +02:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2024-07-10 18:10:32 +02:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Earnings
\033 [ 1 ; 32 ; 40 mB . \033 [ 0 ; 37 ; 40 m Hashrate
\033 [ 1 ; 32 ; 40 mC . \033 [ 0 ; 37 ; 40 m Blocks
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2024-07-10 18:10:32 +02:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version ))
oceanMstats ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2022-03-08 23:58:27 +01:00
def slushpoolREMOTEOnchainONLY ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2022-03-08 23:58:27 +01:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2022-03-08 23:58:27 +01:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2022-03-08 23:58:27 +01:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2022-03-08 23:58:27 +01:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Difficulty
\u001b [ 38 ; 5 ; 202 mC . \033 [ 0 ; 37 ; 40 m Pool
\u001b [ 38 ; 5 ; 202 mE . \033 [ 0 ; 37 ; 40 m Miner
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version ))
2022-03-09 08:59:25 -03:00
slushpoolLOCALOnchainONLYMenu ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2022-03-08 20:36:01 -03:00
2022-03-08 23:58:27 +01:00
def slushpoolLOCALOnchainONLY ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2022-03-08 23:58:27 +01:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2022-03-08 23:58:27 +01:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2022-03-08 23:58:27 +01:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2022-03-08 23:58:27 +01:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Difficulty
\u001b [ 38 ; 5 ; 202 mC . \033 [ 0 ; 37 ; 40 m Pool
\u001b [ 38 ; 5 ; 202 mE . \033 [ 0 ; 37 ; 40 m Miner
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version ))
2022-03-08 20:36:01 -03:00
slushpoolLOCALOnchainONLYMenu ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2021-11-26 20:26:36 -03:00
2020-11-26 13:05:51 -03:00
def runTheNumbersMenu ( ) :
2020-11-24 22:04:22 -03:00
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-26 13:05:51 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-26 13:05:51 -03:00
b = json . loads ( a )
d = b
2020-11-24 22:04:22 -03:00
2020-11-26 13:05:51 -03:00
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-26 13:05:51 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
2020-11-24 22:04:22 -03:00
2020-11-26 13:05:51 -03:00
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-26 13:05:51 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-26 13:05:51 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2026-04-01 16:19:50 -03:00
rich_console . print ( )
rich_console . print ( f " [bold white] { n if path [ ' bitcoincli ' ] else a } [/]: [bold red]PyBLOCK[/] " )
rich_console . print ( f " [bold white]Node[/]: [bold yellow] { alias [ ' alias ' ] } [/] " )
rich_console . print ( f " [bold white]Block[/]: [bold green] { d [ ' blocks ' ] } [/] " )
rich_console . print ( f " [bold white]Version[/]: { version } " )
rich_console . print ( )
rich_console . print ( " [bold cyan]A.[/] Countdown Block " )
rich_console . print ( " [bold cyan]B.[/] Countdown Halving " )
rich_console . print ( " [bold cyan]C.[/] Audit " )
rich_console . print ( " [bold cyan]D.[/] Templates & Blocks " )
rich_console . print ( " [bold cyan]E.[/] Epoch " )
rich_console . print ( " [dim]Enter.[/] [yellow]Return[/] " )
rich_console . print ( )
print ( " \x1b [?25h " )
runTheNumbersControl ( rich_prompt ( " Select option " ) )
2020-09-25 19:56:40 -03:00
2021-11-26 20:26:36 -03:00
def runTheNumbersMenuOnchainONLY ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
2022-03-18 20:21:25 -03:00
#lndconnectexec()
2021-11-26 20:26:36 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-26 20:26:36 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-26 20:26:36 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-26 20:26:36 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2026-04-01 16:19:50 -03:00
rich_console . print ( )
rich_console . print ( f " [bold white] { n if path [ ' bitcoincli ' ] else a } [/]: [bold red]PyBLOCK[/] " )
rich_console . print ( f " [bold white]Block[/]: [bold green] { d [ ' blocks ' ] } [/] " )
rich_console . print ( f " [bold white]Version[/]: { version } " )
rich_console . print ( )
rich_console . print ( " [bold cyan]A.[/] Countdown Block " )
rich_console . print ( " [bold cyan]B.[/] Countdown Halving " )
rich_console . print ( " [bold cyan]C.[/] Audit " )
rich_console . print ( " [bold cyan]D.[/] Templates & Blocks " )
rich_console . print ( " [bold cyan]E.[/] Epoch " )
rich_console . print ( " [dim]Enter.[/] [yellow]Return[/] " )
rich_console . print ( )
print ( " \x1b [?25h " )
runTheNumbersControlOnchainONLY ( rich_prompt ( " Select option " ) )
2021-11-26 20:26:36 -03:00
2020-09-25 19:56:40 -03:00
def runTheNumbersMenuConn ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-26 13:05:51 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-26 13:05:51 -03:00
b = json . loads ( a )
d = b
2020-11-24 22:04:22 -03:00
2020-11-26 13:05:51 -03:00
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-26 13:05:51 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-26 13:05:51 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-26 13:05:51 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2026-04-01 16:19:50 -03:00
rich_console . print ( )
rich_console . print ( f " [bold white] { n if path [ ' bitcoincli ' ] else a } [/]: [bold red]PyBLOCK[/] " )
rich_console . print ( f " [bold white]Node[/]: [bold yellow] { alias [ ' alias ' ] } [/] " )
rich_console . print ( f " [bold white]Block[/]: [bold green] { d [ ' blocks ' ] } [/] " )
rich_console . print ( f " [bold white]Version[/]: { version } " )
rich_console . print ( )
rich_console . print ( " [bold cyan]A.[/] Countdown Block " )
rich_console . print ( " [bold cyan]B.[/] Countdown Halving " )
rich_console . print ( " [bold cyan]C.[/] Audit " )
rich_console . print ( " [bold cyan]D.[/] Templates & Blocks " )
rich_console . print ( " [bold cyan]E.[/] Epoch " )
rich_console . print ( " [dim]Enter.[/] [yellow]Return[/] " )
rich_console . print ( )
print ( " \x1b [?25h " )
runTheNumbersControlConn ( rich_prompt ( " Select option " ) )
2020-09-25 19:56:40 -03:00
2021-11-26 20:26:36 -03:00
def weatherMenuOnchainONLY ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-26 20:26:36 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-26 20:26:36 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-26 20:26:36 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-26 20:26:36 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Version 1
\033 [ 1 ; 32 ; 40 mB . \033 [ 0 ; 37 ; 40 m Version 2
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version ))
2021-11-26 20:26:36 -03:00
menuWeatherOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-09-19 22:54:27 -03:00
def weatherMenu ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-26 13:05:51 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-26 13:05:51 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-26 13:05:51 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-26 13:05:51 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-26 13:05:51 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-09-19 22:54:27 -03:00
print ( """ \t \t
2020-11-26 13:05:51 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-09-19 22:54:27 -03:00
2020-09-25 19:56:40 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Version 1
\033 [ 1 ; 32 ; 40 mB . \033 [ 0 ; 37 ; 40 m Version 2
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ))
2020-09-19 22:54:27 -03:00
menuWeather ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-05-25 19:35:24 -03:00
def dnt ( ) : # Donation selection menu
2020-05-20 20:32:31 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-05-25 19:35:24 -03:00
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-05-20 20:32:31 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-05-24 14:15:12 -03:00
2020-11-25 16:43:43 -03:00
\u001b [ 38 ; 5 ; 15 mA . \033 [ 0 ; 37 ; 40 m Developers Donation
\u001b [ 38 ; 5 ; 15 mB . \033 [ 0 ; 37 ; 40 m Testers Donation
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ))
2020-05-25 19:35:24 -03:00
menuC ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-05-24 14:15:12 -03:00
2021-11-22 14:48:21 -03:00
def dntOnchainONLY ( ) : # Donation selection menu
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-22 14:48:21 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-22 14:48:21 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-22 14:48:21 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-22 14:48:21 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\u001b [ 38 ; 5 ; 15 mA . \033 [ 0 ; 37 ; 40 m Developers Donation
\u001b [ 38 ; 5 ; 15 mB . \033 [ 0 ; 37 ; 40 m Testers Donation
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version ))
2021-11-22 14:48:21 -03:00
menuCOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-05-25 19:35:24 -03:00
def dntDev ( ) : # Dev Donation Menu
2020-05-23 08:50:38 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-05-25 19:35:24 -03:00
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-26 13:05:51 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-26 13:05:51 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-26 13:05:51 -03:00
lsd0 = str ( lsd )
2021-11-22 14:52:04 -03:00
alias = json . loads ( lsd0 )
2020-11-26 13:05:51 -03:00
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-26 13:05:51 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-26 13:05:51 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-05-23 08:50:38 -03:00
print ( """ \t \t
2020-11-26 13:05:51 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-05-24 14:15:12 -03:00
2021-04-14 00:08:55 -03:00
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Samourai PayNym
\u001b [ 38 ; 5 ; 202 mB . \033 [ 0 ; 37 ; 40 m Bitcoin Address
\u001b [ 33 ; 1 mC . \033 [ 0 ; 37 ; 40 m Lightning Network
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ))
2020-05-25 19:35:24 -03:00
menuE ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-05-24 14:15:12 -03:00
2021-11-22 14:48:21 -03:00
def dntDevOnchainONLY ( ) : # Dev Donation Menu
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-22 14:48:21 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-22 14:48:21 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-22 14:48:21 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-22 14:48:21 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Samourai PayNym
\u001b [ 38 ; 5 ; 202 mB . \033 [ 0 ; 37 ; 40 m Bitcoin Address
\u001b [ 33 ; 1 mC . \033 [ 0 ; 37 ; 40 m Lightning Network
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version ))
2021-11-22 14:48:21 -03:00
menuEOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-05-25 19:35:24 -03:00
def dntTst ( ) : # Tester Donation Menu
2020-05-23 08:50:38 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-05-25 19:35:24 -03:00
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-26 13:05:51 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-26 13:05:51 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-26 13:05:51 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-26 13:05:51 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:05:30 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-26 13:05:51 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-05-23 08:50:38 -03:00
print ( """ \t \t
2020-11-26 13:05:51 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-05-24 14:15:12 -03:00
2020-11-25 16:43:43 -03:00
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Bitcoin Address
\u001b [ 33 ; 1 mB . \033 [ 0 ; 37 ; 40 m Lightning Network
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ))
2020-05-25 19:35:24 -03:00
menuF ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-05-24 14:15:12 -03:00
2021-11-22 14:48:21 -03:00
def dntTstOnchainONLY ( ) : # Tester Donation Menu
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-22 14:48:21 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-22 14:48:21 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-22 14:48:21 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 15:32:42 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-22 14:48:21 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\u001b [ 38 ; 5 ; 202 mA . \033 [ 0 ; 37 ; 40 m Bitcoin Address
\u001b [ 33 ; 1 mB . \033 [ 0 ; 37 ; 40 m Lightning Network
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version ))
2021-11-22 14:48:21 -03:00
menuFOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-05-25 19:35:24 -03:00
def satnodeMenu ( ) : # Satnode Menu
2020-05-23 08:50:38 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-05-25 19:35:24 -03:00
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 15:32:42 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-05-23 08:50:38 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-05-25 19:35:24 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Start SatNode
\033 [ 1 ; 32 ; 40 mB . \033 [ 0 ; 37 ; 40 m Feed
\033 [ 1 ; 32 ; 40 mC . \033 [ 0 ; 37 ; 40 m Setup
\033 [ 1 ; 34 ; 40 mS . \033 [ 0 ; 37 ; 40 m Send a Message to Space
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ))
2020-05-25 19:35:24 -03:00
menuD ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-05-20 20:32:31 -03:00
2021-11-26 20:26:36 -03:00
def satnodeMenuOnchainONLY ( ) : # Satnode Menu
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-26 20:26:36 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-26 20:26:36 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-26 20:26:36 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 15:32:42 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-26 20:26:36 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Start SatNode
\033 [ 1 ; 32 ; 40 mB . \033 [ 0 ; 37 ; 40 m Feed
\033 [ 1 ; 32 ; 40 mC . \033 [ 0 ; 37 ; 40 m Setup
\033 [ 1 ; 34 ; 40 mS . \033 [ 0 ; 37 ; 40 m Send a Message to Space
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version ))
2021-11-26 20:26:36 -03:00
menuD ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-11-15 20:24:59 -03:00
def rateSX ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 15:32:42 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-11-15 20:24:59 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-11-15 20:24:59 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Rate
\033 [ 1 ; 32 ; 40 mB . \033 [ 0 ; 37 ; 40 m Chart
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ))
2020-11-15 20:24:59 -03:00
rateSXMenu ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2021-11-26 20:26:36 -03:00
def rateSXOncainONLY ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-26 20:26:36 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-26 20:26:36 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-26 20:26:36 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 15:32:42 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-26 20:26:36 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Rate
\033 [ 1 ; 32 ; 40 mB . \033 [ 0 ; 37 ; 40 m Chart
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version ))
2021-11-26 20:26:36 -03:00
rateSXMenuOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-11-15 20:24:59 -03:00
def mempoolmenu ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-17 20:37:55 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-11-15 20:24:59 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-11-15 20:24:59 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Blocks
\033 [ 1 ; 32 ; 40 mB . \033 [ 0 ; 37 ; 40 m Recommended Fee
2024-07-19 02:40:33 +02:00
\033 [ 1 ; 32 ; 40 mC . \033 [ 0 ; 37 ; 40 m Mempool Shell
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ))
2020-11-15 20:24:59 -03:00
mempoolmenuS ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2021-11-26 20:26:36 -03:00
def mempoolmenuOnchainONLY ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-26 20:26:36 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-26 20:26:36 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-26 20:26:36 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-17 20:37:55 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-26 20:26:36 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Blocks
\033 [ 1 ; 32 ; 40 mB . \033 [ 0 ; 37 ; 40 m Recommended Fee
2024-07-19 02:40:33 +02:00
\033 [ 1 ; 32 ; 40 mC . \033 [ 0 ; 37 ; 40 m Mempool Shell
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version ))
2021-11-26 20:26:36 -03:00
mempoolmenuSOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-11-15 20:24:59 -03:00
def APILnbit ( ) :
bitLN = { " NN " : " " , " pd " : " " }
if os . path . isfile ( ' lnbitSN.conf ' ) : # Check if the file 'bclock.conf' is in the same folder
2026-04-02 14:38:18 -03:00
with open ( " lnbitSN.conf " , " r " ) as f : bitData = json . load ( f )
2020-11-15 20:24:59 -03:00
bitLN = bitData # Copy the variable pathv to 'path'
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-17 20:37:55 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2026-04-01 16:19:50 -03:00
from rich . columns import Columns
from rich . text import Text as RText
2020-11-25 23:16:31 -03:00
2026-04-01 16:19:50 -03:00
rich_console . print ( )
rich_console . print ( f " [bold white] { n if path [ ' bitcoincli ' ] else a } [/]: [bold red]PyBLOCK[/] " )
rich_console . print ( f " [bold white]Node[/]: [bold yellow] { alias [ ' alias ' ] } [/] " )
rich_console . print ( f " [bold white]Block[/]: [bold green] { d [ ' blocks ' ] } [/] " )
rich_console . print ( f " [bold white]Version[/]: { version } " )
rich_console . print ( f " LNBits SN: { bitLN [ ' NN ' ] } [bold blue]Premium[/] " )
rich_console . print ( )
2020-11-15 20:24:59 -03:00
2026-04-01 16:19:50 -03:00
col1 = RText ( )
col1 . append ( " INVOICES \n " , style = " bold yellow underline " )
col1 . append ( " A. " , style = " bold yellow " )
col1 . append ( " New Invoice \n " , style = " white " )
col1 . append ( " B. " , style = " bold yellow " )
col1 . append ( " Pay Invoice \n " , style = " white " )
col2 = RText ( )
col2 . append ( " MANAGE \n " , style = " bold cyan underline " )
col2 . append ( " C. " , style = " bold cyan " )
col2 . append ( " New PayWall \n " , style = " white " )
col2 . append ( " D. " , style = " bold cyan " )
col2 . append ( " Delete PayWall \n " , style = " white " )
col2 . append ( " E. " , style = " bold cyan " )
col2 . append ( " List PayWalls \n " , style = " white " )
col2 . append ( " F. " , style = " bold cyan " )
col2 . append ( " Create LNURL \n " , style = " white " )
col2 . append ( " G. " , style = " bold cyan " )
col2 . append ( " List LNURL \n " , style = " white " )
rich_console . print ( Columns ( [ col1 , col2 ] , padding = ( 0 , 2 ) , expand = False ) )
rich_console . print ( )
rich_console . print ( " [dim]Enter.[/] [yellow]Return[/] " )
rich_console . print ( )
print ( " \x1b [?25h " )
menuLNBPI ( rich_prompt ( " Select option " ) )
2020-11-15 20:24:59 -03:00
2021-11-26 20:26:36 -03:00
def APILnbitOnchainONLY ( ) :
2022-03-17 21:37:11 -03:00
path = { " ip_port " : " " , " rpcuser " : " " , " rpcpass " : " " , " bitcoincli " : " " }
2026-04-02 14:38:18 -03:00
with open ( " config/bclock.conf " , " r " ) as f : pathv = json . load ( f )
2022-03-17 21:37:11 -03:00
path = pathv # Copy the variable pathv to 'path'
2026-04-03 10:57:20 -03:00
lndconnectload = _load_lnd_config ( )
2021-11-26 20:26:36 -03:00
bitLN = { " NN " : " " , " pd " : " " }
if os . path . isfile ( ' lnbitSN.conf ' ) : # Check if the file 'bclock.conf' is in the same folder
2026-04-02 14:38:18 -03:00
with open ( " lnbitSN.conf " , " r " ) as f : bitData = json . load ( f )
2021-11-26 20:26:36 -03:00
bitLN = bitData # Copy the variable pathv to 'path'
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-26 20:26:36 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-26 20:26:36 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-26 20:26:36 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-26 20:26:36 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2026-04-01 16:19:50 -03:00
from rich . columns import Columns
from rich . text import Text as RText
2021-11-26 20:26:36 -03:00
2026-04-01 16:19:50 -03:00
rich_console . print ( )
rich_console . print ( f " [bold white] { n if path [ ' bitcoincli ' ] else a } [/]: [bold red]PyBLOCK[/] " )
rich_console . print ( f " [bold white]Block[/]: [bold green] { d [ ' blocks ' ] } [/] " )
rich_console . print ( f " [bold white]Version[/]: { version } " )
rich_console . print ( f " LNBits SN: { bitLN [ ' NN ' ] } [bold blue]Premium[/] " )
rich_console . print ( )
2021-11-26 20:26:36 -03:00
2026-04-01 16:19:50 -03:00
col1 = RText ( )
col1 . append ( " INVOICES \n " , style = " bold yellow underline " )
col1 . append ( " A. " , style = " bold yellow " )
col1 . append ( " New Invoice \n " , style = " white " )
col1 . append ( " B. " , style = " bold yellow " )
col1 . append ( " Pay Invoice \n " , style = " white " )
col2 = RText ( )
col2 . append ( " MANAGE \n " , style = " bold cyan underline " )
col2 . append ( " C. " , style = " bold cyan " )
col2 . append ( " New PayWall \n " , style = " white " )
col2 . append ( " D. " , style = " bold cyan " )
col2 . append ( " Delete PayWall \n " , style = " white " )
col2 . append ( " E. " , style = " bold cyan " )
col2 . append ( " List PayWalls \n " , style = " white " )
col2 . append ( " F. " , style = " bold cyan " )
col2 . append ( " Create LNURL \n " , style = " white " )
col2 . append ( " G. " , style = " bold cyan " )
col2 . append ( " List LNURL \n " , style = " white " )
rich_console . print ( Columns ( [ col1 , col2 ] , padding = ( 0 , 2 ) , expand = False ) )
rich_console . print ( )
rich_console . print ( " [dim]Enter.[/] [yellow]Return[/] " )
rich_console . print ( )
print ( " \x1b [?25h " )
menuLNBPIOnchainONLY ( rich_prompt ( " Select option " ) )
2021-11-26 20:26:36 -03:00
2020-11-15 20:24:59 -03:00
def APILnPay ( ) :
bitLN = { " NN " : " " , " pd " : " " }
if os . path . isfile ( ' lnpaySN.conf ' ) : # Check if the file 'bclock.conf' is in the same folder
2026-04-02 14:38:18 -03:00
with open ( " lnpaySN.conf " , " r " ) as f : bitData = json . load ( f )
2020-11-15 20:24:59 -03:00
bitLN = bitData # Copy the variable pathv to 'path'
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2026-04-01 16:19:50 -03:00
rich_console . print ( )
rich_console . print ( f " [bold white] { n if path [ ' bitcoincli ' ] else a } [/]: [bold red]PyBLOCK[/] " )
rich_console . print ( f " [bold white]Node[/]: [bold yellow] { alias [ ' alias ' ] } [/] " )
rich_console . print ( f " [bold white]Block[/]: [bold green] { d [ ' blocks ' ] } [/] " )
rich_console . print ( f " [bold white]Version[/]: { version } " )
rich_console . print ( f " LNPay SN: { bitLN [ ' NN ' ] } [bold blue]Premium[/] " )
rich_console . print ( )
rich_console . print ( " [bold cyan]A.[/] New Invoice " )
rich_console . print ( " [bold cyan]B.[/] Pay Invoice " )
rich_console . print ( " [bold cyan]C.[/] Wallet Balance " )
rich_console . print ( " [bold cyan]D.[/] List Invoices " )
rich_console . print ( " [bold cyan]E.[/] Transfer Between Wallets " )
rich_console . print ( " [dim]Enter.[/] [yellow]Return[/] " )
rich_console . print ( )
print ( " \x1b [?25h " )
menuLNPAY ( rich_prompt ( " Select option " ) )
2020-11-15 20:24:59 -03:00
2021-11-26 20:26:36 -03:00
def APILnPayOnchainONLY ( ) :
bitLN = { " NN " : " " , " pd " : " " }
if os . path . isfile ( ' lnpaySN.conf ' ) : # Check if the file 'bclock.conf' is in the same folder
2026-04-02 14:38:18 -03:00
with open ( " lnpaySN.conf " , " r " ) as f : bitData = json . load ( f )
2021-11-26 20:26:36 -03:00
bitLN = bitData # Copy the variable pathv to 'path'
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-26 20:26:36 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-26 20:26:36 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-26 20:26:36 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-26 20:26:36 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2026-04-01 16:19:50 -03:00
rich_console . print ( )
rich_console . print ( f " [bold white] { n if path [ ' bitcoincli ' ] else a } [/]: [bold red]PyBLOCK[/] " )
rich_console . print ( f " [bold white]Block[/]: [bold green] { d [ ' blocks ' ] } [/] " )
rich_console . print ( f " [bold white]Version[/]: { version } " )
rich_console . print ( f " LNPay SN: { bitLN [ ' NN ' ] } [bold blue]Premium[/] " )
rich_console . print ( )
rich_console . print ( " [bold cyan]A.[/] New Invoice " )
rich_console . print ( " [bold cyan]B.[/] Pay Invoice " )
rich_console . print ( " [bold cyan]C.[/] Wallet Balance " )
rich_console . print ( " [bold cyan]D.[/] List Invoices " )
rich_console . print ( " [bold cyan]E.[/] Transfer Between Wallets " )
rich_console . print ( " [dim]Enter.[/] [yellow]Return[/] " )
rich_console . print ( )
print ( " \x1b [?25h " )
menuLNPAYOnchainONLY ( rich_prompt ( " Select option " ) )
2021-11-26 20:26:36 -03:00
2020-11-15 20:24:59 -03:00
def APIOpenNode ( ) :
bitLN = { " NN " : " " , " pd " : " " }
if os . path . isfile ( ' opennodeSN.conf ' ) : # Check if the file 'bclock.conf' is in the same folder
2026-04-02 14:38:18 -03:00
with open ( " opennodeSN.conf " , " r " ) as f : bitData = json . load ( f )
2020-11-15 20:24:59 -03:00
bitLN = bitData # Copy the variable pathv to 'path'
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2026-04-01 16:19:50 -03:00
rich_console . print ( )
rich_console . print ( f " [bold white] { n if path [ ' bitcoincli ' ] else a } [/]: [bold red]PyBLOCK[/] " )
rich_console . print ( f " [bold white]Node[/]: [bold yellow] { alias [ ' alias ' ] } [/] " )
rich_console . print ( f " [bold white]Block[/]: [bold green] { d [ ' blocks ' ] } [/] " )
rich_console . print ( f " [bold white]Version[/]: { version } " )
rich_console . print ( f " OpenNode SN: { bitLN [ ' NN ' ] } [bold blue]Premium[/] " )
rich_console . print ( )
rich_console . print ( " [bold cyan]A.[/] New Invoice " )
rich_console . print ( " [bold cyan]B.[/] Pay Invoice " )
rich_console . print ( " [bold cyan]C.[/] Wallet Balance " )
rich_console . print ( " [bold cyan]D.[/] List Payments " )
rich_console . print ( " [bold cyan]S.[/] Status " )
rich_console . print ( " [dim]Enter.[/] [yellow]Return[/] " )
rich_console . print ( )
print ( " \x1b [?25h " )
menuOpenNode ( rich_prompt ( " Select option " ) )
2021-11-26 20:26:36 -03:00
def APIOpenNodeOnchainONLY ( ) :
bitLN = { " NN " : " " , " pd " : " " }
if os . path . isfile ( ' opennodeSN.conf ' ) : # Check if the file 'bclock.conf' is in the same folder
2026-04-02 14:38:18 -03:00
with open ( " opennodeSN.conf " , " r " ) as f : bitData = json . load ( f )
2021-11-26 20:26:36 -03:00
bitLN = bitData # Copy the variable pathv to 'path'
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2021-11-26 20:26:36 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-26 20:26:36 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-26 20:26:36 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-26 20:26:36 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2026-04-01 16:19:50 -03:00
rich_console . print ( )
rich_console . print ( f " [bold white] { n if path [ ' bitcoincli ' ] else a } [/]: [bold red]PyBLOCK[/] " )
rich_console . print ( f " [bold white]Block[/]: [bold green] { d [ ' blocks ' ] } [/] " )
rich_console . print ( f " [bold white]Version[/]: { version } " )
rich_console . print ( f " OpenNode SN: { bitLN [ ' NN ' ] } [bold blue]Premium[/] " )
rich_console . print ( )
rich_console . print ( " [bold cyan]A.[/] New Invoice " )
rich_console . print ( " [bold cyan]B.[/] Pay Invoice " )
rich_console . print ( " [bold cyan]C.[/] Wallet Balance " )
rich_console . print ( " [bold cyan]D.[/] List Payments " )
rich_console . print ( " [bold cyan]S.[/] Status " )
rich_console . print ( " [dim]Enter.[/] [yellow]Return[/] " )
rich_console . print ( )
print ( " \x1b [?25h " )
menuOpenNodeOnchainONLY ( rich_prompt ( " Select option " ) )
2021-11-26 20:26:36 -03:00
def APITippinMe ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2021-11-26 20:26:36 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-26 20:26:36 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2021-11-26 20:26:36 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-26 20:26:36 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-26 20:26:36 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 0 ; 37 ; 40 mTippinMe
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m New Invoice
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version, ()))
2021-11-26 20:26:36 -03:00
menuTippinMe ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
def APITippinMeOnchainONLY ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-26 20:26:36 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-26 20:26:36 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-26 20:26:36 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-26 20:26:36 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2021-11-26 20:26:36 -03:00
\033 [ 0 ; 37 ; 40 mTippinMe
2020-11-15 20:24:59 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m New Invoice
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version, ()))
2021-11-26 20:26:36 -03:00
menuTippinMeOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-11-15 20:24:59 -03:00
2021-11-26 20:26:36 -03:00
def APITallyCo ( ) :
2020-11-15 20:24:59 -03:00
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-11-15 20:24:59 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2021-11-26 20:26:36 -03:00
\033 [ 0 ; 37 ; 40 mTallyCoin
2020-11-15 20:24:59 -03:00
2021-11-26 20:26:36 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Get Payment
\033 [ 1 ; 32 ; 40 mB . \033 [ 0 ; 37 ; 40 m Tip User
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version, ()))
2021-11-26 20:26:36 -03:00
menuTallyCo ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-11-15 20:24:59 -03:00
2021-11-26 20:26:36 -03:00
def APITallyCoOnchainONLY ( ) :
2020-11-15 20:24:59 -03:00
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-11-15 20:24:59 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 0 ; 37 ; 40 mTallyCoin
2020-11-15 20:24:59 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Get Payment
\033 [ 1 ; 32 ; 40 mB . \033 [ 0 ; 37 ; 40 m Tip User
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , d[ ' blocks ' ], version, ()))
2021-11-26 20:26:36 -03:00
menuTallyCoOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-11-15 20:24:59 -03:00
#-------------------------------- SETTINGS -----------------------------------------------
2020-05-24 14:15:12 -03:00
2020-10-17 23:16:35 -03:00
def settings4Local ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
2020-10-17 23:16:35 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-10-17 23:16:35 -03:00
2020-11-25 16:43:43 -03:00
\u001b [ 38 ; 5 ; 27 mA . \033 [ 0 ; 37 ; 40 m Change Logo Design
\u001b [ 38 ; 5 ; 27 mB . \033 [ 0 ; 37 ; 40 m Change Logo Colors
\u001b [ 38 ; 5 ; 27 mC . \033 [ 0 ; 37 ; 40 m Change Clock Colors
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
\u001b [ 38 ; 5 ; 27 mD . \033 [ 0 ; 37 ; 40 m Clock Display Settings
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n, alias[ ' alias ' ], d[ ' blocks ' ], version, ()))
2020-10-17 23:16:35 -03:00
menuSettingsLocal ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2021-11-18 23:32:22 -03:00
def settings4LocalOnchainONLY ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-18 23:32:22 -03:00
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-18 23:32:22 -03:00
b = json . loads ( a )
d = b
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\u001b [ 38 ; 5 ; 27 mA . \033 [ 0 ; 37 ; 40 m Change Logo Design
\u001b [ 38 ; 5 ; 27 mB . \033 [ 0 ; 37 ; 40 m Change Logo Colors
\u001b [ 38 ; 5 ; 27 mC . \033 [ 0 ; 37 ; 40 m Change Clock Colors
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
\u001b [ 38 ; 5 ; 27 mD . \033 [ 0 ; 37 ; 40 m Clock Display Settings
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n, d[ ' blocks ' ], version, ()))
2021-11-18 23:32:22 -03:00
menuSettingsLocalOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-10-17 23:16:35 -03:00
def settings4Remote ( ) :
2020-07-15 22:44:08 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-07-15 22:44:08 -03:00
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-07-15 22:44:08 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-07-15 22:44:08 -03:00
2020-11-25 16:43:43 -03:00
\u001b [ 38 ; 5 ; 27 mA . \033 [ 0 ; 37 ; 40 m Change Logo Design
\u001b [ 38 ; 5 ; 27 mB . \033 [ 0 ; 37 ; 40 m Change Logo Colors
\u001b [ 38 ; 5 ; 27 mC . \033 [ 0 ; 37 ; 40 m Change Clock Colors
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
\u001b [ 38 ; 5 ; 27 mD . \033 [ 0 ; 37 ; 40 m Clock Display Settings
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(a, alias[ ' alias ' ], d[ ' blocks ' ], version, ()))
2020-10-17 23:16:35 -03:00
menuSettingsRemote ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-07-15 22:44:08 -03:00
2020-07-26 14:22:22 -03:00
def designQ ( ) :
2020-07-15 22:44:08 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-07-15 22:44:08 -03:00
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-07-15 22:44:08 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-07-15 22:44:08 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Block
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Slick
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Tiny
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Grid
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Pallet
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Shade
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Chrome
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m Simple
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Simple Block
\033 [ 1 ; 31 ; 40 mJ . \033 [ 0 ; 37 ; 40 m 3 D
\033 [ 1 ; 31 ; 40 mK . \033 [ 0 ; 37 ; 40 m Simple 3 D
\033 [ 1 ; 31 ; 40 mL . \033 [ 0 ; 37 ; 40 m Huge
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version, ()))
2020-07-15 22:44:08 -03:00
menuDesign ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2021-11-22 14:48:21 -03:00
def designQOnchainONLY ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-22 14:48:21 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-22 14:48:21 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-22 14:48:21 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-22 14:48:21 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Block
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Slick
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Tiny
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Grid
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Pallet
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Shade
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Chrome
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m Simple
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Simple Block
\033 [ 1 ; 31 ; 40 mJ . \033 [ 0 ; 37 ; 40 m 3 D
\033 [ 1 ; 31 ; 40 mK . \033 [ 0 ; 37 ; 40 m Simple 3 D
\033 [ 1 ; 31 ; 40 mL . \033 [ 0 ; 37 ; 40 m Huge
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version ))
2021-11-22 14:48:21 -03:00
menuDesignOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-10-17 23:16:35 -03:00
def designC ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-10-17 23:16:35 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-10-17 23:16:35 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Block
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Slick
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Tiny
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Grid
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Pallet
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Shade
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Chrome
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m Simple
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Simple Block
\033 [ 1 ; 31 ; 40 mJ . \033 [ 0 ; 37 ; 40 m 3 D
\033 [ 1 ; 31 ; 40 mK . \033 [ 0 ; 37 ; 40 m Simple 3 D
\033 [ 1 ; 31 ; 40 mL . \033 [ 0 ; 37 ; 40 m Huge
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ()))
2020-10-17 23:16:35 -03:00
menuDesignClock ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2021-11-22 14:48:21 -03:00
def designCOnchainONLY ( ) :
2020-10-17 23:16:35 -03:00
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-10-17 23:16:35 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-10-17 23:16:35 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Block
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Slick
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Tiny
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Grid
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Pallet
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Shade
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Chrome
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m Simple
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Simple Block
\033 [ 1 ; 31 ; 40 mJ . \033 [ 0 ; 37 ; 40 m 3 D
\033 [ 1 ; 31 ; 40 mK . \033 [ 0 ; 37 ; 40 m Simple 3 D
\033 [ 1 ; 31 ; 40 mL . \033 [ 0 ; 37 ; 40 m Huge
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuDesignClockOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-10-17 23:16:35 -03:00
2021-11-22 14:48:21 -03:00
def designCRemote ( ) :
2020-07-15 22:44:08 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-07-15 22:44:08 -03:00
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-07-15 22:44:08 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-07-15 22:44:08 -03:00
2021-11-22 14:48:21 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Block
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Slick
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Tiny
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Grid
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Pallet
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Shade
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Chrome
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m Simple
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Simple Block
\033 [ 1 ; 31 ; 40 mJ . \033 [ 0 ; 37 ; 40 m 3 D
\033 [ 1 ; 31 ; 40 mK . \033 [ 0 ; 37 ; 40 m Simple 3 D
\033 [ 1 ; 31 ; 40 mL . \033 [ 0 ; 37 ; 40 m Huge
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuDesignClockRemote ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-07-15 22:44:08 -03:00
2021-11-22 14:48:21 -03:00
def colors ( ) :
2020-10-17 23:16:35 -03:00
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-10-17 23:16:35 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-10-17 23:16:35 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Front Color
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Back Color
2021-11-22 14:48:21 -03:00
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Rainbow
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColors ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-10-17 23:16:35 -03:00
2021-11-22 14:48:21 -03:00
def colorsOnchainONLY ( ) :
2020-10-17 23:16:35 -03:00
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-10-17 23:16:35 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-10-17 23:16:35 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Front Color
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Back Color
2021-11-22 14:48:21 -03:00
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Rainbow
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-10-17 23:16:35 -03:00
2021-11-22 14:48:21 -03:00
def colorsC ( ) :
2020-07-15 22:44:08 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-07-15 22:44:08 -03:00
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-07-15 22:44:08 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-07-15 22:44:08 -03:00
2021-11-22 14:48:21 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Front Color
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Back Color
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsClock ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-07-15 22:44:08 -03:00
2021-11-22 14:48:21 -03:00
def colorsCOnchainONLY ( ) :
2020-10-17 23:16:35 -03:00
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-10-17 23:16:35 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-10-17 23:16:35 -03:00
2021-11-22 14:48:21 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Front Color
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Back Color
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsClockOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-10-17 23:16:35 -03:00
2021-11-22 14:48:21 -03:00
def colorsCRemote ( ) :
2020-10-17 23:16:35 -03:00
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-19 02:26:27 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-10-17 23:16:35 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-10-17 23:16:35 -03:00
2021-11-22 14:48:21 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Front Color
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Back Color
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsClockRemote ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-10-17 23:16:35 -03:00
2021-11-22 14:48:21 -03:00
def colorsSelectFront ( ) :
2020-07-15 22:44:08 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-07-15 22:44:08 -03:00
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-22 22:20:00 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-07-15 22:44:08 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-07-15 22:44:08 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Black
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Red
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Green
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Yellow
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Blue
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Magenta
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Cyan
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m White
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Gray
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsSelectFront ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-07-15 22:44:08 -03:00
2021-11-22 14:48:21 -03:00
def colorsSelectFrontOnchainONLY ( ) :
2020-10-17 23:16:35 -03:00
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-22 22:20:00 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-10-17 23:16:35 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-10-17 23:16:35 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Black
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Red
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Green
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Yellow
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Blue
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Magenta
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Cyan
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m White
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Gray
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a ,d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsSelectFrontOncainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-10-17 23:16:35 -03:00
2021-11-22 14:48:21 -03:00
def colorsSelectFrontClock ( ) :
2020-10-17 23:16:35 -03:00
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-22 22:20:00 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-10-17 23:16:35 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-10-17 23:16:35 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Black
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Red
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Green
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Yellow
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Blue
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Magenta
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Cyan
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m White
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Gray
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsSelectFrontClock ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-10-17 23:16:35 -03:00
2021-11-22 14:48:21 -03:00
def colorsSelectFrontClockOnchainONLY ( ) :
2020-07-15 22:44:08 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-07-15 22:44:08 -03:00
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-22 22:20:00 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2020-11-25 23:16:31 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-07-15 22:44:08 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-07-15 22:44:08 -03:00
2021-11-22 14:48:21 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Black
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Red
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Green
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Yellow
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Blue
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Magenta
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Cyan
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m White
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Gray
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsSelectFrontClockOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
def colorsSelectFrontClockRemote ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2021-11-22 14:48:21 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-22 14:48:21 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2021-11-22 14:48:21 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-22 14:48:21 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-22 22:20:00 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-22 14:48:21 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Black
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Red
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Green
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Yellow
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Blue
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Magenta
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Cyan
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m White
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Gray
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsSelectFrontClockRemote ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
def colorsSelectBack ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2021-11-22 14:48:21 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-22 14:48:21 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2021-11-22 14:48:21 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-22 14:48:21 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-22 22:20:00 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-22 14:48:21 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Black
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Red
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Green
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Yellow
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Blue
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Magenta
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Cyan
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m White
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Gray
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsSelectBack ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
def colorsSelectBackOnchainONLY ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-22 14:48:21 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " RemotcolorsCe "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-22 14:48:21 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-22 14:48:21 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-04-12 21:04:45 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-22 14:48:21 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Black
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Red
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Green
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Yellow
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Blue
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Magenta
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Cyan
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m White
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Gray
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a, d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsSelectBackOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
def colorsSelectBackClock ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2021-11-22 14:48:21 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-22 14:48:21 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2021-11-22 14:48:21 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2021-11-22 14:48:21 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-22 14:48:21 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-10-03 16:14:20 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-22 14:48:21 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Black
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Red
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Green
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Yellow
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Blue
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Magenta
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Cyan
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m White
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Gray
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsSelectBackClock ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
def colorsSelectBackClockOnchainONLY ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-22 14:48:21 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-22 14:48:21 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-22 14:48:21 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-10-03 16:14:20 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-22 14:48:21 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Black
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Red
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Green
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Yellow
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Blue
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Magenta
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Cyan
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m White
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Gray
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsSelectBackClockOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
def colorsSelectBackClockRemote ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2021-11-22 14:48:21 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-22 14:48:21 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2021-11-22 14:48:21 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-22 14:48:21 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-10-03 16:14:20 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-22 14:48:21 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Black
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Red
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Green
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Yellow
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Blue
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Magenta
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Cyan
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m White
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Gray
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsSelectBackClockRemote ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
def colorsSelectRainbow ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2021-11-22 14:48:21 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-22 14:48:21 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2021-11-22 14:48:21 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-22 14:48:21 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-10-03 16:14:20 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-22 14:48:21 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Start Color
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m End Color
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsSelectRainbow ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
def colorsSelectRainbowOnchainONLY ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-22 14:48:21 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-22 14:48:21 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-22 14:48:21 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-10-03 16:14:20 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-22 14:48:21 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Start Color
2020-07-15 22:44:08 -03:00
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m End Color
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsSelectRainbowOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
def colorsSelectRainbowStart ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2021-11-22 14:48:21 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-22 14:48:21 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2021-11-22 14:48:21 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-22 14:48:21 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-10-03 16:14:20 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-22 14:48:21 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Black
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Red
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Green
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Yellow
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Blue
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Magenta
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Cyan
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m White
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Gray
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsSelectRainbowStart ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-07-15 22:44:08 -03:00
2021-11-22 14:48:21 -03:00
def colorsSelectRainbowStartOnchaiONLY ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2021-11-22 14:48:21 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2021-11-22 14:48:21 -03:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2021-11-22 14:48:21 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-10-03 16:14:20 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/getinfo '
2021-11-22 14:48:21 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
print ( """ \t \t
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Black
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Red
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Green
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Yellow
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Blue
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Magenta
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Cyan
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m White
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Gray
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsSelectRainbowStartOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
def colorsSelectRainbowEnd ( ) :
2020-07-15 22:44:08 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-07-15 22:44:08 -03:00
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
url = ' https:// {} /v1/getinfo ' . format ( lndconnectload [ " ip_port " ] )
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-07-15 22:44:08 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-07-15 22:44:08 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Black
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Red
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Green
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Yellow
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Blue
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Magenta
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Cyan
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m White
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Gray
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , alias[ ' alias ' ], d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsSelectRainbowEnd ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-07-15 22:44:08 -03:00
2021-11-22 14:48:21 -03:00
def colorsSelectRainbowEndOnchainONLY ( ) :
2020-07-15 22:44:08 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-07-15 22:44:08 -03:00
sysinfo ( )
2022-03-17 21:37:11 -03:00
pathexec ( )
lndconnectexec ( )
2020-11-25 23:16:31 -03:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2020-11-25 23:16:31 -03:00
b = json . loads ( a )
d = b
lncli = " getinfo "
2026-04-02 17:35:03 -03:00
lsd = _run_ln ( lncli )
2020-11-25 23:16:31 -03:00
lsd0 = str ( lsd )
alias = json . loads ( lsd0 )
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
cert_path = lndconnectload [ " tls " ]
2026-04-03 10:57:20 -03:00
macaroon = _load_macaroon ( )
2020-11-25 23:16:31 -03:00
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
url = ' https:// {} /v1/getinfo ' . format ( lndconnectload [ " ip_port " ] )
r = requests . get ( url , headers = headers , verify = cert_path )
alias = r . json ( )
2020-07-15 22:44:08 -03:00
print ( """ \t \t
2020-11-25 23:16:31 -03:00
\033 [ 1 ; 37 ; 40 m { } \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 31 ; 40 mPyBLOCK \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mNode \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mBlock \033 [ 0 ; 37 ; 40 m : \033 [ 1 ; 32 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\033 [ 1 ; 37 ; 40 mVersion \033 [ 0 ; 37 ; 40 m : { }
2020-07-09 19:41:54 -03:00
2020-11-15 20:24:59 -03:00
\033 [ 1 ; 32 ; 40 mA . \033 [ 0 ; 37 ; 40 m Black
\033 [ 1 ; 31 ; 40 mB . \033 [ 0 ; 37 ; 40 m Red
\033 [ 1 ; 31 ; 40 mC . \033 [ 0 ; 37 ; 40 m Green
\033 [ 1 ; 31 ; 40 mD . \033 [ 0 ; 37 ; 40 m Yellow
\033 [ 1 ; 31 ; 40 mE . \033 [ 0 ; 37 ; 40 m Blue
\033 [ 1 ; 31 ; 40 mF . \033 [ 0 ; 37 ; 40 m Magenta
\033 [ 1 ; 31 ; 40 mG . \033 [ 0 ; 37 ; 40 m Cyan
\033 [ 1 ; 31 ; 40 mH . \033 [ 0 ; 37 ; 40 m White
\033 [ 1 ; 31 ; 40 mI . \033 [ 0 ; 37 ; 40 m Gray
2024-07-22 17:53:52 -03:00
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
2023-09-20 19:40:35 -03:00
\n \n \x1b [ ? 25 h """ .format(n if path[ ' bitcoincli ' ] else a , d[ ' blocks ' ], version ()))
2021-11-22 14:48:21 -03:00
menuColorsSelectRainbowEndOnchainONLY ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
2020-07-09 19:41:54 -03:00
2020-06-11 19:49:41 -03:00
def menuSelection ( ) :
2022-03-16 00:31:26 -03:00
chln = { " fullbtclnd " : " " , " fullbtc " : " " , " cropped " : " " }
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
if cfg . has_config ( ' intro.conf ' ) :
chln = cfg . intro_mode
2022-03-16 00:31:26 -03:00
print ( chln + " \n " )
2022-03-16 20:52:13 -03:00
if chln == " B " :
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
path = cfg . path
2022-03-16 20:52:13 -03:00
MainMenuLOCALChainONLY ( )
elif chln == " A " :
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
path = cfg . path
2022-03-16 20:52:13 -03:00
MainMenuLOCAL ( )
elif chln == " C " :
2026-04-01 15:05:25 -03:00
from SPV . spvblock import MainMenuCROPPED as _lite_menu
_lite_menu ( )
2020-06-11 16:40:02 -03:00
else :
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
if cfg . has_config ( ' blndconnect.conf ' ) :
2021-11-18 23:32:22 -03:00
chln [ ' offchain ' ] = " offchain "
else :
chln [ ' onchain ' ] = " onchain "
2021-11-24 10:49:20 +00:00
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
cfg . save ( " selection.conf " , chln )
2021-11-18 23:32:22 -03:00
2020-06-11 19:49:41 -03:00
2020-06-11 16:40:02 -03:00
def menuSelectionLN ( ) :
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
lndconnectload = cfg . lndconnectload
2020-06-11 19:49:41 -03:00
if lndconnectload [ ' ln ' ] :
2020-06-10 19:02:49 -03:00
menuLNDLOCAL ( )
else :
menuLND ( )
2020-06-19 17:51:28 -03:00
def aaccPPiLNBits ( ) :
2026-04-02 09:48:58 -03:00
if cfg . has_config ( ' lnbitSN.conf ' ) :
APILnbit ( )
else :
createFileConnLNBits ( )
2020-06-19 17:51:28 -03:00
2020-06-22 14:26:07 -03:00
def aaccPPiLNPay ( ) :
2026-04-02 09:48:58 -03:00
if cfg . has_config ( ' lnpaySN.conf ' ) :
APILnPay ( )
else :
createFileConnLNPay ( )
2020-06-22 14:26:07 -03:00
def aaccPPiOpenNode ( ) :
2026-04-02 09:48:58 -03:00
if cfg . has_config ( ' opennodeSN.conf ' ) :
APIOpenNode ( )
else :
createFileConnOpenNode ( )
2020-06-22 20:57:57 -03:00
2020-10-05 22:53:40 -03:00
2020-06-22 20:57:57 -03:00
def aaccPPiTippinMe ( ) :
2021-12-03 23:55:49 -03:00
if os . path . isfile ( ' config/tippinme.conf ' ) : # Check if the file 'bclock.conf' is in the same folder
2020-06-22 20:57:57 -03:00
APITippinMe ( )
else :
2020-06-22 22:02:00 -03:00
createFileTippinMe ( )
2020-07-09 19:41:54 -03:00
def aaccPPiTallyCo ( ) :
2021-12-03 23:55:49 -03:00
if os . path . isfile ( ' config/tallyco.conf ' ) : # Check if the file 'bclock.conf' is in the same folder
2020-07-09 19:41:54 -03:00
APITallyCo ( )
else :
createFileConnTallyCo ( )
2020-07-13 19:28:56 -03:00
2023-09-20 19:40:35 -03:00
""" def ():
2020-07-13 19:28:56 -03:00
r = requests . get ( ' https://raw.githubusercontent.com/curly60e/pyblock/master/ver.txt ' )
r . headers [ ' Content-Type ' ]
n = r . text
di = json . loads ( n )
if di [ ' version ' ] == version :
q = print ( " " )
2020-07-13 22:30:35 +00:00
else :
2021-04-10 23:58:35 -03:00
print ( " \n ------------------------------------------ " )
2021-12-04 08:14:11 -03:00
q = print ( " \033 [1;31;40mNew version available \033 [0;37;40m > Exit and $pip3 install pybitblock -U " )
2023-09-20 19:40:35 -03:00
print ( " ------------------------------------------ " ) """
2020-07-13 19:28:56 -03:00
2020-07-15 22:44:08 -03:00
def testlogo ( ) :
output = render ( ' PyBLOCK ' , colors = [ settings [ ' colorA ' ] , settings [ ' colorB ' ] ] , align = ' left ' , font = settings [ ' design ' ] )
print ( output )
print ( """
- - - - - - - - - - - - - - - - - - - - - - - - -
Design : { }
Front Color : { }
Back Color : { }
- - - - - - - - - - - - - - - - - - - - - - - - -
""" .format(settings[ ' design ' ], settings[ ' colorA ' ], settings[ ' colorB ' ]))
try :
print ( " <<< Cancel Control + C " )
input ( " Enter To Apply... " )
settings [ " gradient " ] = " color "
2026-04-01 10:24:47 -03:00
with open ( " config/pyblocksettings.conf " , " w " ) as f : json . dump ( settings , f , indent = 2 )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2020-07-15 22:44:08 -03:00
def testlogoRB ( ) :
output = render ( ' PyBLOCK ' , gradient = [ settings [ ' colorA ' ] , settings [ ' colorB ' ] ] , align = ' left ' , font = settings [ ' design ' ] )
print ( output )
print ( """
- - - - - - - - - - - - - - - - - - - - - - - - -
Design : { }
Start Color : { }
End Color : { }
- - - - - - - - - - - - - - - - - - - - - - - - -
""" .format(settings[ ' design ' ], settings[ ' colorA ' ], settings[ ' colorB ' ]))
try :
print ( " <<< Cancel Control + C " )
input ( " Enter To Apply... " )
settings [ " gradient " ] = " grd "
2026-04-01 10:24:47 -03:00
with open ( " config/pyblocksettings.conf " , " w " ) as f : json . dump ( settings , f , indent = 2 )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2020-10-17 23:16:35 -03:00
def testClock ( ) :
2022-03-17 21:37:11 -03:00
pathexec ( )
#lndconnectexec()
2026-04-02 17:35:03 -03:00
block = _run_btc ( " getblockcount " )
2020-10-17 23:16:35 -03:00
b = block
output = render ( str ( b ) , colors = [ settingsClock [ ' colorA ' ] , settingsClock [ ' colorB ' ] ] , align = ' left ' )
print ( output )
print ( """
- - - - - - - - - - - - - - - - - - - - - - - - -
Front Color : { }
Back Color : { }
- - - - - - - - - - - - - - - - - - - - - - - - -
2020-07-15 22:44:08 -03:00
2020-10-17 23:16:35 -03:00
""" .format(settingsClock[ ' colorA ' ], settingsClock[ ' colorB ' ]))
try :
print ( " <<< Cancel Control + C " )
input ( " Enter To Apply... " )
settingsClock [ " gradient " ] = " color "
2026-04-01 10:24:47 -03:00
with open ( " config/pyblocksettingsClock.conf " , " w " ) as f : json . dump ( settingsClock , f , indent = 2 )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2020-07-15 22:44:08 -03:00
2020-06-10 19:02:49 -03:00
#--------------------------------- End Menu section -----------------------------------
2020-05-16 12:51:30 -03:00
#--------------------------------- Main Menu execution --------------------------------
2020-10-17 23:16:35 -03:00
def menuSettingsLocal ( menuSTT ) :
2020-07-15 22:44:08 -03:00
if menuSTT in [ " A " , " a " ] :
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-07-26 14:22:22 -03:00
designQ ( )
2020-07-15 22:44:08 -03:00
elif menuSTT in [ " B " , " b " ] :
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-07-15 22:44:08 -03:00
colors ( )
2020-10-17 23:16:35 -03:00
elif menuSTT in [ " C " , " c " ] :
clear ( )
blogo ( )
colorsC ( )
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
elif menuSTT in [ " D " , " d " ] :
clockDisplaySettings ( )
2020-10-17 23:16:35 -03:00
2021-11-18 23:32:22 -03:00
def menuSettingsLocalOnchainONLY ( menuSTT ) :
if menuSTT in [ " A " , " a " ] :
clear ( )
blogo ( )
2021-11-22 14:48:21 -03:00
designQOnchainONLY ( )
2021-11-18 23:32:22 -03:00
elif menuSTT in [ " B " , " b " ] :
clear ( )
blogo ( )
2021-11-22 14:48:21 -03:00
colorsOnchainONLY ( )
2021-11-18 23:32:22 -03:00
elif menuSTT in [ " C " , " c " ] :
clear ( )
blogo ( )
2021-11-22 14:48:21 -03:00
colorsCOnchainONLY ( )
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
elif menuSTT in [ " D " , " d " ] :
clockDisplaySettings ( )
2021-11-18 23:32:22 -03:00
2020-10-17 23:16:35 -03:00
def menuSettingsRemote ( menuSTT ) :
if menuSTT in [ " A " , " a " ] :
clear ( )
blogo ( )
designQ ( )
elif menuSTT in [ " B " , " b " ] :
clear ( )
blogo ( )
colors ( )
elif menuSTT in [ " C " , " c " ] :
clear ( )
blogo ( )
colorsCRemote ( )
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
elif menuSTT in [ " D " , " d " ] :
clockDisplaySettings ( )
def clockDisplaySettings ( ) :
""" Interactive settings menu for clock display features. """
while True :
try :
clear ( )
blogo ( )
s = cfg . settings_clock
def _on_off ( val ) :
return " \033 [1;32;40mON \033 [0;37;40m " if val else " \033 [1;31;40mOFF \033 [0;37;40m "
print ( """ \t \t
\033 [ 1 ; 37 ; 40 mClock Display Settings \033 [ 0 ; 37 ; 40 m
\u001b [ 38 ; 5 ; 27 m1 . \033 [ 0 ; 37 ; 40 m Countdown Timer { }
\u001b [ 38 ; 5 ; 27 m2 . \033 [ 0 ; 37 ; 40 m Epoch Progress Bar { }
\u001b [ 38 ; 5 ; 27 m3 . \033 [ 0 ; 37 ; 40 m Fee Rate Indicator { }
\u001b [ 38 ; 5 ; 27 m4 . \033 [ 0 ; 37 ; 40 m Hashrate Sparkline { }
\u001b [ 38 ; 5 ; 27 m5 . \033 [ 0 ; 37 ; 40 m UTC Time Display { }
\u001b [ 38 ; 5 ; 27 m6 . \033 [ 0 ; 37 ; 40 m Zen Mode { }
\u001b [ 38 ; 5 ; 27 m7 . \033 [ 0 ; 37 ; 40 m Heartbeat Pulse { }
\u001b [ 38 ; 5 ; 27 m8 . \033 [ 0 ; 37 ; 40 m Generative Art { }
\u001b [ 38 ; 5 ; 27 m9 . \033 [ 0 ; 37 ; 40 m Fireworks on Milestones { }
2026-04-02 09:08:18 -03:00
\033 [ 1 ; 37 ; 40 m - - - Visual - - - \033 [ 0 ; 37 ; 40 m
\u001b [ 38 ; 5 ; 27 mM . \033 [ 0 ; 37 ; 40 m Miner Pool Tag { }
\u001b [ 38 ; 5 ; 27 mW . \033 [ 0 ; 37 ; 40 m Block Weight Meter { }
\u001b [ 38 ; 5 ; 27 mT . \033 [ 0 ; 37 ; 40 m Block Time Histogram { }
\u001b [ 38 ; 5 ; 27 mP . \033 [ 0 ; 37 ; 40 m Peer Count { }
\u001b [ 38 ; 5 ; 27 mL . \033 [ 0 ; 37 ; 40 m Moon Phase { }
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
\u001b [ 38 ; 5 ; 27 mA . \033 [ 0 ; 37 ; 40 m Animation : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\u001b [ 38 ; 5 ; 27 mS . \033 [ 0 ; 37 ; 40 m Sound : \033 [ 1 ; 33 ; 40 m { } \033 [ 0 ; 37 ; 40 m
\u001b [ 33 ; 1 mEnter . \033 [ 0 ; 37 ; 40 m Return
\n \x1b [ ? 25 h """ .format(
_on_off ( s . get ( ' show_countdown ' , True ) ) ,
_on_off ( s . get ( ' show_epoch_bar ' , True ) ) ,
_on_off ( s . get ( ' show_fee_rates ' , True ) ) ,
_on_off ( s . get ( ' show_sparkline ' , False ) ) ,
_on_off ( s . get ( ' show_utc_time ' , False ) ) ,
_on_off ( s . get ( ' zen_mode ' , False ) ) ,
_on_off ( s . get ( ' heartbeat ' , True ) ) ,
_on_off ( s . get ( ' generative_art ' , False ) ) ,
_on_off ( s . get ( ' fireworks ' , True ) ) ,
2026-04-02 09:08:18 -03:00
_on_off ( s . get ( ' show_miner_pool ' , True ) ) ,
_on_off ( s . get ( ' show_block_weight ' , False ) ) ,
_on_off ( s . get ( ' show_block_times ' , True ) ) ,
_on_off ( s . get ( ' show_peers ' , False ) ) ,
_on_off ( s . get ( ' show_moon ' , False ) ) ,
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
s . get ( ' animation ' , ' matrix ' ) ,
s . get ( ' sound ' , ' bell ' ) ,
) )
opt = input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) . strip ( )
toggles = {
' 1 ' : ' show_countdown ' , ' 2 ' : ' show_epoch_bar ' ,
' 3 ' : ' show_fee_rates ' , ' 4 ' : ' show_sparkline ' ,
' 5 ' : ' show_utc_time ' , ' 6 ' : ' zen_mode ' ,
' 7 ' : ' heartbeat ' , ' 8 ' : ' generative_art ' ,
' 9 ' : ' fireworks ' ,
}
2026-04-02 09:08:18 -03:00
toggles_alpha = {
' M ' : ' show_miner_pool ' , ' m ' : ' show_miner_pool ' ,
' W ' : ' show_block_weight ' , ' w ' : ' show_block_weight ' ,
' T ' : ' show_block_times ' , ' t ' : ' show_block_times ' ,
' P ' : ' show_peers ' , ' p ' : ' show_peers ' ,
' L ' : ' show_moon ' , ' l ' : ' show_moon ' ,
}
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
if opt in toggles :
key = toggles [ opt ]
s [ key ] = not s . get ( key , False )
cfg . save ( " pyblocksettingsClock.conf " , s )
2026-04-02 09:08:18 -03:00
elif opt in toggles_alpha :
key = toggles_alpha [ opt ]
s [ key ] = not s . get ( key , False )
cfg . save ( " pyblocksettingsClock.conf " , s )
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
elif opt in [ ' A ' , ' a ' ] :
modes = [ ' matrix ' , ' odometer ' , ' none ' ]
current = s . get ( ' animation ' , ' matrix ' )
idx = ( modes . index ( current ) + 1 ) % len ( modes ) if current in modes else 0
s [ ' animation ' ] = modes [ idx ]
cfg . save ( " pyblocksettingsClock.conf " , s )
elif opt in [ ' S ' , ' s ' ] :
modes = [ ' bell ' , ' pattern ' , ' silent ' ]
current = s . get ( ' sound ' , ' bell ' )
idx = ( modes . index ( current ) + 1 ) % len ( modes ) if current in modes else 0
s [ ' sound ' ] = modes [ idx ]
cfg . save ( " pyblocksettingsClock.conf " , s )
else :
break
except KeyboardInterrupt :
break
2020-07-15 22:44:08 -03:00
def menuColors ( menuCLS ) :
if menuCLS in [ " A " , " a " ] :
colorsSelectFront ( )
elif menuCLS in [ " B " , " b " ] :
colorsSelectBack ( )
elif menuCLS in [ " C " , " c " ] :
colorsSelectRainbow ( )
elif menuCLS in [ " F " , " f " ] :
colors ( )
2021-11-22 14:48:21 -03:00
def menuColorsOnchainONLY ( menuCLS ) :
if menuCLS in [ " A " , " a " ] :
colorsSelectFrontOnchainONLY ( )
elif menuCLS in [ " B " , " b " ] :
colorsSelectBackOnchainONLY ( )
elif menuCLS in [ " C " , " c " ] :
colorsSelectRainbowOnchainONLY ( )
elif menuCLS in [ " F " , " f " ] :
colorsOnchainONLY ( )
2020-10-17 23:16:35 -03:00
def menuColorsClock ( menuCLS ) :
if menuCLS in [ " A " , " a " ] :
colorsSelectFrontClock ( )
elif menuCLS in [ " B " , " b " ] :
colorsSelectBackClock ( )
elif menuCLS in [ " F " , " f " ] :
colors ( )
2021-11-22 14:48:21 -03:00
def menuColorsClockOnchainONLY ( menuCLS ) :
if menuCLS in [ " A " , " a " ] :
colorsSelectFrontClockOnchainONLY ( )
elif menuCLS in [ " B " , " b " ] :
colorsSelectBackClockOnchainONLY ( )
elif menuCLS in [ " F " , " f " ] :
colorsOnchainONLY ( )
2020-10-17 23:16:35 -03:00
def menuColorsClockRemote ( menuCLS ) :
if menuCLS in [ " A " , " a " ] :
colorsSelectFrontClockRemote ( )
elif menuCLS in [ " B " , " b " ] :
colorsSelectBackClockRemote ( )
elif menuCLS in [ " F " , " f " ] :
colors ( )
2020-07-15 22:44:08 -03:00
def menuColorsSelectRainbow ( menuRF ) :
if menuRF in [ " A " , " a " ] :
colorsSelectRainbowStart ( )
elif menuRF in [ " B " , " b " ] :
colorsSelectRainbowEnd ( )
elif menuRF in [ " F " , " f " ] :
colors ( )
2021-11-22 14:48:21 -03:00
def menuColorsSelectRainbowOnchainONLY ( menuRF ) :
if menuRF in [ " A " , " a " ] :
colorsSelectRainbowStartOnchaiONLY ( )
elif menuRF in [ " B " , " b " ] :
colorsSelectRainbowEndOnchainONLY ( )
elif menuRF in [ " F " , " f " ] :
colorsOnchainONLY ( )
2020-07-15 22:44:08 -03:00
def menuColorsSelectRainbowEnd ( menuCF ) :
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
select_color ( settings , " colorB " , testlogoRB , colors )
def menuColorsSelectRainbowEndOnchainONLY ( menuCF ) :
select_color ( settings , " colorB " , testlogoRB , colorsOnchainONLY )
def menuColorsSelectRainbowStart ( menuCF ) :
select_color ( settings , " colorA " , testlogoRB , colors )
def menuColorsSelectRainbowStartOnchainONLY ( menuCF ) :
select_color ( settings , " colorA " , testlogoRB , colorsOnchainONLY )
def menuColorsSelectBack ( menuCF ) :
select_color ( settings , " colorB " , testlogo , colors )
def menuColorsSelectBackOnchainONLY ( menuCF ) :
select_color ( settings , " colorB " , testlogo , colorsOnchainONLY )
def menuColorsSelectFront ( menuCF ) :
select_color ( settings , " colorA " , testlogo , colors )
def menuColorsSelectFrontOncainONLY ( menuCF ) :
select_color ( settings , " colorA " , testlogo , colorsOnchainONLY )
def menuColorsSelectFrontClock ( menuCF ) :
select_color ( settingsClock , " colorA " , testClock , colors )
def menuColorsSelectFrontClockOnchainONLY ( menuCF ) :
select_color ( settingsClock , " colorA " , testClock , colorsOnchainONLY )
def menuColorsSelectBackClock ( menuCF ) :
select_color ( settingsClock , " colorB " , testClock , colors )
def menuColorsSelectBackClockOnchainONLY ( menuCF ) :
select_color ( settingsClock , " colorB " , testClock , colorsOnchainONLY )
def menuColorsSelectFrontClockRemote ( menuCF ) :
select_color ( settingsClock , " colorA " , testClockRemote , colors )
def menuColorsSelectBackClockRemote ( menuCF ) :
select_color ( settingsClock , " colorB " , testClockRemote , colors )
def menuDesign ( menuDSN ) :
if menuDSN in [ " A " , " a " ] :
2020-07-15 22:44:08 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
settings [ " design " ] = " block "
testlogo ( )
elif menuDSN in [ " B " , " b " ] :
2020-07-15 22:44:08 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
settings [ ' design ' ] = " slick "
testlogo ( )
elif menuDSN in [ " C " , " c " ] :
2020-07-15 22:44:08 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
settings [ ' design ' ] = " tiny "
2020-07-15 22:44:08 -03:00
testlogo ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
elif menuDSN in [ " D " , " d " ] :
2020-07-15 22:44:08 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
settings [ ' design ' ] = " grid "
testlogo ( )
elif menuDSN in [ " E " , " e " ] :
2020-07-15 22:44:08 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
settings [ ' design ' ] = " pallet "
testlogo ( )
elif menuDSN in [ " F " , " f " ] :
2020-07-15 22:44:08 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
settings [ ' design ' ] = " shade "
testlogo ( )
elif menuDSN in [ " G " , " g " ] :
2020-07-15 22:44:08 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
settings [ ' design ' ] = " chrome "
testlogo ( )
elif menuDSN in [ " H " , " h " ] :
2020-07-15 22:44:08 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
settings [ ' design ' ] = " simple "
testlogo ( )
elif menuDSN in [ " I " , " i " ] :
2021-11-22 14:48:21 -03:00
clear ( )
blogo ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
settings [ ' design ' ] = " simpleBlock "
testlogo ( )
elif menuDSN in [ " J " , " j " ] :
2021-11-22 14:48:21 -03:00
clear ( )
blogo ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
settings [ ' design ' ] = " 3d "
testlogo ( )
elif menuDSN in [ " K " , " k " ] :
2021-11-22 14:48:21 -03:00
clear ( )
blogo ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
settings [ ' design ' ] = " simple3d "
testlogo ( )
elif menuDSN in [ " L " , " l " ] :
2021-11-22 14:48:21 -03:00
clear ( )
blogo ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
settings [ ' design ' ] = " huge "
2021-11-22 14:48:21 -03:00
testlogo ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
def menuDesignOnchainONLY ( menuDSN ) :
if menuDSN in [ " A " , " a " ] :
2021-11-22 14:48:21 -03:00
clear ( )
blogo ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
settings [ " design " ] = " block "
testlogo ( )
elif menuDSN in [ " B " , " b " ] :
2021-11-22 14:48:21 -03:00
clear ( )
blogo ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
settings [ ' design ' ] = " slick "
testlogo ( )
elif menuDSN in [ " C " , " c " ] :
2021-11-22 14:48:21 -03:00
clear ( )
blogo ( )
settings [ ' design ' ] = " tiny "
testlogo ( )
elif menuDSN in [ " D " , " d " ] :
clear ( )
blogo ( )
settings [ ' design ' ] = " grid "
testlogo ( )
elif menuDSN in [ " E " , " e " ] :
clear ( )
blogo ( )
settings [ ' design ' ] = " pallet "
testlogo ( )
elif menuDSN in [ " F " , " f " ] :
clear ( )
blogo ( )
settings [ ' design ' ] = " shade "
testlogo ( )
elif menuDSN in [ " G " , " g " ] :
clear ( )
blogo ( )
settings [ ' design ' ] = " chrome "
testlogo ( )
elif menuDSN in [ " H " , " h " ] :
clear ( )
blogo ( )
settings [ ' design ' ] = " simple "
testlogo ( )
elif menuDSN in [ " I " , " i " ] :
clear ( )
blogo ( )
settings [ ' design ' ] = " simpleBlock "
testlogo ( )
elif menuDSN in [ " J " , " j " ] :
clear ( )
blogo ( )
settings [ ' design ' ] = " 3d "
testlogo ( )
elif menuDSN in [ " K " , " k " ] :
clear ( )
blogo ( )
settings [ ' design ' ] = " simple3d "
testlogo ( )
elif menuDSN in [ " L " , " l " ] :
clear ( )
blogo ( )
settings [ ' design ' ] = " huge "
testlogo ( )
2020-09-18 19:34:48 -03:00
#------------API---------------------
2023-09-20 22:18:49 +02:00
def OwnNodeMinerControl ( menuMin ) :
2023-09-10 18:42:45 +02:00
if menuMin in [ " A " , " a " ] :
2023-09-10 18:38:45 +02:00
OwnNodeMinerComputer ( )
2023-09-10 18:42:45 +02:00
elif menuMin in [ " B " , " b " ] :
2023-09-10 18:34:51 +02:00
OwnNodeMinerRaspberry ( )
2023-09-10 18:42:45 +02:00
elif menuMin in [ " R " , " r " ] :
2023-09-10 18:34:51 +02:00
menuSelection ( )
2023-09-20 23:03:13 +02:00
def OwnNodeMinerControlONCHAIN ( menuMino ) :
2023-09-20 22:49:25 +02:00
if menuMino in [ " A " , " a " ] :
2023-09-20 18:56:54 +02:00
OwnNodeMinerComputer ( )
2023-09-20 22:49:25 +02:00
elif menuMino in [ " B " , " b " ] :
2023-09-20 18:56:54 +02:00
OwnNodeMinerRaspberry ( )
2023-09-20 22:49:25 +02:00
elif menuMino in [ " R " , " r " ] :
2023-09-20 18:56:54 +02:00
menuSelection ( )
2020-07-14 20:04:00 -03:00
def mempoolmenuS ( menuMem ) :
if menuMem in [ " A " , " a " ] :
blocks ( )
elif menuMem in [ " B " , " b " ] :
fee ( )
2024-07-19 02:40:33 +02:00
elif menuMem in [ " C " , " c " ] :
MemShell ( )
2020-07-14 20:04:00 -03:00
elif menuMem in [ " R " , " r " ] :
2020-11-25 23:16:31 -03:00
menuSelection ( )
2020-07-14 20:04:00 -03:00
2021-11-26 20:26:36 -03:00
def mempoolmenuSOnchainONLY ( menuMem ) :
if menuMem in [ " A " , " a " ] :
blocks ( )
elif menuMem in [ " B " , " b " ] :
fee ( )
2024-07-19 02:40:33 +02:00
elif menuMem in [ " C " , " c " ] :
MemShell ( )
2021-11-26 20:26:36 -03:00
elif menuMem in [ " R " , " r " ] :
menuSelection ( )
2020-07-09 19:41:54 -03:00
def menuTallyCo ( menuTLC ) :
if menuTLC in [ " A " , " a " ] :
tallycoGetPayment ( )
elif menuTLC in [ " B " , " b " ] :
tallycoDonateid ( )
elif menuTLC in [ " R " , " r " ] :
2020-11-25 23:16:31 -03:00
menuSelection ( )
2020-07-09 19:41:54 -03:00
2021-11-26 20:26:36 -03:00
def menuTallyCoOnchainONLY ( menuTLC ) :
if menuTLC in [ " A " , " a " ] :
tallycoGetPayment ( )
elif menuTLC in [ " B " , " b " ] :
tallycoDonateid ( )
elif menuTLC in [ " R " , " r " ] :
menuSelection ( )
2020-06-22 20:57:57 -03:00
def menuTippinMe ( menuTM ) :
2020-06-25 18:53:52 +00:00
if menuTM in [ " A " , " a " ] :
2020-06-22 20:57:57 -03:00
tippinmeGetInvoice ( )
2020-06-25 16:03:22 -03:00
elif menuTM in [ " R " , " r " ] :
2020-11-25 23:16:31 -03:00
menuSelection ( )
2020-06-22 20:57:57 -03:00
2021-11-26 20:26:36 -03:00
def menuTippinMeOnchainONLY ( menuTM ) :
if menuTM in [ " A " , " a " ] :
tippinmeGetInvoice ( )
elif menuTM in [ " R " , " r " ] :
menuSelection ( )
2020-06-22 14:26:07 -03:00
def menuOpenNode ( menuOP ) :
2020-06-25 18:53:52 +00:00
if menuOP in [ " A " , " a " ] :
2020-06-22 14:26:07 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-22 14:26:07 -03:00
OpenNodecreatecharge ( )
2020-06-25 16:03:22 -03:00
elif menuOP in [ " B " , " b " ] :
2020-06-22 14:26:07 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-22 14:26:07 -03:00
OpenNodeiniciatewithdrawal ( )
2020-06-25 16:03:22 -03:00
elif menuOP in [ " C " , " c " ] :
2020-06-22 14:26:07 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-22 14:26:07 -03:00
OpenNodelistfunds ( )
2020-06-25 16:03:22 -03:00
elif menuOP in [ " D " , " d " ] :
2020-06-22 14:26:07 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-22 14:26:07 -03:00
OpenNodeListPayments ( )
2020-06-27 17:30:01 -03:00
elif menuOP in [ " S " , " s " ] :
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-27 17:30:01 -03:00
OpenNodeCheckStatus ( )
2020-06-25 16:03:22 -03:00
elif menuOP in [ " R " , " r " ] :
2020-11-25 23:16:31 -03:00
menuSelection ( )
2020-06-22 14:26:07 -03:00
2021-11-26 20:26:36 -03:00
def menuOpenNodeOnchainONLY ( menuOP ) :
if menuOP in [ " A " , " a " ] :
clear ( )
blogo ( )
OpenNodecreatecharge ( )
elif menuOP in [ " B " , " b " ] :
clear ( )
blogo ( )
OpenNodeiniciatewithdrawal ( )
elif menuOP in [ " C " , " c " ] :
clear ( )
blogo ( )
OpenNodelistfunds ( )
elif menuOP in [ " D " , " d " ] :
clear ( )
blogo ( )
OpenNodeListPayments ( )
elif menuOP in [ " S " , " s " ] :
clear ( )
blogo ( )
OpenNodeCheckStatus ( )
elif menuOP in [ " R " , " r " ] :
menuSelection ( )
2020-06-22 14:26:07 -03:00
def menuLNPAY ( menuNW ) :
2020-06-25 18:53:52 +00:00
if menuNW in [ " A " , " a " ] :
2020-06-22 14:26:07 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-22 14:26:07 -03:00
lnpayCreateInvoice ( )
2020-06-25 16:03:22 -03:00
elif menuNW in [ " B " , " b " ] :
2020-06-22 14:26:07 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-22 14:26:07 -03:00
lnpayPayInvoice ( )
2020-06-25 16:03:22 -03:00
elif menuNW in [ " C " , " c " ] :
2020-06-22 14:26:07 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-22 14:26:07 -03:00
lnpayGetBalance ( )
2020-06-25 16:03:22 -03:00
elif menuNW in [ " D " , " d " ] :
2020-06-22 14:26:07 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-22 14:26:07 -03:00
lnpayGetTransactions ( )
2020-06-25 16:03:22 -03:00
elif menuNW in [ " E " , " e " ] :
2020-06-22 14:26:07 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-22 14:26:07 -03:00
lnpayTransBWallets ( )
2020-06-25 16:03:22 -03:00
elif menuNW in [ " R " , " r " ] :
2020-11-25 23:16:31 -03:00
menuSelection ( )
2020-06-22 14:26:07 -03:00
2021-11-26 20:26:36 -03:00
def menuLNPAYOnchainONLY ( menuNW ) :
if menuNW in [ " A " , " a " ] :
clear ( )
blogo ( )
lnpayCreateInvoice ( )
elif menuNW in [ " B " , " b " ] :
clear ( )
blogo ( )
lnpayPayInvoice ( )
elif menuNW in [ " C " , " c " ] :
clear ( )
blogo ( )
lnpayGetBalance ( )
elif menuNW in [ " D " , " d " ] :
clear ( )
blogo ( )
lnpayGetTransactions ( )
elif menuNW in [ " E " , " e " ] :
clear ( )
blogo ( )
lnpayTransBWallets ( )
elif menuNW in [ " R " , " r " ] :
menuSelection ( )
2020-06-19 17:51:28 -03:00
def menuLNBPI ( menuLNQ ) :
2020-06-25 18:53:52 +00:00
if menuLNQ in [ " A " , " a " ] :
2020-06-19 17:51:28 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-19 17:51:28 -03:00
lnbitCreateNewInvoice ( )
2020-06-25 16:03:22 -03:00
elif menuLNQ in [ " B " , " b " ] :
2020-06-19 17:51:28 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-19 17:51:28 -03:00
lnbitPayInvoice ( )
2020-06-25 16:03:22 -03:00
elif menuLNQ in [ " C " , " c " ] :
2020-06-19 17:51:28 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-19 17:51:28 -03:00
lnbitCreatePayWall ( )
2020-06-25 16:03:22 -03:00
elif menuLNQ in [ " D " , " d " ] :
2020-06-19 17:51:28 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-19 17:51:28 -03:00
lnbitDeletePayWall ( )
2020-06-25 16:03:22 -03:00
elif menuLNQ in [ " E " , " e " ] :
2020-06-19 17:51:28 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-19 17:51:28 -03:00
lnbitListPawWall ( )
2021-04-10 23:58:35 -03:00
elif menuLNQ in [ " F " , " f " ] :
clear ( )
blogo ( )
lnbitsLNURLw ( )
elif menuLNQ in [ " G " , " g " ] :
clear ( )
blogo ( )
lnbitsLNURLwList ( )
2020-06-25 16:03:22 -03:00
elif menuLNQ in [ " R " , " r " ] :
2020-11-25 23:16:31 -03:00
menuSelection ( )
2020-06-19 17:51:28 -03:00
2021-11-26 20:26:36 -03:00
def menuLNBPIOnchainONLY ( menuLNQ ) :
if menuLNQ in [ " A " , " a " ] :
clear ( )
blogo ( )
lnbitCreateNewInvoice ( )
elif menuLNQ in [ " B " , " b " ] :
clear ( )
blogo ( )
lnbitPayInvoice ( )
elif menuLNQ in [ " C " , " c " ] :
clear ( )
blogo ( )
lnbitCreatePayWall ( )
elif menuLNQ in [ " D " , " d " ] :
clear ( )
blogo ( )
lnbitDeletePayWall ( )
elif menuLNQ in [ " E " , " e " ] :
clear ( )
blogo ( )
lnbitListPawWall ( )
elif menuLNQ in [ " F " , " f " ] :
clear ( )
blogo ( )
lnbitsLNURLw ( )
elif menuLNQ in [ " G " , " g " ] :
clear ( )
blogo ( )
lnbitsLNURLwList ( )
elif menuLNQ in [ " R " , " r " ] :
menuSelection ( )
2020-09-18 19:34:48 -03:00
def rateSXMenu ( menuSX ) :
if menuSX in [ " A " , " a " ] :
clear ( )
blogo ( )
rateSXList ( )
elif menuSX in [ " B " , " b " ] :
clear ( )
blogo ( )
rateSXGraph ( )
elif menuSX in [ " R " , " r " ] :
2020-11-25 23:16:31 -03:00
menuSelection ( )
2020-09-18 19:34:48 -03:00
2021-11-26 20:26:36 -03:00
def rateSXMenuOnchainONLY ( menuSX ) :
if menuSX in [ " A " , " a " ] :
clear ( )
blogo ( )
rateSXList ( )
elif menuSX in [ " B " , " b " ] :
clear ( )
blogo ( )
rateSXGraph ( )
elif menuSX in [ " R " , " r " ] :
menuSelection ( )
2020-09-18 19:34:48 -03:00
#---------------END API-----------
2020-09-25 19:56:40 -03:00
def runTheNumbersControl ( menuNumbers ) :
if menuNumbers in [ " A " , " a " ] :
clear ( )
blogo ( )
countdownblock ( )
elif menuNumbers in [ " B " , " b " ] :
2020-09-26 22:55:48 -03:00
clear ( )
blogo ( )
localHalving ( )
elif menuNumbers in [ " C " , " c " ] :
2020-09-25 19:56:40 -03:00
clear ( )
blogo ( )
calc = """
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
PROCESSING
THE NUMBERS
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
"""
comeback = """
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
MAKE YOURSELF A COFFEE
AND COME BACK IN A
MOMENT
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
"""
cprint ( comeback , ' yellow ' )
cprint ( calc , ' red ' , attrs = [ ' blink ' ] )
runthenumbers ( )
2022-10-03 19:28:06 +02:00
elif menuNumbers in [ " D " , " d " ] :
clear ( )
blogo ( )
2022-12-20 10:14:37 -03:00
blockTmpConn ( )
2022-10-08 19:22:25 +02:00
elif menuNumbers in [ " E " , " e " ] :
clear ( )
blogo ( )
2022-12-20 10:14:37 -03:00
epoch ( )
2020-09-25 19:56:40 -03:00
2021-11-26 20:26:36 -03:00
def runTheNumbersControlOnchainONLY ( menuNumbers ) :
if menuNumbers in [ " A " , " a " ] :
clear ( )
blogo ( )
countdownblock ( )
elif menuNumbers in [ " B " , " b " ] :
clear ( )
blogo ( )
localHalving ( )
elif menuNumbers in [ " C " , " c " ] :
clear ( )
blogo ( )
calc = """
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
PROCESSING
THE NUMBERS
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
"""
comeback = """
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
MAKE YOURSELF A COFFEE
AND COME BACK IN A
MOMENT
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
"""
cprint ( comeback , ' yellow ' )
cprint ( calc , ' red ' , attrs = [ ' blink ' ] )
runthenumbers ( )
2022-10-03 19:28:06 +02:00
elif menuNumbers in [ " D " , " d " ] :
clear ( )
blogo ( )
2022-12-20 10:14:37 -03:00
blockTmpConn ( )
2022-10-03 22:45:05 +02:00
elif menuNumbers in [ " E " , " e " ] :
clear ( )
blogo ( )
2022-12-20 10:14:37 -03:00
epoch ( )
2020-09-25 19:56:40 -03:00
def runTheNumbersControlConn ( menuNumbersconn ) :
if menuNumbersconn in [ " A " , " a " ] :
clear ( )
blogo ( )
countdownblockConn ( )
elif menuNumbersconn in [ " B " , " b " ] :
2020-09-26 22:55:48 -03:00
clear ( )
blogo ( )
remoteHalving ( )
elif menuNumbersconn in [ " C " , " c " ] :
2020-09-25 19:56:40 -03:00
clear ( )
blogo ( )
calc = """
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
PROCESSING
THE NUMBERS
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
"""
comeback = """
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
MAKE YOURSELF A COFFEE
AND COME BACK IN A
MOMENT
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
"""
cprint ( comeback , ' yellow ' )
cprint ( calc , ' red ' , attrs = [ ' blink ' ] )
runthenumbersConn ( )
2022-10-03 19:28:06 +02:00
elif menuNumbers in [ " D " , " d " ] :
clear ( )
blogo ( )
2022-12-20 10:14:37 -03:00
blockTmpConn ( )
2022-10-03 22:45:05 +02:00
elif menuNumbers in [ " E " , " e " ] :
clear ( )
blogo ( )
2022-12-20 10:14:37 -03:00
epoch ( )
2020-09-26 22:55:48 -03:00
2020-09-19 22:54:27 -03:00
def menuWeather ( menuWD ) :
if menuWD in [ " A " , " a " ] :
wttrDataV1 ( )
elif menuWD in [ " B " , " b " ] :
wttrDataV2 ( )
2021-11-26 20:26:36 -03:00
def menuWeatherOnchainONLY ( menuWD ) :
if menuWD in [ " A " , " a " ] :
wttrDataV1 ( )
elif menuWD in [ " B " , " b " ] :
wttrDataV2 ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
def mainmenuControl ( menuS , mode ) : #Unified execution of Main Menu options
2020-06-25 18:53:52 +00:00
if menuS in [ " A " , " a " ] :
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
from clock import run_clock
clock_mode = " remote " if mode == " remote " else " local "
run_clock ( clock_mode , path , cfg . settings_clock )
2020-06-25 18:53:52 +00:00
elif menuS in [ " B " , " b " ] :
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
if mode == " remote " :
bitcoincoremenuREMOTE ( )
elif mode == " onchain_only " :
bitcoincoremenuLOCALOnchainONLY ( )
else :
bitcoincoremenuLOCAL ( )
2020-06-25 18:53:52 +00:00
elif menuS in [ " L " , " l " ] :
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
if mode != " onchain_only " :
if mode == " remote " :
lightningnetworkREMOTE ( )
else :
lightningnetworkLOCAL ( )
2020-11-15 20:24:59 -03:00
elif menuS in [ " S " , " s " ] :
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
if mode == " remote " :
settings4Remote ( )
elif mode == " onchain_only " :
settings4LocalOnchainONLY ( )
else :
settings4Local ( )
2020-11-15 20:24:59 -03:00
elif menuS in [ " P " , " p " ] :
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
if mode == " onchain_only " :
APIMenuLOCALOnchainONLY ( )
else :
APIMenuLOCAL ( )
2026-04-02 10:48:25 -03:00
elif menuS in [ " I " , " i " ] :
from ai import ai_menu
lnd = lndconnectload if mode != " onchain_only " else None
ai_menu ( path , lnd )
2020-11-15 20:24:59 -03:00
elif menuS in [ " X " , " x " ] :
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
if mode == " onchain_only " :
dntOnchainONLY ( )
else :
dnt ( )
2020-06-25 18:53:52 +00:00
elif menuS in [ " Q " , " q " ] :
2020-06-11 16:40:02 -03:00
os . _exit ( 0 )
apisnd . close ( )
donation . close ( )
clone . close ( )
logos . close ( )
feed . close ( )
sysinf . close ( )
nodeconnection . close ( )
exit ( )
2020-06-25 18:53:52 +00:00
elif menuS in [ " T " , " t " ] :
2020-06-24 17:08:28 -03:00
clear ( )
2020-06-25 15:53:20 -03:00
delay_print ( " \033 [1;32;40mWake up, Neo... " )
2020-06-24 17:08:28 -03:00
t . sleep ( 2 )
2020-06-25 15:53:20 -03:00
clear ( )
delay_print ( " The Matrix has you... " )
2020-06-24 17:08:28 -03:00
t . sleep ( 2 )
2020-06-25 15:53:20 -03:00
clear ( )
delay_print ( " Follow the white rabbit. " )
t . sleep ( 3 )
clear ( )
print ( " Knock, knock, Neo. \033 [0;37;40m \n " )
t . sleep ( 2 )
clear ( )
t . sleep ( 3 )
2020-06-11 16:40:02 -03:00
screensv ( )
2020-12-07 20:56:35 -03:00
elif menuS in [ " nym " , " Nym " , " NYM " , " nYm " , " nyM " , " NYm " , " NyM " , " nYM " ] :
clear ( )
blogo ( )
robotNym ( )
2020-12-12 18:48:14 -03:00
elif menuS in [ " wt " , " WT " , " Wt " , " wT " ] :
clear ( )
blogo ( )
callGitWardenTerminal ( )
2022-04-12 23:03:35 +02:00
elif menuS in [ " ss " , " SS " , " Ss " , " sS " ] :
clear ( )
blogo ( )
2022-12-20 10:14:37 -03:00
callGitSatSale ( )
2023-06-15 01:25:43 +02:00
elif menuS in [ " tt " , " TT " , " Tt " , " tT " ] :
clear ( )
blogo ( )
2023-09-20 19:40:35 -03:00
callGitBpytop ( )
2022-09-27 21:38:08 +02:00
elif menuS in [ " CA " , " ca " , " Ca " , " cA " ] :
clear ( )
blogo ( )
2022-12-20 10:14:37 -03:00
callGitCashu ( )
2024-09-27 00:01:38 +02:00
elif menuS in [ " 7 " ] :
clear ( )
blogo ( )
output = render ( " 7 Blocks - The Game " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
print ( output )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " 7Blocks.py " ] , cwd = " SPV " )
2024-09-27 00:01:38 +02:00
input ( " \a \n Continue... " )
2024-10-02 19:19:37 +02:00
elif menuS in [ " SOLO " , " solo " , " SoLo " , " sOlO " ] :
clear ( )
blogo ( )
2024-10-04 15:43:18 +02:00
output = render ( " Solo Mining " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
2024-10-02 19:19:37 +02:00
print ( output )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " PyBlockMiner.py " ] , cwd = " SPV " )
2024-10-02 19:19:37 +02:00
input ( " \a \n Continue... " )
2026-04-01 13:15:20 -03:00
else :
if menuS . strip ( ) :
from shared . ui import YELLOW , RESET
print ( f " { YELLOW } Invalid option ' { menuS } ' . Try again. { RESET } " )
t . sleep ( 1 )
2020-12-06 22:28:13 -03:00
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
def mainmenuLOCALcontrol ( menuS ) : #Execution of the Main Menu options
mainmenuControl ( menuS , " local " )
2021-11-18 23:32:22 -03:00
def mainmenuLOCALcontrolOnchainONLY ( menuS ) : #Execution of the Main Menu options
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
mainmenuControl ( menuS , " onchain_only " )
2022-03-07 21:51:32 -03:00
2022-03-08 20:36:01 -03:00
def slushpoolLOCALOnchainONLYMenu ( slush ) :
if slush in [ " A " , " a " ] :
2022-03-07 23:51:30 +01:00
clear ( )
blogo ( )
slDIFFConn ( )
2022-03-08 20:36:01 -03:00
elif slush in [ " C " , " c " ] :
2022-03-07 23:51:30 +01:00
clear ( )
blogo ( )
slPOOLConn ( )
2022-03-08 20:36:01 -03:00
elif slush in [ " E " , " e " ] :
2022-03-07 00:04:06 -03:00
clear ( )
blogo ( )
getPoolSlushCheck ( )
2021-11-18 23:32:22 -03:00
2022-03-17 21:21:37 +01:00
def ckpoolLOCALOnchainONLYMenu ( slush ) :
if ckpool in [ " A " , " a " ] :
clear ( )
blogo ( )
getPoolCKCheck ( )
2022-03-17 19:48:04 -03:00
2022-03-17 21:21:37 +01:00
def ckpoolREMOTEOnchainONLYMenu ( slush ) :
if ckpool in [ " A " , " a " ] :
clear ( )
blogo ( )
getPoolCKCheck ( )
2021-11-18 23:32:22 -03:00
2023-12-19 01:57:15 +01:00
def pyblockpoolLOCALOnchainONLYMenu ( slush ) :
if pyblockpool in [ " A " , " a " ] :
clear ( )
blogo ( )
getPoolPYBLOCKCheck ( )
def pyblockpoolREMOTEOnchainONLYMenu ( slush ) :
if pyblockpool in [ " A " , " a " ] :
clear ( )
blogo ( )
getPoolPYBLOCKCheck ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
def bitcoincoremenuLocalControl ( bcore , mode = None ) : #Unified Bitcoin Core local control
2020-11-15 20:24:59 -03:00
if bcore in [ " A " , " a " ] :
2020-06-11 16:40:02 -03:00
while True :
try :
clear ( )
2020-11-15 20:24:59 -03:00
blogo ( )
sysinfo ( )
2020-06-11 16:40:02 -03:00
close ( )
2020-11-15 20:24:59 -03:00
console ( )
t . sleep ( 5 )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Loop interrupted: %s " , e )
2020-06-13 19:23:52 -03:00
break
2020-11-15 20:24:59 -03:00
elif bcore in [ " B " , " b " ] :
clear ( )
blogo ( )
getgenesis ( )
input ( " Continue... " )
menuSelection ( )
elif bcore in [ " C " , " c " ] :
getblock ( )
elif bcore in [ " D " , " d " ] :
2024-07-30 22:53:16 +02:00
runTheNumbersMenuOnchainONLY ( )
2020-11-15 20:24:59 -03:00
elif bcore in [ " E " , " e " ] :
2024-07-30 22:53:16 +02:00
decodeHexOnchainONLY ( )
2020-11-24 22:04:22 -03:00
elif bcore in [ " F " , " f " ] :
try :
clear ( )
blogo ( )
sysinfo ( )
close ( )
decodeQR ( )
input ( " Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2020-11-24 22:04:22 -03:00
elif bcore in [ " G " , " g " ] :
2020-11-15 20:24:59 -03:00
getrawtx ( )
2020-11-24 22:04:22 -03:00
elif bcore in [ " H " , " h " ] :
2024-07-30 22:53:16 +02:00
miscellaneousLOCALOnchainONLY ( )
2021-01-28 22:58:08 -03:00
elif bcore in [ " J " , " j " ] :
pdfconvert ( )
2022-05-09 20:40:50 +02:00
elif bcore in [ " M " , " m " ] :
2022-12-20 10:14:37 -03:00
mtConn ( )
2021-05-17 15:00:06 -03:00
elif bcore in [ " O " , " o " ] :
2024-07-30 22:53:16 +02:00
bitcoincoremenuLOCALOPRETURNOnchainONLY ( )
elif bcore in [ " W " , " w " ] :
walletmenuLOCALOnchainONLY ( )
2021-11-24 20:01:52 -03:00
elif bcore in [ " Z " , " z " ] :
2021-11-26 01:08:52 -03:00
statsConn ( )
2022-11-11 14:04:38 +01:00
elif bcore in [ " Q " , " q " ] :
2021-12-06 17:52:33 -03:00
miningConn ( )
2021-11-25 17:54:48 -03:00
elif bcore in [ " U " , " u " ] :
2021-11-26 00:57:45 -03:00
untxsConn ( )
2022-03-18 18:44:47 -03:00
elif bcore in [ " S " , " s " ] :
counttxs ( )
2024-07-30 22:53:16 +02:00
elif bcore in [ " L " , " l " ] :
try :
lastblockdetail . run_urwid ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2024-07-30 22:53:16 +02:00
elif bcore in [ " V " , " v " ] :
try :
clear ( )
execute_visualizer ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2024-07-30 22:53:16 +02:00
elif bcore in [ " Y " , " y " ] :
try :
asyncio . run ( mempool_monitor . display_mempool_info ( ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2024-07-30 22:53:16 +02:00
elif bcore in [ " X " , " x " ] :
try :
clear ( )
some_other_function ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2024-07-30 22:53:16 +02:00
elif bcore in [ " K " , " k " ] :
try :
peers_monitor . run_peers_monitor ( ) ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2024-07-30 22:53:16 +02:00
elif bcore in [ " N " , " n " ] :
try :
tx_search . search_tx ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2024-07-30 22:53:16 +02:00
elif bcore in [ " P " , " p " ] :
try :
clear ( )
call_blocks ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2023-09-04 21:15:25 +02:00
elif bcore in [ " CM " , " cm " ] :
CoreMiner ( )
elif bcore in [ " ONM " , " onm " ] :
2024-10-22 19:15:04 +02:00
OwnNodeMinerONCHAIN ( )
2024-12-27 16:33:54 +01:00
elif bcore in [ " VG " , " vg " ] :
clear ( )
blogo ( )
output = render ( " Vanity Generator " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
print ( output )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " PyVanityGenerator.py " ] , cwd = " SPV " )
2024-12-27 16:33:54 +01:00
input ( " \a \n Continue... " )
2026-06-21 10:02:04 -04:00
elif bcore in [ " OV " , " ov " ] :
try :
pathexec ( )
from oraclevision . ui import run_oraclevision_menu
run_oraclevision_menu ( path )
except Exception as e :
show_error ( str ( e ) )
logger . debug ( " Suppressed error: %s " , e )
2026-04-01 13:15:20 -03:00
else :
if bcore . strip ( ) :
from shared . ui import YELLOW , RESET
print ( f " { YELLOW } Invalid option ' { bcore } ' . Try again. { RESET } " )
t . sleep ( 1 )
2021-05-03 20:59:14 -03:00
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
def bitcoincoremenuLOCALcontrolA ( bcore ) :
bitcoincoremenuLocalControl ( bcore , " local " )
2021-11-18 23:32:22 -03:00
def bitcoincoremenuLOCALcontrolAOnchainONLY ( bcore ) :
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
bitcoincoremenuLocalControl ( bcore , " onchain_only " )
2021-11-26 00:57:45 -03:00
2021-11-24 07:47:40 -03:00
def walletmenuLOCALcontrolAOnchainONLY ( walletmnu ) :
if walletmnu in [ " A " , " a " ] :
getnewaddressOnchain ( )
elif walletmnu in [ " B " , " b " ] :
gettransactionsOnchain ( )
2022-12-23 02:42:46 +01:00
elif walletmnu in [ " C " , " c " ] :
2022-12-24 11:24:44 -03:00
dumppk ( )
2022-12-25 03:32:46 +01:00
elif walletmnu in [ " D " , " d " ] :
2022-12-30 18:52:58 -03:00
wallmenu ( )
2023-01-08 16:19:13 +01:00
elif walletmnu in [ " E " , " e " ] :
inffmenu ( )
elif walletmnu in [ " F " , " f " ] :
2023-09-20 19:40:35 -03:00
miningmenu ( )
2021-11-18 23:32:22 -03:00
2021-05-17 15:00:06 -03:00
def bitcoincoremenuLOCALcontrolO ( oreturn ) :
if oreturn in [ " A " , " a " ] :
clear ( )
blogo ( )
opreturn ( )
elif oreturn in [ " B " , " b " ] :
clear ( )
blogo ( )
opreturn_view ( )
2021-12-06 16:56:40 +01:00
elif oreturn in [ " C " , " c " ] :
clear ( )
blogo ( )
2021-12-06 17:52:33 -03:00
opretminer ( )
2021-05-17 15:00:06 -03:00
2021-12-01 16:57:56 -03:00
def bitcoincoremenuLOCALcontrolOOnchainONLY ( oreturn ) :
if oreturn in [ " A " , " a " ] :
clear ( )
blogo ( )
2024-07-22 22:32:57 +02:00
opreturn ( )
2021-12-01 16:57:56 -03:00
elif oreturn in [ " B " , " b " ] :
clear ( )
blogo ( )
opreturn_view ( )
elif oreturn in [ " C " , " c " ] :
clear ( )
blogo ( )
opretminer ( )
2020-11-24 22:04:22 -03:00
def miscellaneousLOCALmenu ( misce ) :
2022-03-12 10:51:07 -03:00
if misce in [ " A " , " a " ] :
while True :
2020-11-24 22:04:22 -03:00
try :
clear ( )
blogo ( )
close ( )
logoA ( )
tmp ( )
clear ( )
blogo ( )
close ( )
logoB ( )
tmp ( )
clear ( )
blogo ( )
close ( )
logoC ( )
tmp ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Loop interrupted: %s " , e )
2020-11-24 22:04:22 -03:00
break
2022-03-12 10:51:07 -03:00
elif misce in [ " B " , " b " ] :
clear ( )
blogo ( )
close ( )
sysinfoDetail ( )
elif misce in [ " C " , " c " ] :
clear ( )
blogo ( )
datesConn ( )
elif misce in [ " D " , " d " ] :
clear ( )
blogo ( )
quotesConn ( )
2023-12-21 13:00:52 -03:00
elif misce in [ " H " , " h " ] :
clear ( )
blogo ( )
ex ( )
2024-07-25 21:20:11 +02:00
elif misce in [ " M " , " m " ] :
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " printf " , " \033 [49m " ] )
2024-07-25 21:20:11 +02:00
clear ( )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " printf " , " \033 [49m " ] )
2024-07-25 21:20:11 +02:00
blogo ( )
2024-07-25 22:55:12 +02:00
output = render ( " 1st 𝕭 𝐢 𝐭 𝐚 𝐱 𝐞 Block 853742 " , colors = [ ' white ' ] , align = ' center ' , font = ' console ' )
2024-07-25 22:43:52 +02:00
print ( output )
2024-07-25 21:20:11 +02:00
createimagebitaxe ( )
2024-07-25 16:22:15 -03:00
input ( " Continue... " )
2022-03-12 16:31:38 +01:00
elif misce in [ " P " , " p " ] :
clear ( )
blogo ( )
2022-03-13 20:58:54 -03:00
pgpConn ( )
2022-03-12 10:51:07 -03:00
elif misce in [ " S " , " s " ] :
clear ( )
blogo ( )
satoshiConn ( )
2024-09-20 00:56:05 +02:00
elif misce in [ " X " , " x " ] :
clear ( )
blogo ( )
allblocksConn ( )
2024-08-14 23:23:39 +02:00
elif misce in [ " SHS " , " shs " ] :
clear ( )
blogo ( )
SHS ( )
2022-03-12 10:51:07 -03:00
elif misce in [ " R " , " r " ] :
menuSelection ( )
2022-03-05 16:03:11 -03:00
2023-12-21 13:00:52 -03:00
2021-11-26 20:26:36 -03:00
def miscellaneousLOCALmenuOnchainONLY ( misce ) :
2021-12-06 17:52:33 -03:00
if misce in [ " A " , " a " ] :
while True :
2021-11-26 20:26:36 -03:00
try :
clear ( )
blogo ( )
close ( )
logoA ( )
tmp ( )
clear ( )
blogo ( )
close ( )
logoB ( )
tmp ( )
clear ( )
blogo ( )
close ( )
logoC ( )
tmp ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Loop interrupted: %s " , e )
2022-03-12 10:51:07 -03:00
break
2021-12-06 17:52:33 -03:00
elif misce in [ " B " , " b " ] :
2022-03-12 10:26:00 -03:00
clear ( )
blogo ( )
close ( )
sysinfoDetail ( )
2021-12-06 17:52:33 -03:00
elif misce in [ " D " , " d " ] :
2022-03-12 10:26:00 -03:00
clear ( )
blogo ( )
quotesConn ( )
2021-12-06 17:52:33 -03:00
elif misce in [ " C " , " c " ] :
2022-03-12 10:26:00 -03:00
clear ( )
blogo ( )
datesConn ( )
2023-12-21 13:00:52 -03:00
elif misce in [ " H " , " h " ] :
clear ( )
blogo ( )
ex ( )
2024-07-25 21:20:11 +02:00
elif misce in [ " M " , " m " ] :
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " printf " , " \033 [49m " ] )
2024-07-25 21:20:11 +02:00
clear ( )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " printf " , " \033 [49m " ] )
2024-07-25 21:20:11 +02:00
blogo ( )
2024-07-25 22:55:12 +02:00
output = render ( " 1st 𝕭 𝐢 𝐭 𝐚 𝐱 𝐞 Block 853742 " , colors = [ ' white ' ] , align = ' center ' , font = ' console ' )
2024-07-25 22:43:52 +02:00
print ( output )
2024-07-25 21:20:11 +02:00
createimagebitaxe ( )
2024-07-25 16:29:25 -03:00
input ( " Continue... " )
2022-03-12 16:31:38 +01:00
elif misce in [ " P " , " p " ] :
clear ( )
blogo ( )
2022-03-13 20:58:54 -03:00
pgpConn ( )
2022-03-12 03:04:11 +01:00
elif misce in [ " S " , " s " ] :
2022-03-12 10:26:00 -03:00
clear ( )
blogo ( )
satoshiConn ( )
2024-09-20 00:56:05 +02:00
elif misce in [ " X " , " x " ] :
clear ( )
blogo ( )
allblocksConn ( )
2024-08-14 23:23:39 +02:00
elif misce in [ " SHS " , " shs " ] :
clear ( )
blogo ( )
SHS ( )
2021-12-06 17:52:33 -03:00
elif misce in [ " R " , " r " ] :
menuSelection ( )
2021-11-26 20:26:36 -03:00
2020-11-24 22:04:22 -03:00
def decodeHexLOCAL ( hexloc ) :
if hexloc in [ " A " , " a " ] :
clear ( )
blogo ( )
close ( )
try :
readHexBlock ( )
while True :
r = input ( " Do you want to continue decoding? Y/n: " )
if r in [ " Y " , " y " ] :
clear ( )
blogo ( )
readHexBlock ( )
else :
break
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2020-11-24 22:04:22 -03:00
elif hexloc in [ " B " , " b " ] :
clear ( )
blogo ( )
close ( )
try :
readHexTx ( )
while True :
r = input ( " Do you want to continue decoding? Y/n: " )
2020-11-25 20:02:37 +00:00
if r not in [ " Y " , " y " ] :
2020-11-24 22:04:22 -03:00
break
2020-11-25 20:02:37 +00:00
clear ( )
blogo ( )
sysinfo ( )
readHexTx ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2021-11-26 20:26:36 -03:00
def decodeHexLOCALOnchainONLY ( hexloc ) :
if hexloc in [ " A " , " a " ] :
clear ( )
blogo ( )
close ( )
try :
readHexBlock ( )
while True :
r = input ( " Do you want to continue decoding? Y/n: " )
if r in [ " Y " , " y " ] :
clear ( )
blogo ( )
readHexBlock ( )
else :
break
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2021-11-26 20:26:36 -03:00
elif hexloc in [ " B " , " b " ] :
clear ( )
blogo ( )
close ( )
try :
readHexTx ( )
while True :
r = input ( " Do you want to continue decoding? Y/n: " )
if r not in [ " Y " , " y " ] :
break
clear ( )
blogo ( )
sysinfo ( )
readHexTx ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2021-11-26 20:26:36 -03:00
2020-11-15 20:24:59 -03:00
def lightningnetworkLOCALcontrol ( lncore ) :
if lncore in [ " A " , " a " ] :
2020-06-11 16:40:02 -03:00
while True :
try :
clear ( )
2020-11-15 20:24:59 -03:00
blogo ( )
sysinfo ( )
2020-06-11 16:40:02 -03:00
close ( )
2020-11-15 20:24:59 -03:00
consoleLN ( )
t . sleep ( 5 )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Loop interrupted: %s " , e )
2020-06-13 19:23:52 -03:00
break
2020-11-15 20:24:59 -03:00
elif lncore in [ " B " , " b " ] :
clear ( )
blogo ( )
localaddinvoice ( )
elif lncore in [ " C " , " c " ] :
clear ( )
blogo ( )
localpayinvoice ( )
elif lncore in [ " D " , " d " ] :
clear ( )
blogo ( )
localkeysend ( )
elif lncore in [ " E " , " e " ] :
clear ( )
blogo ( )
localnewaddress ( )
elif lncore in [ " F " , " f " ] :
clear ( )
blogo ( )
locallistinvoices ( )
elif lncore in [ " G " , " g " ] :
clear ( )
blogo ( )
localchannelbalance ( )
elif lncore in [ " H " , " h " ] :
clear ( )
blogo ( )
locallistchannels ( )
elif lncore in [ " I " , " i " ] :
clear ( )
blogo ( )
localrebalancelnd ( )
elif lncore in [ " J " , " j " ] :
clear ( )
blogo ( )
locallistpeersQQ ( )
elif lncore in [ " K " , " k " ] :
clear ( )
blogo ( )
localconnectpeer ( )
elif lncore in [ " L " , " l " ] :
clear ( )
blogo ( )
localbalanceOC ( )
elif lncore in [ " M " , " m " ] :
clear ( )
blogo ( )
locallistchaintxns ( )
elif lncore in [ " N " , " n " ] :
clear ( )
blogo ( )
localgetinfo ( )
elif lncore in [ " O " , " o " ] :
clear ( )
blogo ( )
localgetnetworkinfo ( )
2022-02-17 01:52:56 +01:00
elif lncore in [ " P " , " p " ] :
clear ( )
blogo ( )
2022-03-05 16:03:11 -03:00
chatConn ( )
2021-11-28 18:23:59 -03:00
elif lncore in [ " Z " , " z " ] :
clear ( )
blogo ( )
stalnConn ( )
elif lncore in [ " T " , " t " ] :
clear ( )
blogo ( )
ranConn ( )
2021-04-10 23:58:35 -03:00
elif lncore in [ " Q " , " q " ] :
2026-04-02 09:48:58 -03:00
lnbitsLNURLwList ( )
2021-04-10 23:58:35 -03:00
elif lncore in [ " S " , " s " ] :
2026-04-02 09:48:58 -03:00
lnbitsLNURLw ( )
2020-11-25 16:43:43 -03:00
elif lncore in [ " R " , " r " ] :
2020-11-24 22:04:22 -03:00
menuSelection ( )
2022-03-05 16:03:11 -03:00
2022-03-05 16:41:53 -03:00
def chatConnA ( menuch ) :
2022-02-17 21:32:04 +01:00
if menuch in [ " A " , " a " ] :
pyCHATA ( )
elif menuch in [ " B " , " b " ] :
pyCHATB ( )
elif menuch in [ " C " , " c " ] :
pyCHATC ( )
2022-03-05 16:03:11 -03:00
2022-03-05 16:41:53 -03:00
def chatConnB ( pyCHATA ) :
2022-02-17 21:32:04 +01:00
if pyCHATA in [ " A " , " a " ] :
clear ( )
blogo ( )
localchatsendA ( )
elif pyCHATA in [ " B " , " b " ] :
clear ( )
blogo ( )
localchatnewA ( )
elif pyCHATA in [ " C " , " c " ] :
clear ( )
blogo ( )
localchatlistA ( )
2022-03-05 16:03:11 -03:00
2022-03-05 16:41:53 -03:00
def chatConnC ( pyCHATB ) :
2022-02-17 21:32:04 +01:00
if pyCHATB in [ " A " , " a " ] :
clear ( )
blogo ( )
localchatsendB ( )
elif pyCHATB in [ " B " , " b " ] :
clear ( )
blogo ( )
localchatnewB ( )
elif pyCHATB in [ " C " , " c " ] :
clear ( )
blogo ( )
2022-03-05 16:03:11 -03:00
localchatlistB ( )
2022-03-05 16:41:53 -03:00
def chatConnD ( pyCHATC ) :
2022-02-17 21:32:04 +01:00
if pyCHATC in [ " A " , " a " ] :
2022-02-17 01:52:56 +01:00
clear ( )
blogo ( )
2022-02-17 21:32:04 +01:00
localchatsendC ( )
elif pyCHATC in [ " B " , " b " ] :
2022-02-17 01:52:56 +01:00
clear ( )
blogo ( )
2022-02-17 21:32:04 +01:00
localchatnewC ( )
elif pyCHATC in [ " C " , " c " ] :
2022-02-17 01:52:56 +01:00
clear ( )
blogo ( )
2022-03-05 16:03:11 -03:00
localchatlistC ( )
2020-11-15 20:24:59 -03:00
def platfformsLOCALcontrol ( platf ) :
if platf in [ " A " , " a " ] :
aaccPPiTippinMe ( )
elif platf in [ " B " , " b " ] :
aaccPPiTallyCo ( )
elif platf in [ " C " , " c " ] :
mempoolmenu ( )
elif platf in [ " D " , " d " ] :
2020-06-11 16:40:02 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-11-15 20:24:59 -03:00
CoingeckoPP ( )
elif platf in [ " E " , " e " ] :
rateSX ( )
2021-11-28 14:32:02 -03:00
elif platf in [ " F " , " f " ] :
bwtConn ( )
2020-11-15 20:24:59 -03:00
elif platf in [ " G " , " g " ] :
aaccPPiLNBits ( )
elif platf in [ " H " , " h " ] :
aaccPPiLNPay ( )
elif platf in [ " I " , " i " ] :
aaccPPiOpenNode ( )
2020-11-24 22:04:22 -03:00
elif platf in [ " J " , " j " ] :
satnodeMenu ( )
elif platf in [ " K " , " k " ] :
weatherMenu ( )
elif platf in [ " L " , " l " ] :
gameroom ( )
2021-11-27 10:23:08 -03:00
elif platf in [ " M " , " m " ] :
whalalConn ( )
2022-12-19 16:02:43 +01:00
elif platf in [ " N " , " n " ] :
2022-12-20 10:14:37 -03:00
nostrConn ( )
2024-07-10 18:10:32 +02:00
elif platf in [ " Q " , " q " ] :
2024-07-10 18:56:00 +02:00
OceanConn ( )
2022-03-08 23:58:27 +01:00
elif platf in [ " S " , " s " ] :
2022-03-08 20:36:01 -03:00
slushpoolLOCALOnchainONLY ( )
2023-01-25 21:08:18 +01:00
elif platf in [ " T " , " t " ] :
bip39convert ( )
2023-09-21 19:32:01 +02:00
elif platf in [ " U " , " u " ] :
callGitUTXOracle ( )
2022-03-17 21:21:37 +01:00
elif platf in [ " W " , " w " ] :
2022-03-17 19:48:04 -03:00
ckpoolpoolLOCALOnchainONLY ( )
2023-12-19 01:57:15 +01:00
elif platf in [ " Z " , " z " ] :
2023-12-21 13:00:52 -03:00
pyblockpoolpoolLOCALOnchainONLY ( )
2020-11-26 13:05:51 -03:00
elif platf in [ " R " , " r " ] :
menuSelection ( )
2020-11-24 22:04:22 -03:00
2021-11-18 23:32:22 -03:00
def platfformsLOCALcontrolOnchainONLY ( platf ) :
if platf in [ " A " , " a " ] :
2021-11-26 20:26:36 -03:00
aaccPPiTippin ( )
2021-11-18 23:32:22 -03:00
elif platf in [ " B " , " b " ] :
aaccPPiTallyCo ( )
elif platf in [ " C " , " c " ] :
2021-11-26 20:26:36 -03:00
mempoolmenuOnchainONLY ( )
2021-11-18 23:32:22 -03:00
elif platf in [ " D " , " d " ] :
clear ( )
blogo ( )
CoingeckoPP ( )
elif platf in [ " E " , " e " ] :
2021-11-26 20:26:36 -03:00
rateSXOncainONLY ( )
2021-11-28 14:32:02 -03:00
elif platf in [ " F " , " f " ] :
bwtConn ( )
2021-11-18 23:32:22 -03:00
elif platf in [ " G " , " g " ] :
aaccPPiLNBits ( )
elif platf in [ " H " , " h " ] :
aaccPPiLNPay ( )
elif platf in [ " I " , " i " ] :
aaccPPiOpenNode ( )
elif platf in [ " J " , " j " ] :
2021-11-26 20:26:36 -03:00
satnodeMenuOnchainONLY ( )
2021-11-18 23:32:22 -03:00
elif platf in [ " K " , " k " ] :
2021-11-26 20:26:36 -03:00
weatherMenuOnchainONLY ( )
2021-11-18 23:32:22 -03:00
elif platf in [ " L " , " l " ] :
gameroom ( )
2021-11-27 10:23:08 -03:00
elif platf in [ " M " , " m " ] :
whalalConn ( )
2022-12-19 16:02:43 +01:00
elif platf in [ " N " , " n " ] :
2022-12-20 10:14:37 -03:00
nostrConn ( )
2024-04-30 01:10:50 +02:00
elif platf in [ " P " , " p " ] :
PhoenixConn ( )
2024-07-10 18:10:32 +02:00
elif platf in [ " Q " , " q " ] :
2024-07-10 18:56:00 +02:00
OceanConn ( )
2024-07-09 23:51:10 +02:00
elif platf in [ " R " , " r " ] :
2024-07-10 18:43:21 +02:00
luxorstats ( )
2022-03-08 23:58:27 +01:00
elif platf in [ " S " , " s " ] :
2022-03-08 20:36:01 -03:00
slushpoolLOCALOnchainONLY ( )
2023-01-25 21:08:18 +01:00
elif platf in [ " T " , " t " ] :
2023-09-20 19:40:35 -03:00
bip39convert ( )
2023-09-21 19:32:01 +02:00
elif platf in [ " U " , " u " ] :
callGitUTXOracle ( )
2022-03-17 21:21:37 +01:00
elif platf in [ " W " , " w " ] :
2022-03-17 19:48:04 -03:00
ckpoolpoolLOCALOnchainONLY ( )
2023-12-19 01:57:15 +01:00
elif platf in [ " Z " , " z " ] :
2023-12-21 13:00:52 -03:00
pyblockpoolpoolLOCALOnchainONLY ( )
2021-11-18 23:32:22 -03:00
elif platf in [ " R " , " r " ] :
menuSelection ( )
2024-04-30 01:10:50 +02:00
def phoenixmenu ( menunos ) :
if menunos in [ " A " , " a " ] :
callPhoenixLin ( )
elif menunos in [ " B " , " b " ] :
callPhoenixMacARM ( )
elif menunos in [ " C " , " c " ] :
callPhoenixMacX64 ( )
elif menunos in [ " D " , " d " ] :
callPhoenixWin ( )
elif menunos in [ " E " , " e " ] :
callPhoenix ( )
2024-07-03 20:50:02 +02:00
elif menunos in [ " F " , " f " ] :
wallPhoenix ( )
elif menunos in [ " G " , " g " ] :
wallPhoenixBOLT12 ( )
2024-04-30 01:10:50 +02:00
elif platf in [ " R " , " r " ] :
menuSelection ( )
2022-03-17 19:48:04 -03:00
2024-07-10 18:10:32 +02:00
def oceanMstats ( menuunos ) :
if menuunos in [ " A " , " a " ] :
oceanE ( )
elif menuunos in [ " B " , " b " ] :
oceanH ( )
elif menuunos in [ " C " , " c " ] :
oceanB ( )
elif platf in [ " R " , " r " ] :
menuSelection ( )
2022-03-17 21:21:37 +01:00
def ckpool ( menuch ) :
if menuch in [ " A " , " a " ] :
2022-03-17 19:48:04 -03:00
ckpool ( )
2022-12-20 10:14:37 -03:00
2023-12-19 01:57:15 +01:00
def pyblockpool ( menuchh ) :
if menuchh in [ " A " , " a " ] :
pyblockpool ( )
2022-12-20 10:14:37 -03:00
2022-12-19 16:02:43 +01:00
def nostrmenu ( menunos ) :
if menunos in [ " A " , " a " ] :
callGitNostrLinTerminal ( )
2022-12-28 01:52:25 +01:00
elif menunos in [ " B " , " b " ] :
2023-09-20 19:40:35 -03:00
callGitNostrLinarmTerminal ( )
2022-12-31 00:01:25 +01:00
elif menunos in [ " C " , " c " ] :
2022-12-20 10:14:37 -03:00
callGitNostrMacTerminal ( )
2022-12-28 01:52:25 +01:00
elif menunos in [ " D " , " d " ] :
2023-09-20 19:40:35 -03:00
nostrConn ( )
2022-12-31 00:01:25 +01:00
elif menunos in [ " E " , " e " ] :
callGitNostrWinTerminal ( )
2022-12-21 21:47:49 +01:00
elif menunos in [ " S " , " s " ] :
2022-12-30 18:52:58 -03:00
callGitNostrSeedTerminal ( )
2023-01-01 19:11:25 +01:00
elif menunos in [ " W " , " w " ] :
callGitNostrQRSeedTerminal ( )
2023-01-15 17:10:50 +01:00
elif menunos in [ " Z " , " z " ] :
2023-09-20 19:40:35 -03:00
callGitBija ( )
2022-12-22 09:16:03 -03:00
2020-11-24 22:04:22 -03:00
#----------------------------REMOTE MENUS
2020-11-15 20:24:59 -03:00
def mainmenuREMOTEcontrol ( menuS ) : #Execution of the Main Menu options
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
mainmenuControl ( menuS , " remote " )
2020-11-15 20:24:59 -03:00
def bitcoincoremenuREMOTEcontrol ( bcore ) :
if bcore in [ " A " , " a " ] :
while True :
try :
clear ( )
blogo ( )
sysinfo ( )
close ( )
remoteconsole ( )
t . sleep ( 5 )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Loop interrupted: %s " , e )
2020-11-15 20:24:59 -03:00
break
elif bcore in [ " B " , " b " ] :
remotegetblockcount ( )
elif bcore in [ " C " , " c " ] :
runTheNumbersMenuConn ( )
2020-11-24 22:04:22 -03:00
elif bcore in [ " D " , " d " ] :
try :
clear ( )
blogo ( )
sysinfo ( )
close ( )
decodeQR ( )
input ( " Continue... " )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2020-11-24 22:04:22 -03:00
elif bcore in [ " E " , " e " ] :
2020-11-26 13:05:51 -03:00
miscellaneousLOCAL ( )
2022-05-09 20:40:50 +02:00
elif bcore in [ " M " , " m " ] :
2022-12-20 10:14:37 -03:00
mtConn ( )
2021-05-17 15:00:06 -03:00
elif bcore in [ " O " , " o " ] :
bitcoincoremenuREMOTEOPRETURN ( )
2021-12-06 16:56:40 +01:00
elif bcore in [ " Z " , " z " ] :
statsConn ( )
2022-11-11 14:04:38 +01:00
elif bcore in [ " Q " , " q " ] :
2021-12-06 17:52:33 -03:00
miningConn ( )
2021-12-06 16:56:40 +01:00
elif bcore in [ " U " , " u " ] :
2021-12-06 17:52:33 -03:00
untxsConn ( )
2023-09-04 21:15:25 +02:00
elif bcore in [ " ONM " , " onm " ] :
2024-10-22 19:15:04 +02:00
OwnNodeMinerONCHAIN ( )
2024-12-27 16:33:54 +01:00
elif bcore in [ " VG " , " vg " ] :
clear ( )
blogo ( )
output = render ( " Vanity Generator " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
print ( output )
2026-04-01 10:24:47 -03:00
subprocess . run ( [ " python3 " , " PyVanityGenerator.py " ] , cwd = " SPV " )
2024-12-27 16:33:54 +01:00
input ( " \a \n Continue... " )
2021-05-17 15:00:06 -03:00
def bitcoincoremenuREMOTEcontrolO ( oreturn ) :
if oreturn in [ " A " , " a " ] :
clear ( )
blogo ( )
opreturn ( )
elif oreturn in [ " B " , " b " ] :
clear ( )
blogo ( )
opreturn_view ( )
2021-12-06 16:56:40 +01:00
elif oreturn in [ " C " , " c " ] :
clear ( )
blogo ( )
2021-12-06 17:52:33 -03:00
opretminer ( )
2020-11-15 20:24:59 -03:00
def lightningnetworkREMOTEcontrol ( lncore ) :
if lncore in [ " A " , " a " ] :
2020-05-29 11:52:29 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-10 19:02:49 -03:00
getnewinvoice ( )
2020-11-15 20:24:59 -03:00
elif lncore in [ " B " , " b " ] :
2020-05-29 11:52:29 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-05-29 16:06:45 -03:00
payinvoice ( )
2020-11-15 20:24:59 -03:00
elif lncore in [ " C " , " c " ] :
2020-06-01 22:38:56 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-11-15 20:24:59 -03:00
getnewaddress ( )
elif lncore in [ " D " , " d " ] :
2020-06-11 16:40:02 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-11 16:40:02 -03:00
listinvoice ( )
2020-11-15 20:24:59 -03:00
elif lncore in [ " E " , " e " ] :
2020-06-11 16:40:02 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-11-15 20:24:59 -03:00
channelbalance ( )
elif lncore in [ " F " , " f " ] :
2020-06-11 16:40:02 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-11 16:40:02 -03:00
channels ( )
2020-11-15 20:24:59 -03:00
elif lncore in [ " G " , " g " ] :
2020-06-03 18:26:59 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-06-10 19:02:49 -03:00
balanceOC ( )
2020-11-15 20:24:59 -03:00
elif lncore in [ " H " , " h " ] :
2020-06-10 19:02:49 -03:00
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-11-15 20:24:59 -03:00
listonchaintxs ( )
elif lncore in [ " I " , " i " ] :
2020-08-30 12:30:37 -03:00
clear ( )
blogo ( )
2020-11-15 20:24:59 -03:00
getinfo ( )
2021-11-28 18:23:59 -03:00
elif lncore in [ " Z " , " z " ] :
clear ( )
blogo ( )
stalnConn ( )
elif lncore in [ " T " , " t " ] :
clear ( )
blogo ( )
ranConn ( )
2021-04-10 23:58:35 -03:00
elif lncore in [ " Q " , " q " ] :
2026-04-02 09:48:58 -03:00
lnbitsLNURLwList ( )
2021-04-10 23:58:35 -03:00
elif lncore in [ " S " , " s " ] :
2026-04-02 09:48:58 -03:00
lnbitsLNURLw ( )
2020-11-25 16:43:43 -03:00
elif lncore in [ " R " , " r " ] :
2020-11-24 22:19:57 -03:00
menuSelection ( )
2020-11-15 20:24:59 -03:00
2020-05-25 19:35:24 -03:00
def menuC ( menuO ) : # Donation access Menu
2020-06-25 18:53:52 +00:00
if menuO in [ " A " , " a " ] :
2020-05-23 08:50:38 -03:00
dntDev ( )
2020-06-25 18:53:52 +00:00
elif menuO in [ " B " , " b " ] :
2020-05-23 08:50:38 -03:00
dntTst ( )
2020-06-25 18:53:52 +00:00
elif menuO in [ " R " , " r " ] :
2020-06-11 16:40:02 -03:00
menuSelection ( )
2020-05-24 14:15:12 -03:00
2021-11-22 14:48:21 -03:00
def menuCOnchainONLY ( menuO ) : # Donation access Menu
if menuO in [ " A " , " a " ] :
dntDevOnchainONLY ( )
elif menuO in [ " B " , " b " ] :
dntTstOnchainONLY ( )
elif menuO in [ " R " , " r " ] :
menuSelection ( )
2020-05-25 19:35:24 -03:00
def menuD ( menuN ) : # Satnode access Menu
2020-06-25 18:53:52 +00:00
if menuN in [ " A " , " a " ] :
2020-05-23 08:50:38 -03:00
satnode ( )
2020-06-25 18:53:52 +00:00
elif menuN in [ " B " , " b " ] :
2020-05-23 08:50:38 -03:00
readFile ( )
2020-06-25 18:53:52 +00:00
elif menuN in [ " S " , " s " ] :
2020-05-25 19:35:24 -03:00
try :
2020-11-25 20:43:58 -03:00
clear ( )
blogo ( )
2020-05-25 19:35:24 -03:00
close ( )
2020-05-26 14:20:20 -03:00
message = input ( " \n \033 [0;37;40mYour message it ' s a \033 [1;34;40mF \033 [0;37;40mile or a plain \033 [1;32;40mT \033 [0;37;40mext? \033 [1;34;40mF \033 [0;37;40m/ \033 [1;32;40mT \033 [0;37;40m: " )
2020-06-25 18:53:52 +00:00
if message in [ " F " , " f " ] :
2020-05-26 14:20:20 -03:00
try :
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-05-26 14:20:20 -03:00
close ( )
apisenderFile ( )
2020-05-26 20:48:23 -03:00
t . sleep ( 30 )
2020-06-11 16:40:02 -03:00
menuSelection ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2020-06-11 16:40:02 -03:00
menuSelection ( )
2020-06-25 18:53:52 +00:00
elif message in [ " T " , " t " ] :
2020-05-26 14:20:20 -03:00
try :
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-05-26 14:20:20 -03:00
close ( )
apisender ( )
2020-05-26 20:48:23 -03:00
t . sleep ( 30 )
2020-06-11 16:40:02 -03:00
menuSelection ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2020-06-11 16:40:02 -03:00
menuSelection ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2020-06-11 16:40:02 -03:00
menuSelection ( )
2020-06-25 18:53:52 +00:00
elif menuN in [ " C " , " c " ] :
2020-11-25 20:43:58 -03:00
try :
print ( " \n \t This only will work on Linux or Unix systems. \n " )
a = input ( " Do we continue? Y/n: " )
if a in [ " Y " , " y " ] :
gitclone ( )
else :
menuSelection ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2020-11-25 16:43:43 -03:00
elif menuN in [ " R " , " r " ] :
2020-06-11 16:40:02 -03:00
menuSelection ( )
2020-05-24 14:15:12 -03:00
2020-05-25 19:35:24 -03:00
def menuE ( menuQ ) : # Dev Donation access Menu
2020-06-25 18:53:52 +00:00
if menuQ in [ " A " , " a " ] :
2020-05-20 20:32:31 -03:00
try :
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-05-20 20:32:31 -03:00
close ( )
2021-04-14 00:08:55 -03:00
donationPayNym ( )
2020-05-20 20:32:31 -03:00
t . sleep ( 50 )
2020-06-11 16:40:02 -03:00
menuSelection ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2020-06-11 16:40:02 -03:00
menuSelection ( )
2020-10-17 21:07:18 -03:00
elif menuQ in [ " B " , " b " ] :
2021-04-14 00:08:55 -03:00
try :
clear ( )
blogo ( )
close ( )
donationAddr ( )
t . sleep ( 50 )
menuSelection ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2021-04-14 00:08:55 -03:00
menuSelection ( )
elif menuQ in [ " C " , " c " ] :
2020-05-20 20:32:31 -03:00
try :
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-05-20 20:32:31 -03:00
close ( )
donationLN ( )
t . sleep ( 50 )
2020-06-11 16:40:02 -03:00
menuSelection ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2020-06-11 16:40:02 -03:00
menuSelection ( )
2020-06-25 18:53:52 +00:00
elif menuQ in [ " R " , " r " ] :
2020-06-11 16:40:02 -03:00
menuSelection ( )
2020-05-24 14:15:12 -03:00
2021-11-22 14:48:21 -03:00
def menuEOnchainONLY ( menuQ ) : # Dev Donation access Menu
if menuQ in [ " A " , " a " ] :
try :
clear ( )
blogo ( )
close ( )
donationPayNym ( )
t . sleep ( 50 )
menuSelection ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2021-11-22 14:48:21 -03:00
menuSelection ( )
elif menuQ in [ " B " , " b " ] :
try :
clear ( )
blogo ( )
close ( )
donationAddr ( )
t . sleep ( 50 )
menuSelection ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2021-11-22 14:48:21 -03:00
menuSelection ( )
elif menuQ in [ " C " , " c " ] :
try :
clear ( )
blogo ( )
close ( )
donationLN ( )
t . sleep ( 50 )
menuSelection ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2021-11-22 14:48:21 -03:00
menuSelection ( )
elif menuQ in [ " R " , " r " ] :
menuSelection ( )
2020-05-25 19:35:24 -03:00
def menuF ( menuV ) : # Tester Donation access Menu
2020-06-25 18:53:52 +00:00
if menuV in [ " A " , " a " ] :
2020-05-23 08:50:38 -03:00
try :
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-05-23 08:50:38 -03:00
close ( )
donationAddrTst ( )
t . sleep ( 50 )
2020-06-11 16:40:02 -03:00
menuSelection ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2020-06-11 16:40:02 -03:00
menuSelection ( )
2020-06-25 18:53:52 +00:00
elif menuV in [ " B " , " b " ] :
2020-05-23 08:50:38 -03:00
try :
clear ( )
2020-08-30 12:23:39 -03:00
blogo ( )
2020-05-23 08:50:38 -03:00
close ( )
donationLNTst ( )
t . sleep ( 50 )
2020-06-11 16:40:02 -03:00
menuSelection ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2020-06-11 16:40:02 -03:00
menuSelection ( )
2020-06-25 18:53:52 +00:00
elif menuV in [ " R " , " r " ] :
2020-06-11 16:40:02 -03:00
menuSelection ( )
2021-11-22 14:48:21 -03:00
def menuFOnchainONLY ( menuV ) : # Tester Donation access Menu
if menuV in [ " A " , " a " ] :
try :
clear ( )
blogo ( )
close ( )
donationAddrTst ( )
t . sleep ( 50 )
menuSelection ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2021-11-22 14:48:21 -03:00
menuSelection ( )
elif menuV in [ " B " , " b " ] :
try :
clear ( )
blogo ( )
close ( )
donationLNTst ( )
t . sleep ( 50 )
menuSelection ( )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
logger . debug ( " Menu error: %s " , e )
2021-11-22 14:48:21 -03:00
menuSelection ( )
elif menuV in [ " R " , " r " ] :
menuSelection ( )
2020-10-18 17:57:46 -03:00
#---------------------------------------------------------------------------------
2022-12-19 16:02:43 +01:00
def nostrConn ( ) :
clear ( )
blogo ( )
sysinfo ( )
2022-12-20 10:14:37 -03:00
2022-12-19 16:02:43 +01:00
if path [ ' bitcoincli ' ] :
n = " Local " if path [ ' bitcoincli ' ] else " Remote "
bitcoincli = " getblockchaininfo "
2026-04-02 17:35:03 -03:00
a = _run_btc ( bitcoincli )
2022-12-19 16:02:43 +01:00
b = json . loads ( a )
d = b
else :
a = " Local " if path [ ' bitcoincli ' ] else " Remote "
blk = rpc ( ' getblockchaininfo ' )
d = blk
2022-12-20 10:14:37 -03:00
2026-04-01 16:19:50 -03:00
from rich . columns import Columns
from rich . text import Text as RText
2022-12-19 16:02:43 +01:00
2026-04-01 16:19:50 -03:00
rich_console . print ( )
rich_console . print ( f " [bold white] { n if path [ ' bitcoincli ' ] else a } [/]: [bold red]PyBLOCK[/] " )
rich_console . print ( f " [bold white]Block[/]: [bold green] { d [ ' blocks ' ] } [/] " )
rich_console . print ( f " [bold white]Version[/]: { version ( ) } " )
rich_console . print ( )
col1 = RText ( )
col1 . append ( " CONSOLE \n " , style = " bold cyan underline " )
col1 . append ( " A. " , style = " bold cyan " )
col1 . append ( " Linux AMD64 \n " , style = " white " )
col1 . append ( " B. " , style = " bold cyan " )
col1 . append ( " Linux ARM64 \n " , style = " white " )
col1 . append ( " C. " , style = " bold cyan " )
col1 . append ( " macOS x64 \n " , style = " white " )
col1 . append ( " D. " , style = " bold cyan " )
col1 . append ( " macOS ARM64 (SOON) \n " , style = " white " )
col1 . append ( " E. " , style = " bold cyan " )
col1 . append ( " Windows \n " , style = " white " )
col2 = RText ( )
col2 . append ( " TOOLS \n " , style = " bold green underline " )
col2 . append ( " S. " , style = " bold green " )
col2 . append ( " Seed BIP39 \n " , style = " white " )
col2 . append ( " W. " , style = " bold green " )
col2 . append ( " QR Seed \n " , style = " white " )
col2 . append ( " Z. " , style = " bold green " )
col2 . append ( " Bija \n " , style = " white " )
rich_console . print ( Columns ( [ col1 , col2 ] , padding = ( 0 , 2 ) , expand = False ) )
rich_console . print ( )
rich_console . print ( " [bold red]R.[/] Return " )
rich_console . print ( )
print ( " \x1b [?25h " )
nostrmenu ( rich_prompt ( " Select option " ) )
2022-12-19 16:02:43 +01:00
2020-10-17 23:16:35 -03:00
def testClockRemote ( ) :
b = rpc ( ' getblockcount ' )
c = str ( b )
a = c
output = render ( str ( c ) , colors = [ settingsClock [ ' colorA ' ] , settingsClock [ ' colorB ' ] ] , align = ' left ' )
print ( output )
print ( """
- - - - - - - - - - - - - - - - - - - - - - - - -
Front Color : { }
Back Color : { }
- - - - - - - - - - - - - - - - - - - - - - - - -
""" .format(settingsClock[ ' colorA ' ], settingsClock[ ' colorB ' ]))
try :
print ( " <<< Cancel Control + C " )
input ( " Enter To Apply... " )
settingsClock [ " gradient " ] = " color "
2026-04-01 10:24:47 -03:00
with open ( " pyblocksettingsClock.conf " , " w " ) as f : json . dump ( settingsClock , f , indent = 2 )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 13:13:16 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . debug ( " Suppressed error: %s " , e )
2020-10-17 23:16:35 -03:00
2020-12-07 20:56:35 -03:00
2022-03-16 00:31:26 -03:00
def commandsINIT ( initCONF ) :
intCONF = { " fullbtclnd " : " " , " fullbtc " : " " , " cropped " : " " }
if not os . path . isdir ( " config " ) :
2026-04-01 12:51:41 -03:00
os . makedirs ( " config " , exist_ok = True )
2022-03-16 00:31:26 -03:00
if os . path . isfile ( ' config/intro.conf ' ) :
2026-04-02 14:38:18 -03:00
with open ( " config/intro.conf " , " r " ) as f : intro = json . load ( f )
2022-03-16 00:31:26 -03:00
initCONF = intro
if initCONF [ ' fullbtclnd ' ] :
fullbtclnd ( )
elif initCONF [ ' fullbtc ' ] :
fullbtc ( )
elif initCONF [ ' cropped ' ] :
cropped ( )
else :
if initCONF in [ " A " , " a " ] :
initDATA = " A "
intCONF [ ' fullbtclnd ' ] = initDATA
initPATH = intCONF [ ' fullbtclnd ' ]
2026-04-01 10:24:47 -03:00
with open ( " config/intro.conf " , " w " ) as f : json . dump ( initPATH , f , indent = 2 )
2022-03-16 00:31:26 -03:00
clear ( )
fullbtclnd ( )
elif initCONF in [ " B " , " b " ] :
initDATA = " B "
intCONF [ ' fullbtc ' ] = initDATA
initPATH = intCONF [ ' fullbtc ' ]
2026-04-01 10:24:47 -03:00
with open ( " config/intro.conf " , " w " ) as f : json . dump ( initPATH , f , indent = 2 )
2022-03-16 00:31:26 -03:00
clear ( )
fullbtc ( )
elif initCONF in [ " C " , " c " ] :
initDATA = " C "
intCONF [ ' cropped ' ] = initDATA
initPATH = intCONF [ ' cropped ' ]
2026-04-01 10:24:47 -03:00
with open ( " config/intro.conf " , " w " ) as f : json . dump ( initPATH , f , indent = 2 )
2022-03-16 00:31:26 -03:00
clear ( )
2022-03-16 21:11:20 -03:00
menuSelection ( )
2022-03-16 00:31:26 -03:00
2024-07-26 19:07:59 -03:00
restart_script ( )
def restart_script ( ) :
clear ( )
blogo ( )
print ( " Restarting PyBlock... " )
os . execv ( sys . executable , [ ' python ' ] + sys . argv )
2022-03-16 00:31:26 -03:00
def fullbtc ( ) :
path = { " ip_port " : " " , " rpcuser " : " " , " rpcpass " : " " , " bitcoincli " : " " }
if not os . path . isdir ( " config " ) :
2026-04-01 12:51:41 -03:00
os . makedirs ( " config " , exist_ok = True )
2020-05-24 14:15:12 -03:00
2022-03-16 00:31:26 -03:00
if os . path . isfile ( ' config/bclock.conf ' ) or os . path . isfile ( ' config/blnclock.conf ' ) : # Check if the file 'bclock.conf' is in the same folder
2026-04-02 14:38:18 -03:00
with open ( " config/bclock.conf " , " r " ) as f : pathv = json . load ( f )
2022-03-16 00:31:26 -03:00
path = pathv # Copy the variable pathv to 'path'
else :
blogo ( )
print ( " Welcome to \033 [1;31;40mPyBLOCK \033 [0;37;40m \n \n " )
2024-02-05 23:57:25 +01:00
print ( " \n \t If you are going to use your local node leave IP:PORT/USER/PASSWORD in 𝗕 𝗟 𝗔 𝗡 𝗞 . \n " )
2026-04-02 14:38:18 -03:00
ip_port_input = input ( " Insert IP:PORT to access your remote Bitcoin-Cli node: " ) . strip ( )
import re
if ip_port_input and not re . match ( r ' ^[ \ w. \ -]+: \ d+$ ' , ip_port_input ) :
print ( " \n Invalid format. Expected: hostname:port (e.g. 192.168.1.1:8332) \n " )
return
path [ ' ip_port ' ] = f " http:// { ip_port_input } "
2022-03-16 00:31:26 -03:00
path [ ' rpcuser ' ] = input ( " RPC User: " )
Security audit round 2: eliminate shell=True, mask secrets, fix race conditions
- Replace all shell=True subprocess calls with Python-native processing
(nodeconnection.py, SPV/nodeconnection.py, SPV/ppi.py)
- Mask sensitive inputs (private keys, passwords, tokens) with getpass
- Add threading.Lock to block_explorer.py shared state
- Use json.loads() instead of fragile string splitting in apisnd.py
- Add path validation before file open in apisnd.py
- Replace random.randint with secrets.randbelow for mining nonces
- Fix destructive exception handlers in clone.py and feed.py
- Replace bare except clauses with specific exceptions + logging
- Remove unused imports (psutil, xmltodict, block_visualizer, base64, say)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:15:59 -03:00
path [ ' rpcpass ' ] = getpass . getpass ( " RPC Password: " )
2022-03-16 00:31:26 -03:00
print ( " \n \t Local Bitcoin Core Node connection. \n " )
2024-02-05 23:57:25 +01:00
path [ ' bitcoincli ' ] = input ( " Insert the Path to Bitcoin-Cli. Normally you just need to type 𝙗 𝙞 𝙩 𝙘 𝙤 𝙞 𝙣 -𝙘 𝙡 𝙞 : " )
2026-04-01 10:24:47 -03:00
with open ( " config/bclock.conf " , " w " ) as f : json . dump ( path , f , indent = 2 )
2022-03-16 00:31:26 -03:00
menuSelection ( )
def fullbtclnd ( ) :
path = { " ip_port " : " " , " rpcuser " : " " , " rpcpass " : " " , " bitcoincli " : " " }
lndconnectload = { " ip_port " : " " , " tls " : " " , " macaroon " : " " , " ln " : " " }
if not os . path . isdir ( " config " ) :
2026-04-01 12:51:41 -03:00
os . makedirs ( " config " , exist_ok = True )
2022-03-16 00:31:26 -03:00
if os . path . isfile ( ' config/bclock.conf ' ) or os . path . isfile ( ' config/blnclock.conf ' ) : # Check if the file 'bclock.conf' is in the same folder
2026-04-02 14:38:18 -03:00
with open ( " config/bclock.conf " , " r " ) as f : pathv = json . load ( f )
2022-03-16 00:31:26 -03:00
path = pathv # Copy the variable pathv to 'path'
else :
blogo ( )
print ( " Welcome to \033 [1;31;40mPyBLOCK \033 [0;37;40m \n \n " )
2022-03-17 21:36:46 +01:00
print ( " \n \t If you are going to use your local node leave IP:PORT/USER/PASSWORD in 𝗕 𝗟 𝗔 𝗡 𝗞 . \n " )
2026-04-02 14:38:18 -03:00
ip_port_input = input ( " Insert IP:PORT to access your remote Bitcoin-Cli node: " ) . strip ( )
import re
if ip_port_input and not re . match ( r ' ^[ \ w. \ -]+: \ d+$ ' , ip_port_input ) :
print ( " \n Invalid format. Expected: hostname:port (e.g. 192.168.1.1:8332) \n " )
return
path [ ' ip_port ' ] = f " http:// { ip_port_input } "
2022-03-16 00:31:26 -03:00
path [ ' rpcuser ' ] = input ( " RPC User: " )
Security audit round 2: eliminate shell=True, mask secrets, fix race conditions
- Replace all shell=True subprocess calls with Python-native processing
(nodeconnection.py, SPV/nodeconnection.py, SPV/ppi.py)
- Mask sensitive inputs (private keys, passwords, tokens) with getpass
- Add threading.Lock to block_explorer.py shared state
- Use json.loads() instead of fragile string splitting in apisnd.py
- Add path validation before file open in apisnd.py
- Replace random.randint with secrets.randbelow for mining nonces
- Fix destructive exception handlers in clone.py and feed.py
- Replace bare except clauses with specific exceptions + logging
- Remove unused imports (psutil, xmltodict, block_visualizer, base64, say)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:15:59 -03:00
path [ ' rpcpass ' ] = getpass . getpass ( " RPC Password: " )
2022-03-16 00:31:26 -03:00
print ( " \n \t Local Bitcoin Core Node connection. \n " )
2022-03-19 03:25:00 +01:00
path [ ' bitcoincli ' ] = input ( " Insert the Path to Bitcoin-Cli. Normally you just need to type 𝙗 𝙞 𝙩 𝙘 𝙤 𝙞 𝙣 -𝙘 𝙡 𝙞 : " )
2026-04-01 10:24:47 -03:00
with open ( " config/bclock.conf " , " w " ) as f : json . dump ( path , f , indent = 2 )
2022-03-16 00:31:26 -03:00
2024-02-06 03:25:00 +01:00
if os . path . isfile ( ' config/blndconnect.conf ' ) :
2026-04-03 10:57:20 -03:00
lndconnectload = _load_lnd_config ( )
2022-03-16 00:31:26 -03:00
else :
clear ( )
blogo ( )
if os . path . isfile ( ' config/init.conf ' ) :
2026-04-02 14:38:18 -03:00
with open ( " config/init.conf " , " r " ) as f : pqr = json . load ( f )
2022-03-16 00:31:26 -03:00
yesno = pqr
else :
2024-02-06 22:23:00 +01:00
yesno = input ( " You are going to 𝐜 𝐨 𝐧 𝐧 𝐞 𝐜 𝐭 your 𝐋 𝐢 𝐠 𝐡 𝐭 𝐧 𝐢 𝐧 𝐠 𝐍 𝐨 𝐝 𝐞 , type 𝐘 𝐞 𝐬 to continue: " )
2026-04-01 10:24:47 -03:00
with open ( " config/init.conf " , " w " ) as f : json . dump ( yesno , f , indent = 2 )
2024-02-06 20:57:11 +01:00
if yesno in [ " YES " , " yes " , " yES " , " yeS " , " Yes " , " YEs " ] :
2022-03-17 21:36:46 +01:00
print ( " \n \t If you are going to use your local node leave IP:PORT/CERT/MACAROONS in 𝗕 𝗟 𝗔 𝗡 𝗞 . \n " )
2024-04-12 16:13:38 -03:00
lndconnectload [ " ip_port " ] = input ( " Insert IP:PORT to your node: " )
2022-03-16 00:31:26 -03:00
lndconnectload [ " tls " ] = input ( " Insert the path to tls.cert file: " )
lndconnectload [ " macaroon " ] = input ( " Insert the path to admin.macaroon: " )
print ( " \n \t Local Lightning Node connection. \n " )
2022-03-19 03:25:00 +01:00
lndconnectload [ " ln " ] = input ( " Insert the Path to Lncli. Normally you just need to type 𝙡 𝙣 𝙘 𝙡 𝙞 : " )
2026-04-01 10:24:47 -03:00
with open ( " config/blndconnect.conf " , " w " ) as f : json . dump ( lndconnectload , f , indent = 2 )
2024-02-06 01:46:06 +01:00
menuSelection ( )
2022-03-16 00:31:26 -03:00
def introINIT ( ) :
if not os . path . isdir ( " config " ) :
2026-04-01 12:51:41 -03:00
os . makedirs ( " config " , exist_ok = True )
2022-03-16 00:31:26 -03:00
clear ( )
blogo ( )
#sysinfo()
print ( """ \t \t
2022-03-19 16:56:52 -03:00
Welcome 𝓒 𝔂 𝓹 𝓱 𝓮 𝓻 𝓹 𝓾 𝓷 𝓴 .
2026-04-01 13:07:21 -03:00
Connect 𝗣𝘆𝗕𝗟Ø𝗖𝗞 to your Nodes or Run Lite Mode ( no node required ) .
2022-03-16 00:31:26 -03:00
2022-03-17 21:36:46 +01:00
\u001b [ 31 ; 1 mA . \033 [ 0 ; 37 ; 40 m 𝗣𝘆𝗕𝗟Ø𝗖𝗞 ( Bitcoin & Lightning )
\u001b [ 38 ; 5 ; 202 mB . \033 [ 0 ; 37 ; 40 m 𝗣𝘆𝗕𝗟Ø𝗖𝗞 ( Bitcoin )
2026-04-01 13:07:21 -03:00
\u001b [ 33 ; 1 mC . \033 [ 0 ; 37 ; 40 m 𝗣𝘆𝗕𝗟Ø𝗖𝗞 ( Lite Mode )
2022-03-16 00:31:26 -03:00
\n \n \x1b [ ? 25 h """ )
commandsINIT ( input ( " \033 [1;32;40mSelect option: \033 [0;37;40m " ) )
#--------------------------------- End Main Menu execution --------------------------------
2020-10-17 23:16:35 -03:00
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
def main ( ) :
global settings , settingsClock , path , lndconnectload
cfg . load ( )
settings = cfg . settings
settingsClock = cfg . settings_clock
while True :
try :
path = cfg . path
lndconnectload = cfg . lndconnectload
clear ( )
if not cfg . has_config ( ' intro.conf ' ) :
set_terminal_background ( )
introINIT ( )
else :
set_terminal_background ( )
menuSelection ( )
except KeyboardInterrupt :
2026-04-01 15:22:50 -03:00
continue # Ctrl+C returns to main menu
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
except Exception as e :
2026-04-01 15:01:19 -03:00
show_error ( str ( e ) )
Refactor architecture: config singleton, logging, menu system, dependencies
Major improvements across 7 areas:
- Add centralized Config singleton (config.py) replacing ~176 config
reloads per session with a single cached load
- Add logging framework (log.py) with RotatingFileHandler, replacing
silent except Exception: pass blocks with structured logging
- Refactor menu system (menu.py) with data-driven color selection,
eliminating ~1,370 lines of duplicate menu functions
- Create shared/ modules extracting 7 utility functions duplicated
between PyBlock.py and SPV/spvblock.py
- Clean dependencies: pin all versions, remove stdlib packages
(asyncio, threading), remove unused imports
- Improve Docker: pin ubuntu:24.04, add non-root user, use venv
- Improve CI: update to actions v4/v5, add test job before publish
- Fix entry point: wrap main loop in def main(), proper module import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:58:24 -03:00
logger . error ( " Fatal error: %s " , e )
sys . exit ( 101 )
if __name__ == " __main__ " :
2026-04-01 13:35:04 -03:00
if " --tui " in sys . argv :
from tui . app import run as run_tui
mode = " lite "
cfg . load ( )
if cfg . has_config ( ' intro.conf ' ) :
Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.
All features are toggleable via Settings → D (Clock Display Settings).
Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00
init_data = cfg . intro_mode
2026-04-01 15:06:07 -03:00
if isinstance ( init_data , str ) :
if init_data == " A " :
mode = " local "
elif init_data == " B " :
mode = " onchain_only "
elif isinstance ( init_data , dict ) :
if init_data . get ( " fullbtclnd " ) :
mode = " local "
elif init_data . get ( " fullbtc " ) :
mode = " onchain_only "
2026-04-01 13:35:04 -03:00
run_tui ( mode = mode )
else :
main ( )