From 8c5330fc5bf990b695f92f194ff55811d00bec72 Mon Sep 17 00:00:00 2001 From: curly60e <55191248+curly60e@users.noreply.github.com> Date: Mon, 22 Nov 2021 14:48:21 -0300 Subject: [PATCH 1/3] New corrections +Added wallet for BitcoinCore (WatchONLY) --- PyBlock.py | 1146 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 1103 insertions(+), 43 deletions(-) diff --git a/PyBlock.py b/PyBlock.py index c3c790c..3353682 100644 --- a/PyBlock.py +++ b/PyBlock.py @@ -87,6 +87,66 @@ def getblock(): # get access to bitcoin-cli with the command getblockchaininfo except: break +def getnewaddress(): + 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" + gna = os.popen(path['bitcoincli'] + getadd) + gnaa = gna.read() + gna1 = str(gnaa) + gnb = os.popen(path['bitcoincli'] + getbal) + gnbb= gnb.read() + gnb1 = str(gnbb) + output = render(str("BTC: " + gnb1), colors=['yellow'], align='left', font='tiny') + print("""--------------------------------------------------------------- + {} +---------------------------------------------------------------""".format(output)) + print("\033[1;30;47m") + qr.add_data(gna1) + qr.print_ascii() + print("\033[0;37;40m") + qr.clear() + print("\x1b[?25l" + "Bitcoin Address: " + gna1) + gna.close() + a = gnb1 + while True: + x = a + getbal = " getbalance" + gnb = os.popen(path['bitcoincli'] + getbal) + gnbb= gnb.read() + gnb1 = str(gnbb) + if gnb1 > a: + clear() + blogo() + close() + getadd = " getnewaddress" + gna = os.popen(path['bitcoincli'] + getadd) + gnaa = gna.read() + gna1 = str(gnaa) + output = render(str("BTC: " + gnb1), colors=['yellow'], align='left', font='tiny') + print("""--------------------------------------------------------------- + {} +---------------------------------------------------------------""".format(output)) + print("\033[1;30;47m") + qr.add_data(gna1) + qr.print_ascii() + print("\033[0;37;40m") + qr.clear() + print("\x1b[?25l" + "Bitcoin Address: " + gna1) + gna.close() + a = gnb1 + except: + pass + def getblockcount(): # get access to bitcoin-cli with the command getblockcount bitcoincli = " getblockcount" os.system(path['bitcoincli'] + bitcoincli) @@ -632,6 +692,7 @@ def bitcoincoremenuLOCALOnchainONLY(): \u001b[38;5;202mI.\033[0;37;40m ColdCore \u001b[38;5;202mJ.\033[0;37;40m Whitepaper \u001b[38;5;202mO.\033[0;37;40m OP_RETURN + \u001b[38;5;202mW.\033[0;37;40m Wallet \u001b[33;1mR.\033[0;37;40m Return \n\n\x1b[?25h""".format(n,d['blocks'], version, checkupdate())) bitcoincoremenuLOCALcontrolAOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m")) @@ -1108,6 +1169,39 @@ def dnt(): # Donation selection menu \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuC(input("\033[1;32;40mSelect option: \033[0;37;40m")) +def dntOnchainONLY(): # Donation selection menu + clear() + blogo() + sysinfo() + if path['bitcoincli']: + n = "Local" if path['bitcoincli'] else "Remote" + bitcoincli = " getblockchaininfo" + a = os.popen(path['bitcoincli'] + bitcoincli).read() + b = json.loads(a) + d = b + else: + a = "Local" if path['bitcoincli'] else "Remote" + blk = rpc('getblockchaininfo') + d = blk + + cert_path = lndconnectload["tls"] + macaroon = codecs.encode(open(lndconnectload["macaroon"], 'rb').read(), 'hex') + 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() + print("""\t\t + \033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m + \033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m + \033[1;37;40mVersion\033[0;37;40m: {} + + \u001b[38;5;15mA.\033[0;37;40m Developers Donation + \u001b[38;5;15mB.\033[0;37;40m Testers Donation + \u001b[31;1mR.\033[0;37;40m Return + \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a, d['blocks'], version, checkupdate())) + menuCOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m")) + + def dntDev(): # Dev Donation Menu clear() blogo() @@ -1122,7 +1216,7 @@ def dntDev(): # Dev Donation Menu lncli = " getinfo" lsd = os.popen(lndconnectload['ln'] + lncli).read() lsd0 = str(lsd) - alias = json.loads(lsd0) + alias = json.loads(lsd0), alias['alias'] else: a = "Local" if path['bitcoincli'] else "Remote" blk = rpc('getblockchaininfo') @@ -1147,6 +1241,39 @@ def dntDev(): # Dev Donation Menu \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuE(input("\033[1;32;40mSelect option: \033[0;37;40m")) +def dntDevOnchainONLY(): # Dev Donation Menu + clear() + blogo() + sysinfo() + if path['bitcoincli']: + n = "Local" if path['bitcoincli'] else "Remote" + bitcoincli = " getblockchaininfo" + a = os.popen(path['bitcoincli'] + bitcoincli).read() + b = json.loads(a) + d = b + else: + a = "Local" if path['bitcoincli'] else "Remote" + blk = rpc('getblockchaininfo') + d = blk + + cert_path = lndconnectload["tls"] + macaroon = codecs.encode(open(lndconnectload["macaroon"], 'rb').read(), 'hex') + 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() + print("""\t\t + \033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m + \033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m + \033[1;37;40mVersion\033[0;37;40m: {} + + \u001b[38;5;202mA.\033[0;37;40m Samourai PayNym + \u001b[38;5;202mB.\033[0;37;40m Bitcoin Address + \u001b[33;1mC.\033[0;37;40m Lightning Network + \u001b[31;1mR.\033[0;37;40m Return + \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a, d['blocks'], version, checkupdate())) + menuEOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m")) + def dntTst(): # Tester Donation Menu clear() blogo() @@ -1185,6 +1312,39 @@ def dntTst(): # Tester Donation Menu \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuF(input("\033[1;32;40mSelect option: \033[0;37;40m")) +def dntTstOnchainONLY(): # Tester Donation Menu + clear() + blogo() + sysinfo() + if path['bitcoincli']: + n = "Local" if path['bitcoincli'] else "Remote" + bitcoincli = " getblockchaininfo" + a = os.popen(path['bitcoincli'] + bitcoincli).read() + b = json.loads(a) + d = b + else: + a = "Local" if path['bitcoincli'] else "Remote" + blk = rpc('getblockchaininfo') + d = blk + + cert_path = lndconnectload["tls"] + macaroon = codecs.encode(open(lndconnectload["macaroon"], 'rb').read(), 'hex') + 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() + print("""\t\t + \033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m + \033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m + \033[1;37;40mVersion\033[0;37;40m: {} + + \u001b[38;5;202mA.\033[0;37;40m Bitcoin Address + \u001b[33;1mB.\033[0;37;40m Lightning Network + \u001b[31;1mR.\033[0;37;40m Return + \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a, d['blocks'], version, checkupdate())) + menuFOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m")) + + def satnodeMenu(): # Satnode Menu clear() blogo() @@ -1651,6 +1811,50 @@ def designQ(): \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuDesign(input("\033[1;32;40mSelect option: \033[0;37;40m")) +def designQOnchainONLY(): + clear() + blogo() + sysinfo() + if path['bitcoincli']: + n = "Local" if path['bitcoincli'] else "Remote" + bitcoincli = " getblockchaininfo" + a = os.popen(path['bitcoincli'] + bitcoincli).read() + b = json.loads(a) + d = b + + else: + a = "Local" if path['bitcoincli'] else "Remote" + blk = rpc('getblockchaininfo') + d = blk + + cert_path = lndconnectload["tls"] + macaroon = codecs.encode(open(lndconnectload["macaroon"], 'rb').read(), 'hex') + 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() + print("""\t\t + \033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m + \033[1;37;40mNode\033[0;37;40m: \033[1;33;40m{}\033[0;37;40m + \033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m + \033[1;37;40mVersion\033[0;37;40m: {} + + \033[1;32;40mA.\033[0;37;40m Block + \033[1;31;40mB.\033[0;37;40m Slick + \033[1;31;40mC.\033[0;37;40m Tiny + \033[1;31;40mD.\033[0;37;40m Grid + \033[1;31;40mE.\033[0;37;40m Pallet + \033[1;31;40mF.\033[0;37;40m Shade + \033[1;31;40mG.\033[0;37;40m Chrome + \033[1;31;40mH.\033[0;37;40m Simple + \033[1;31;40mI.\033[0;37;40m Simple Block + \033[1;31;40mJ.\033[0;37;40m 3D + \033[1;31;40mK.\033[0;37;40m Simple 3D + \033[1;31;40mL.\033[0;37;40m Huge + \033[1;36;40mR.\033[0;37;40m Return + \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a, d['blocks'], version, checkupdate())) + menuDesignOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m")) + def designC(): clear() blogo() @@ -1699,6 +1903,50 @@ def designC(): \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuDesignClock(input("\033[1;32;40mSelect option: \033[0;37;40m")) +def designCOnchainONLY(): + clear() + blogo() + sysinfo() + if path['bitcoincli']: + n = "Local" if path['bitcoincli'] else "Remote" + bitcoincli = " getblockchaininfo" + a = os.popen(path['bitcoincli'] + bitcoincli).read() + b = json.loads(a) + d = b + + else: + a = "Local" if path['bitcoincli'] else "Remote" + blk = rpc('getblockchaininfo') + d = blk + + cert_path = lndconnectload["tls"] + macaroon = codecs.encode(open(lndconnectload["macaroon"], 'rb').read(), 'hex') + 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() + print("""\t\t + \033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m + \033[1;37;40mNode\033[0;37;40m: \033[1;33;40m{}\033[0;37;40m + \033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m + \033[1;37;40mVersion\033[0;37;40m: {} + + \033[1;32;40mA.\033[0;37;40m Block + \033[1;31;40mB.\033[0;37;40m Slick + \033[1;31;40mC.\033[0;37;40m Tiny + \033[1;31;40mD.\033[0;37;40m Grid + \033[1;31;40mE.\033[0;37;40m Pallet + \033[1;31;40mF.\033[0;37;40m Shade + \033[1;31;40mG.\033[0;37;40m Chrome + \033[1;31;40mH.\033[0;37;40m Simple + \033[1;31;40mI.\033[0;37;40m Simple Block + \033[1;31;40mJ.\033[0;37;40m 3D + \033[1;31;40mK.\033[0;37;40m Simple 3D + \033[1;31;40mL.\033[0;37;40m Huge + \033[1;36;40mR.\033[0;37;40m Return + \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a, d['blocks'], version, checkupdate())) + menuDesignClockOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m")) + def designCRemote(): clear() blogo() @@ -1786,6 +2034,41 @@ def colors(): \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuColors(input("\033[1;32;40mSelect option: \033[0;37;40m")) +def colorsOnchainONLY(): + clear() + blogo() + sysinfo() + if path['bitcoincli']: + n = "Local" if path['bitcoincli'] else "Remote" + bitcoincli = " getblockchaininfo" + a = os.popen(path['bitcoincli'] + bitcoincli).read() + b = json.loads(a) + d = b + + else: + a = "Local" if path['bitcoincli'] else "Remote" + blk = rpc('getblockchaininfo') + d = blk + + cert_path = lndconnectload["tls"] + macaroon = codecs.encode(open(lndconnectload["macaroon"], 'rb').read(), 'hex') + 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() + print("""\t\t + \033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m + \033[1;37;40mNode\033[0;37;40m: \033[1;33;40m{}\033[0;37;40m + \033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m + \033[1;37;40mVersion\033[0;37;40m: {} + + \033[1;32;40mA.\033[0;37;40m Front Color + \033[1;31;40mB.\033[0;37;40m Back Color + \033[1;31;40mC.\033[0;37;40m Rainbow + \033[1;36;40mR.\033[0;37;40m Return + \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a, d['blocks'], version, checkupdate())) + menuColorsOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m")) + def colorsC(): clear() blogo() @@ -1824,6 +2107,39 @@ def colorsC(): \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuColorsClock(input("\033[1;32;40mSelect option: \033[0;37;40m")) +def colorsCOnchainONLY(): + clear() + blogo() + sysinfo() + if path['bitcoincli']: + n = "Local" if path['bitcoincli'] else "Remote" + bitcoincli = " getblockchaininfo" + a = os.popen(path['bitcoincli'] + bitcoincli).read() + b = json.loads(a) + d = b + else: + a = "Local" if path['bitcoincli'] else "Remote" + blk = rpc('getblockchaininfo') + d = blk + + cert_path = lndconnectload["tls"] + macaroon = codecs.encode(open(lndconnectload["macaroon"], 'rb').read(), 'hex') + 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() + print("""\t\t + \033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m + \033[1;37;40mNode\033[0;37;40m: \033[1;33;40m{}\033[0;37;40m + \033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m + \033[1;37;40mVersion\033[0;37;40m: {} + + \033[1;32;40mA.\033[0;37;40m Front Color + \033[1;31;40mB.\033[0;37;40m Back Color + \033[1;36;40mR.\033[0;37;40m Return + \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a, d['blocks'], version, checkupdate())) + menuColorsClockOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m")) + def colorsCRemote(): clear() blogo() @@ -1907,6 +2223,47 @@ def colorsSelectFront(): \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuColorsSelectFront(input("\033[1;32;40mSelect option: \033[0;37;40m")) +def colorsSelectFrontOnchainONLY(): + clear() + blogo() + sysinfo() + if path['bitcoincli']: + n = "Local" if path['bitcoincli'] else "Remote" + bitcoincli = " getblockchaininfo" + a = os.popen(path['bitcoincli'] + bitcoincli).read() + b = json.loads(a) + d = b + + else: + a = "Local" if path['bitcoincli'] else "Remote" + blk = rpc('getblockchaininfo') + d = blk + + cert_path = lndconnectload["tls"] + macaroon = codecs.encode(open(lndconnectload["macaroon"], 'rb').read(), 'hex') + 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() + print("""\t\t + \033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m + \033[1;37;40mNode\033[0;37;40m: \033[1;33;40m{}\033[0;37;40m + \033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m + \033[1;37;40mVersion\033[0;37;40m: {} + + \033[1;32;40mA.\033[0;37;40m Black + \033[1;31;40mB.\033[0;37;40m Red + \033[1;31;40mC.\033[0;37;40m Green + \033[1;31;40mD.\033[0;37;40m Yellow + \033[1;31;40mE.\033[0;37;40m Blue + \033[1;31;40mF.\033[0;37;40m Magenta + \033[1;31;40mG.\033[0;37;40m Cyan + \033[1;31;40mH.\033[0;37;40m White + \033[1;31;40mI.\033[0;37;40m Gray + \033[1;36;40mR.\033[0;37;40m Return + \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a ,d['blocks'], version, checkupdate())) + menuColorsSelectFrontOncainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m")) + def colorsSelectFrontClock(): clear() blogo() @@ -1952,6 +2309,47 @@ def colorsSelectFrontClock(): \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuColorsSelectFrontClock(input("\033[1;32;40mSelect option: \033[0;37;40m")) +def colorsSelectFrontClockOnchainONLY(): + clear() + blogo() + sysinfo() + if path['bitcoincli']: + n = "Local" if path['bitcoincli'] else "Remote" + bitcoincli = " getblockchaininfo" + a = os.popen(path['bitcoincli'] + bitcoincli).read() + b = json.loads(a) + d = b + + else: + a = "Local" if path['bitcoincli'] else "Remote" + blk = rpc('getblockchaininfo') + d = blk + + cert_path = lndconnectload["tls"] + macaroon = codecs.encode(open(lndconnectload["macaroon"], 'rb').read(), 'hex') + 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() + print("""\t\t + \033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m + \033[1;37;40mNode\033[0;37;40m: \033[1;33;40m{}\033[0;37;40m + \033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m + \033[1;37;40mVersion\033[0;37;40m: {} + + \033[1;32;40mA.\033[0;37;40m Black + \033[1;31;40mB.\033[0;37;40m Red + \033[1;31;40mC.\033[0;37;40m Green + \033[1;31;40mD.\033[0;37;40m Yellow + \033[1;31;40mE.\033[0;37;40m Blue + \033[1;31;40mF.\033[0;37;40m Magenta + \033[1;31;40mG.\033[0;37;40m Cyan + \033[1;31;40mH.\033[0;37;40m White + \033[1;31;40mI.\033[0;37;40m Gray + \033[1;36;40mR.\033[0;37;40m Return + \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , d['blocks'], version, checkupdate())) + menuColorsSelectFrontClockOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m")) + def colorsSelectFrontClockRemote(): clear() blogo() @@ -2042,6 +2440,47 @@ def colorsSelectBack(): \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuColorsSelectBack(input("\033[1;32;40mSelect option: \033[0;37;40m")) +def colorsSelectBackOnchainONLY(): + clear() + blogo() + sysinfo() + if path['bitcoincli']: + n = "Local" if path['bitcoincli'] else "RemotcolorsCe" + bitcoincli = " getblockchaininfo" + a = os.popen(path['bitcoincli'] + bitcoincli).read() + b = json.loads(a) + d = b + + else: + a = "Local" if path['bitcoincli'] else "Remote" + blk = rpc('getblockchaininfo') + d = blk + + cert_path = lndconnectload["tls"] + macaroon = codecs.encode(open(lndconnectload["macaroon"], 'rb').read(), 'hex') + 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() + print("""\t\t + \033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m + \033[1;37;40mNode\033[0;37;40m: \033[1;33;40m{}\033[0;37;40m + \033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m + \033[1;37;40mVersion\033[0;37;40m: {} + + \033[1;32;40mA.\033[0;37;40m Black + \033[1;31;40mB.\033[0;37;40m Red + \033[1;31;40mC.\033[0;37;40m Green + \033[1;31;40mD.\033[0;37;40m Yellow + \033[1;31;40mE.\033[0;37;40m Blue + \033[1;31;40mF.\033[0;37;40m Magenta + \033[1;31;40mG.\033[0;37;40m Cyan + \033[1;31;40mH.\033[0;37;40m White + \033[1;31;40mI.\033[0;37;40m Gray + \033[1;36;40mR.\033[0;37;40m Return + \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a, d['blocks'], version, checkupdate())) + menuColorsSelectBackOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m")) + def colorsSelectBackClock(): clear() blogo() @@ -2052,6 +2491,10 @@ def colorsSelectBackClock(): a = os.popen(path['bitcoincli'] + bitcoincli).read() b = json.loads(a) d = b + lncli = " getinfo" + lsd = os.popen(lndconnectload['ln'] + lncli).read() + lsd0 = str(lsd) + alias = json.loads(lsd0) lncli = " getinfo" lsd = os.popen(lndconnectload['ln'] + lncli).read() @@ -2087,6 +2530,47 @@ def colorsSelectBackClock(): \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuColorsSelectBackClock(input("\033[1;32;40mSelect option: \033[0;37;40m")) +def colorsSelectBackClockOnchainONLY(): + clear() + blogo() + sysinfo() + if path['bitcoincli']: + n = "Local" if path['bitcoincli'] else "Remote" + bitcoincli = " getblockchaininfo" + a = os.popen(path['bitcoincli'] + bitcoincli).read() + b = json.loads(a) + d = b + + else: + a = "Local" if path['bitcoincli'] else "Remote" + blk = rpc('getblockchaininfo') + d = blk + + cert_path = lndconnectload["tls"] + macaroon = codecs.encode(open(lndconnectload["macaroon"], 'rb').read(), 'hex') + 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() + print("""\t\t + \033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m + \033[1;37;40mNode\033[0;37;40m: \033[1;33;40m{}\033[0;37;40m + \033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m + \033[1;37;40mVersion\033[0;37;40m: {} + + \033[1;32;40mA.\033[0;37;40m Black + \033[1;31;40mB.\033[0;37;40m Red + \033[1;31;40mC.\033[0;37;40m Green + \033[1;31;40mD.\033[0;37;40m Yellow + \033[1;31;40mE.\033[0;37;40m Blue + \033[1;31;40mF.\033[0;37;40m Magenta + \033[1;31;40mG.\033[0;37;40m Cyan + \033[1;31;40mH.\033[0;37;40m White + \033[1;31;40mI.\033[0;37;40m Gray + \033[1;36;40mR.\033[0;37;40m Return + \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , d['blocks'], version, checkupdate())) + menuColorsSelectBackClockOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m")) + def colorsSelectBackClockRemote(): clear() blogo() @@ -2170,6 +2654,40 @@ def colorsSelectRainbow(): \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuColorsSelectRainbow(input("\033[1;32;40mSelect option: \033[0;37;40m")) +def colorsSelectRainbowOnchainONLY(): + clear() + blogo() + sysinfo() + if path['bitcoincli']: + n = "Local" if path['bitcoincli'] else "Remote" + bitcoincli = " getblockchaininfo" + a = os.popen(path['bitcoincli'] + bitcoincli).read() + b = json.loads(a) + d = b + + else: + a = "Local" if path['bitcoincli'] else "Remote" + blk = rpc('getblockchaininfo') + d = blk + + cert_path = lndconnectload["tls"] + macaroon = codecs.encode(open(lndconnectload["macaroon"], 'rb').read(), 'hex') + 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() + print("""\t\t + \033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m + \033[1;37;40mNode\033[0;37;40m: \033[1;33;40m{}\033[0;37;40m + \033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m + \033[1;37;40mVersion\033[0;37;40m: {} + + \033[1;32;40mA.\033[0;37;40m Start Color + \033[1;31;40mB.\033[0;37;40m End Color + \033[1;36;40mR.\033[0;37;40m Return + \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , d['blocks'], version, checkupdate())) + menuColorsSelectRainbowOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m")) + def colorsSelectRainbowStart(): clear() blogo() @@ -2215,6 +2733,47 @@ def colorsSelectRainbowStart(): \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuColorsSelectRainbowStart(input("\033[1;32;40mSelect option: \033[0;37;40m")) +def colorsSelectRainbowStartOnchaiONLY(): + clear() + blogo() + sysinfo() + if path['bitcoincli']: + n = "Local" if path['bitcoincli'] else "Remote" + bitcoincli = " getblockchaininfo" + a = os.popen(path['bitcoincli'] + bitcoincli).read() + b = json.loads(a) + d = b + + else: + a = "Local" if path['bitcoincli'] else "Remote" + blk = rpc('getblockchaininfo') + d = blk + + cert_path = lndconnectload["tls"] + macaroon = codecs.encode(open(lndconnectload["macaroon"], 'rb').read(), 'hex') + 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() + print("""\t\t + \033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m + \033[1;37;40mNode\033[0;37;40m: \033[1;33;40m{}\033[0;37;40m + \033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m + \033[1;37;40mVersion\033[0;37;40m: {} + + \033[1;32;40mA.\033[0;37;40m Black + \033[1;31;40mB.\033[0;37;40m Red + \033[1;31;40mC.\033[0;37;40m Green + \033[1;31;40mD.\033[0;37;40m Yellow + \033[1;31;40mE.\033[0;37;40m Blue + \033[1;31;40mF.\033[0;37;40m Magenta + \033[1;31;40mG.\033[0;37;40m Cyan + \033[1;31;40mH.\033[0;37;40m White + \033[1;31;40mI.\033[0;37;40m Gray + \033[1;36;40mR.\033[0;37;40m Return + \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , d['blocks'], version, checkupdate())) + menuColorsSelectRainbowStartOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m")) + def colorsSelectRainbowEnd(): clear() blogo() @@ -2260,6 +2819,51 @@ def colorsSelectRainbowEnd(): \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuColorsSelectRainbowEnd(input("\033[1;32;40mSelect option: \033[0;37;40m")) +def colorsSelectRainbowEndOnchainONLY(): + clear() + blogo() + sysinfo() + if path['bitcoincli']: + n = "Local" if path['bitcoincli'] else "Remote" + bitcoincli = " getblockchaininfo" + a = os.popen(path['bitcoincli'] + bitcoincli).read() + b = json.loads(a) + d = b + + lncli = " getinfo" + lsd = os.popen(lndconnectload['ln'] + lncli).read() + lsd0 = str(lsd) + alias = json.loads(lsd0) + else: + a = "Local" if path['bitcoincli'] else "Remote" + blk = rpc('getblockchaininfo') + d = blk + + cert_path = lndconnectload["tls"] + macaroon = codecs.encode(open(lndconnectload["macaroon"], 'rb').read(), 'hex') + 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() + print("""\t\t + \033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m + \033[1;37;40mNode\033[0;37;40m: \033[1;33;40m{}\033[0;37;40m + \033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m + \033[1;37;40mVersion\033[0;37;40m: {} + + \033[1;32;40mA.\033[0;37;40m Black + \033[1;31;40mB.\033[0;37;40m Red + \033[1;31;40mC.\033[0;37;40m Green + \033[1;31;40mD.\033[0;37;40m Yellow + \033[1;31;40mE.\033[0;37;40m Blue + \033[1;31;40mF.\033[0;37;40m Magenta + \033[1;31;40mG.\033[0;37;40m Cyan + \033[1;31;40mH.\033[0;37;40m White + \033[1;31;40mI.\033[0;37;40m Gray + \033[1;36;40mR.\033[0;37;40m Return + \n\n\x1b[?25h""".format(n if path['bitcoincli'] else a , d['blocks'], version, checkupdate())) + menuColorsSelectRainbowEndOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m")) + def menuSelection(): path = {"ip_port":"", "rpcuser":"", "rpcpass":"", "bitcoincli":""} pathv = pickle.load(open("bclock.conf", "rb")) # Load the file 'bclock.conf' @@ -2278,10 +2882,10 @@ def menuSelection(): else: if os.path.isfile('blndconnect.conf'): chln['offchain'] = "offchain" + pickle.dump(chln, open("selection.conf", "wb")) else: chln['onchain'] = "onchain" - - pickle.dump(chln, open("selection.conf", "wb")) + pickle.dump(chln, open("selection.conf", "wb")) def menuSelectionLN(): @@ -2583,15 +3187,15 @@ def menuSettingsLocalOnchainONLY(menuSTT): if menuSTT in ["A", "a"]: clear() blogo() - designQ() + designQOnchainONLY() elif menuSTT in ["B", "b"]: clear() blogo() - colors() + colorsOnchainONLY() elif menuSTT in ["C", "c"]: clear() blogo() - colorsC() + colorsCOnchainONLY() def menuSettingsRemote(menuSTT): if menuSTT in ["A", "a"]: @@ -2617,6 +3221,16 @@ def menuColors(menuCLS): elif menuCLS in ["F", "f"]: colors() +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() + def menuColorsClock(menuCLS): if menuCLS in ["A", "a"]: colorsSelectFrontClock() @@ -2625,6 +3239,14 @@ def menuColorsClock(menuCLS): elif menuCLS in ["F", "f"]: colors() +def menuColorsClockOnchainONLY(menuCLS): + if menuCLS in ["A", "a"]: + colorsSelectFrontClockOnchainONLY() + elif menuCLS in ["B", "b"]: + colorsSelectBackClockOnchainONLY() + elif menuCLS in ["F", "f"]: + colorsOnchainONLY() + def menuColorsClockRemote(menuCLS): if menuCLS in ["A", "a"]: colorsSelectFrontClockRemote() @@ -2641,6 +3263,14 @@ def menuColorsSelectRainbow(menuRF): elif menuRF in ["F", "f"]: colors() +def menuColorsSelectRainbowOnchainONLY(menuRF): + if menuRF in ["A", "a"]: + colorsSelectRainbowStartOnchaiONLY() + elif menuRF in ["B", "b"]: + colorsSelectRainbowEndOnchainONLY() + elif menuRF in ["F", "f"]: + colorsOnchainONLY() + def menuColorsSelectRainbowEnd(menuCF): if menuCF in ["A", "a"]: clear() @@ -2690,6 +3320,55 @@ def menuColorsSelectRainbowEnd(menuCF): elif menuCF in ["R", "r"]: colors() +def menuColorsSelectRainbowEndOnchainONLY(menuCF): + if menuCF in ["A", "a"]: + clear() + blogo() + settings["colorB"] = "black" + testlogoRB() + elif menuCF in ["B", "b"]: + clear() + blogo() + settings["colorB"] = "red" + testlogoRB() + elif menuCF in ["C", "c"]: + clear() + blogo() + settings["colorB"] = "green" + testlogoRB() + elif menuCF in ["D", "d"]: + clear() + blogo() + settings["colorB"] = "yellow" + testlogo() + elif menuCF in ["E", "e"]: + clear() + blogo() + settings["colorB"] = "blue" + testlogoRB() + elif menuCF in ["F", "f"]: + clear() + blogo() + settings["colorB"] = "magenta" + testlogoRB() + elif menuCF in ["G", "g"]: + clear() + blogo() + settings["colorB"] = "cyan" + testlogoRB() + elif menuCF in ["H", "h"]: + clear() + blogo() + settings["colorB"] = "white" + testlogoRB() + elif menuCF in ["I", "i"]: + clear() + blogo() + settings["colorB"] = "gray" + testlogoRB() + elif menuCF in ["R", "r"]: + colorsOnchainONLY() + def menuColorsSelectRainbowStart(menuCF): if menuCF in ["A", "a"]: clear() @@ -2739,6 +3418,55 @@ def menuColorsSelectRainbowStart(menuCF): elif menuCF in ["R", "r"]: colors() +def menuColorsSelectRainbowStartOnchainONLY(menuCF): + if menuCF in ["A", "a"]: + clear() + blogo() + settings["colorA"] = "black" + testlogoRB() + elif menuCF in ["B", "b"]: + clear() + blogo() + settings["colorA"] = "red" + testlogoRB() + elif menuCF in ["C", "c"]: + clear() + blogo() + settings["colorA"] = "green" + testlogoRB() + elif menuCF in ["D", "d"]: + clear() + blogo() + settings["colorA"] = "yellow" + testlogoRB() + elif menuCF in ["E", "e"]: + clear() + blogo() + settings["colorA"] = "blue" + testlogoRB() + elif menuCF in ["F", "f"]: + clear() + blogo() + settings["colorA"] = "magenta" + testlogoRB() + elif menuCF in ["G", "g"]: + clear() + blogo() + settings["colorA"] = "cyan" + testlogoRB() + elif menuCF in ["H", "h"]: + clear() + blogo() + settings["colorA"] = "white" + testlogoRB() + elif menuCF in ["I", "i"]: + clear() + blogo() + settings["colorA"] = "gray" + testlogoRB() + elif menuCF in ["R", "r"]: + colorsOnchainONLY() + def menuColorsSelectBack(menuCF): if menuCF in ["A", "a"]: clear() @@ -2788,6 +3516,55 @@ def menuColorsSelectBack(menuCF): elif menuCF in ["R", "r"]: colors() +def menuColorsSelectBackOnchainONLY(menuCF): + if menuCF in ["A", "a"]: + clear() + blogo() + settings["colorB"] = "black" + testlogo() + elif menuCF in ["B", "b"]: + clear() + blogo() + settings["colorB"] = "red" + testlogo() + elif menuCF in ["C", "c"]: + clear() + blogo() + settings["colorB"] = "green" + testlogo() + elif menuCF in ["D", "d"]: + clear() + blogo() + settings["colorB"] = "yellow" + testlogo() + elif menuCF in ["E", "e"]: + clear() + blogo() + settings["colorB"] = "blue" + testlogo() + elif menuCF in ["F", "f"]: + clear() + blogo() + settings["colorB"] = "magenta" + testlogo() + elif menuCF in ["G", "g"]: + clear() + blogo() + settings["colorB"] = "cyan" + testlogo() + elif menuCF in ["H", "h"]: + clear() + blogo() + settings["colorB"] = "white" + testlogo() + elif menuCF in ["I", "i"]: + clear() + blogo() + settings["colorB"] = "gray" + testlogo() + elif menuCF in ["R", "r"]: + colorsOnchainONLY() + def menuColorsSelectFront(menuCF): if menuCF in ["A", "a"]: clear() @@ -2837,6 +3614,55 @@ def menuColorsSelectFront(menuCF): elif menuCF in ["R", "r"]: colors() +def menuColorsSelectFrontOncainONLY(menuCF): + if menuCF in ["A", "a"]: + clear() + blogo() + settings["colorA"] = "black" + testlogo() + elif menuCF in ["B", "b"]: + clear() + blogo() + settings["colorA"] = "red" + testlogo() + elif menuCF in ["C", "c"]: + clear() + blogo() + settings["colorA"] = "green" + testlogo() + elif menuCF in ["D", "d"]: + clear() + blogo() + settings["colorA"] = "yellow" + testlogo() + elif menuCF in ["E", "e"]: + clear() + blogo() + settings["colorA"] = "blue" + testlogo() + elif menuCF in ["F", "f"]: + clear() + blogo() + settings["colorA"] = "magenta" + testlogo() + elif menuCF in ["G", "g"]: + clear() + blogo() + settings["colorA"] = "cyan" + testlogo() + elif menuCF in ["H", "h"]: + clear() + blogo() + settings["colorA"] = "white" + testlogo() + elif menuCF in ["I", "i"]: + clear() + blogo() + settings["colorA"] = "gray" + testlogo() + elif menuCF in ["R", "r"]: + colorsOnchainONLY() + def menuColorsSelectFrontClock(menuCF): if menuCF in ["A", "a"]: clear() @@ -2886,6 +3712,55 @@ def menuColorsSelectFrontClock(menuCF): elif menuCF in ["R", "r"]: colors() +def menuColorsSelectFrontClockOnchainONLY(menuCF): + if menuCF in ["A", "a"]: + clear() + blogo() + settingsClock["colorA"] = "black" + testClock() + elif menuCF in ["B", "b"]: + clear() + blogo() + settingsClock["colorA"] = "red" + testClock() + elif menuCF in ["C", "c"]: + clear() + blogo() + settingsClock["colorA"] = "green" + testClock() + elif menuCF in ["D", "d"]: + clear() + blogo() + settingsClock["colorA"] = "yellow" + testClock() + elif menuCF in ["E", "e"]: + clear() + blogo() + settingsClock["colorA"] = "blue" + testClock() + elif menuCF in ["F", "f"]: + clear() + blogo() + settingsClock["colorA"] = "magenta" + testClock() + elif menuCF in ["G", "g"]: + clear() + blogo() + settingsClock["colorA"] = "cyan" + testClock() + elif menuCF in ["H", "h"]: + clear() + blogo() + settingsClock["colorA"] = "white" + testClock() + elif menuCF in ["I", "i"]: + clear() + blogo() + settingsClock["colorA"] = "gray" + testClock() + elif menuCF in ["R", "r"]: + colorsOnchainONLY() + def menuColorsSelectBackClock(menuCF): if menuCF in ["A", "a"]: clear() @@ -2935,6 +3810,55 @@ def menuColorsSelectBackClock(menuCF): elif menuCF in ["R", "r"]: colors() +def menuColorsSelectBackClockOnchainONLY(menuCF): + if menuCF in ["A", "a"]: + clear() + blogo() + settingsClock["colorB"] = "black" + testClock() + elif menuCF in ["B", "b"]: + clear() + blogo() + settingsClock["colorB"] = "red" + testClock() + elif menuCF in ["C", "c"]: + clear() + blogo() + settingsClock["colorB"] = "green" + testClock() + elif menuCF in ["D", "d"]: + clear() + blogo() + settingsClock["colorB"] = "yellow" + testClock() + elif menuCF in ["E", "e"]: + clear() + blogo() + settingsClock["colorB"] = "blue" + testClock() + elif menuCF in ["F", "f"]: + clear() + blogo() + settingsClock["colorB"] = "magenta" + testClock() + elif menuCF in ["G", "g"]: + clear() + blogo() + settingsClock["colorB"] = "cyan" + testClock() + elif menuCF in ["H", "h"]: + clear() + blogo() + settingsClock["colorB"] = "white" + testClock() + elif menuCF in ["I", "i"]: + clear() + blogo() + settingsClock["colorB"] = "gray" + testClock() + elif menuCF in ["R", "r"]: + colorsOnchainONLY() + def menuColorsSelectFrontClockRemote(menuCF): if menuCF in ["A", "a"]: clear() @@ -3095,6 +4019,68 @@ def menuDesign(menuDSN): settings['design'] = "huge" testlogo() +def menuDesignOnchainONLY(menuDSN): + if menuDSN in ["A", "a"]: + clear() + blogo() + settings["design"] = "block" + testlogo() + elif menuDSN in ["B", "b"]: + clear() + blogo() + settings['design'] = "slick" + testlogo() + elif menuDSN in ["C", "c"]: + 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() + #------------API--------------------- def menuPI(menuWN): @@ -3360,7 +4346,7 @@ def mainmenuLOCALcontrolOnchainONLY(menuS): #Execution of the Main Menu options elif menuS in ["P", "p"]: APIMenuLOCALOnchainONLY() elif menuS in ["X", "x"]: - dnt() + dntOnchainONLY() elif menuS in ["U", "u"]: upgrade() elif menuS in ["Q", "q"]: @@ -3487,6 +4473,8 @@ def bitcoincoremenuLOCALcontrolAOnchainONLY(bcore): pdfconvert() elif bcore in ["O", "o"]: bitcoincoremenuLOCALOPRETURN() + elif bcore in ["W", "w"]: + getnewaddress() def bitcoincoremenuLOCALcontrolO(oreturn): if oreturn in ["A", "a"]: @@ -3856,6 +4844,14 @@ def menuC(menuO): # Donation access Menu elif menuO in ["R", "r"]: menuSelection() +def menuCOnchainONLY(menuO): # Donation access Menu + if menuO in ["A", "a"]: + dntDevOnchainONLY() + elif menuO in ["B", "b"]: + dntTstOnchainONLY() + elif menuO in ["R", "r"]: + menuSelection() + def menuD(menuN): # Satnode access Menu if menuN in ["A", "a"]: satnode() @@ -3936,6 +4932,40 @@ def menuE(menuQ): # Dev Donation access Menu elif menuQ in ["R", "r"]: menuSelection() +def menuEOnchainONLY(menuQ): # Dev Donation access Menu + if menuQ in ["A", "a"]: + try: + clear() + blogo() + close() + donationPayNym() + t.sleep(50) + menuSelection() + except: + menuSelection() + elif menuQ in ["B", "b"]: + try: + clear() + blogo() + close() + donationAddr() + t.sleep(50) + menuSelection() + except: + menuSelection() + elif menuQ in ["C", "c"]: + try: + clear() + blogo() + close() + donationLN() + t.sleep(50) + menuSelection() + except: + menuSelection() + elif menuQ in ["R", "r"]: + menuSelection() + def menuF(menuV): # Tester Donation access Menu if menuV in ["A", "a"]: try: @@ -3959,6 +4989,30 @@ def menuF(menuV): # Tester Donation access Menu menuSelection() elif menuV in ["R", "r"]: menuSelection() + +def menuFOnchainONLY(menuV): # Tester Donation access Menu + if menuV in ["A", "a"]: + try: + clear() + blogo() + close() + donationAddrTst() + t.sleep(50) + menuSelection() + except: + menuSelection() + elif menuV in ["B", "b"]: + try: + clear() + blogo() + close() + donationLNTst() + t.sleep(50) + menuSelection() + except: + menuSelection() + elif menuV in ["R", "r"]: + menuSelection() #--------------------------------------------------------------------------------- def testClockRemote(): b = rpc('getblockcount') @@ -3990,44 +5044,50 @@ settings = {"gradient":"", "design":"block", "colorA":"green", "colorB":"yellow" settingsClock = {"gradient":"", "colorA":"green", "colorB":"yellow"} while True: # Loop #try: - clear() - path = {"ip_port":"", "rpcuser":"", "rpcpass":"", "bitcoincli":""} - - if os.path.isfile('bclock.conf') or os.path.isfile('blnclock.conf'): # Check if the file 'bclock.conf' is in the same folder - pathv = pickle.load(open("bclock.conf", "rb")) # Load the file 'bclock.conf' - path = pathv # Copy the variable pathv to 'path' - else: - blogo() - print("Welcome to \033[1;31;40mPyBLOCK\033[0;37;40m\n\n") - print("\n\tIf you are going to use your local node leave IP:PORT/USER/PASSWORD in blank.\n") - path['ip_port'] = "http://{}".format(input("Insert IP:PORT to access your remote Bitcoin-Cli node: ")) - path['rpcuser'] = input("RPC User: ") - path['rpcpass'] = input("RPC Password: ") - print("\n\tLocal Bitcoin Core Node connection.\n") - path['bitcoincli']= input("Insert the Path to Bitcoin-Cli: ") - pickle.dump(path, open("bclock.conf", "wb")) - - if os.path.isfile('blndconnect.conf'): # Check if the file 'bclock.conf' is in the same folder - lndconnectData= pickle.load(open("blndconnect.conf", "rb")) # Load the file 'bclock.conf' - lndconnectload = lndconnectData # Copy the variable pathv to 'path' - else: clear() - blogo() - if os.path.isfile('init.conf'): - pqr = pickle.load(open("init.conf", "rb")) - yesno = pqr + path = {"ip_port":"", "rpcuser":"", "rpcpass":"", "bitcoincli":""} + + if os.path.isfile('bclock.conf') or os.path.isfile('blnclock.conf'): # Check if the file 'bclock.conf' is in the same folder + pathv = pickle.load(open("bclock.conf", "rb")) # Load the file 'bclock.conf' + path = pathv # Copy the variable pathv to 'path' else: - yesno = input("Do you want to connect your Lightning Node? yes/no: ") - pickle.dump(yesno, open("init.conf", "wb")) - if yesno in ["YES", "yes", "yES", "yeS", "Yes", "YEs"]: - print("\n\tIf you are going to use your local node leave IP:PORT/CERT/MACAROONS in blank.\n") - lndconnectload["ip_port"] = input("Insert IP:PORT to your node: ") # path to the bitcoin-cli - lndconnectload["tls"] = input("Insert the path to tls.cert file: ") - lndconnectload["macaroon"] = input("Insert the path to admin.macaroon: ") - print("\n\tLocal Lightning Node connection.\n") - lndconnectload["ln"] = input("Insert the path to lncli: ") - pickle.dump(lndconnectload, open("blndconnect.conf", "wb")) # Save the file 'bclock.conf' - menuSelection() + blogo() + print("Welcome to \033[1;31;40mPyBLOCK\033[0;37;40m\n\n") + print("\n\tIf you are going to use your local node leave IP:PORT/USER/PASSWORD in blank.\n") + path['ip_port'] = "http://{}".format(input("Insert IP:PORT to access your remote Bitcoin-Cli node: ")) + path['rpcuser'] = input("RPC User: ") + path['rpcpass'] = input("RPC Password: ") + print("\n\tLocal Bitcoin Core Node connection.\n") + path['bitcoincli']= input("Insert the Path to Bitcoin-Cli: ") + pickle.dump(path, open("bclock.conf", "wb")) + + if os.path.isfile('blndconnect.conf'): # Check if the file 'bclock.conf' is in the same folder + lndconnectData= pickle.load(open("blndconnect.conf", "rb")) # Load the file 'bclock.conf' + lndconnectload = lndconnectData # Copy the variable pathv to 'path' + else: + clear() + blogo() + if os.path.isfile('init.conf'): + pqr = pickle.load(open("init.conf", "rb")) + yesno = pqr + if yesno in ["NO", "no", "No", "nO"]: + pass + else: + yesno = input("Do you want to connect your Lightning Node? yes/no: ") + pickle.dump(yesno, open("init.conf", "wb")) + if yesno in ["YES", "yes", "yES", "yeS", "Yes", "YEs"]: + print("\n\tIf you are going to use your local node leave IP:PORT/CERT/MACAROONS in blank.\n") + lndconnectload["ip_port"] = input("Insert IP:PORT to your node: ") # path to the bitcoin-cli + lndconnectload["tls"] = input("Insert the path to tls.cert file: ") + lndconnectload["macaroon"] = input("Insert the path to admin.macaroon: ") + print("\n\tLocal Lightning Node connection.\n") + lndconnectload["ln"] = input("Insert the path to lncli: ") + pickle.dump(lndconnectload, open("blndconnect.conf", "wb")) # Save the file 'bclock.conf' + elif yesno in ["NO", "no", "No", "nO"]: + pass + + + menuSelection() #except: From ebd432b3f6814812c69a4196fe459425be30140f Mon Sep 17 00:00:00 2001 From: Sourcery AI <> Date: Mon, 22 Nov 2021 17:49:11 +0000 Subject: [PATCH 2/3] 'Refactored by Sourcery' --- PyBlock.py | 84 +++++++++++++++++++++++++----------------------------- 1 file changed, 39 insertions(+), 45 deletions(-) diff --git a/PyBlock.py b/PyBlock.py index 3353682..7f64564 100644 --- a/PyBlock.py +++ b/PyBlock.py @@ -118,9 +118,9 @@ def getnewaddress(): print("\x1b[?25l" + "Bitcoin Address: " + gna1) gna.close() a = gnb1 + getbal = " getbalance" while True: x = a - getbal = " getbalance" gnb = os.popen(path['bitcoincli'] + getbal) gnbb= gnb.read() gnb1 = str(gnbb) @@ -2882,10 +2882,10 @@ def menuSelection(): else: if os.path.isfile('blndconnect.conf'): chln['offchain'] = "offchain" - pickle.dump(chln, open("selection.conf", "wb")) else: chln['onchain'] = "onchain" - pickle.dump(chln, open("selection.conf", "wb")) + + pickle.dump(chln, open("selection.conf", "wb")) def menuSelectionLN(): @@ -5044,50 +5044,44 @@ settings = {"gradient":"", "design":"block", "colorA":"green", "colorB":"yellow" settingsClock = {"gradient":"", "colorA":"green", "colorB":"yellow"} while True: # Loop #try: + clear() + path = {"ip_port":"", "rpcuser":"", "rpcpass":"", "bitcoincli":""} + + if os.path.isfile('bclock.conf') or os.path.isfile('blnclock.conf'): # Check if the file 'bclock.conf' is in the same folder + pathv = pickle.load(open("bclock.conf", "rb")) # Load the file 'bclock.conf' + path = pathv # Copy the variable pathv to 'path' + else: + blogo() + print("Welcome to \033[1;31;40mPyBLOCK\033[0;37;40m\n\n") + print("\n\tIf you are going to use your local node leave IP:PORT/USER/PASSWORD in blank.\n") + path['ip_port'] = "http://{}".format(input("Insert IP:PORT to access your remote Bitcoin-Cli node: ")) + path['rpcuser'] = input("RPC User: ") + path['rpcpass'] = input("RPC Password: ") + print("\n\tLocal Bitcoin Core Node connection.\n") + path['bitcoincli']= input("Insert the Path to Bitcoin-Cli: ") + pickle.dump(path, open("bclock.conf", "wb")) + + if os.path.isfile('blndconnect.conf'): # Check if the file 'bclock.conf' is in the same folder + lndconnectData= pickle.load(open("blndconnect.conf", "rb")) # Load the file 'bclock.conf' + lndconnectload = lndconnectData # Copy the variable pathv to 'path' + else: clear() - path = {"ip_port":"", "rpcuser":"", "rpcpass":"", "bitcoincli":""} - - if os.path.isfile('bclock.conf') or os.path.isfile('blnclock.conf'): # Check if the file 'bclock.conf' is in the same folder - pathv = pickle.load(open("bclock.conf", "rb")) # Load the file 'bclock.conf' - path = pathv # Copy the variable pathv to 'path' + blogo() + if os.path.isfile('init.conf'): + pqr = pickle.load(open("init.conf", "rb")) + yesno = pqr else: - blogo() - print("Welcome to \033[1;31;40mPyBLOCK\033[0;37;40m\n\n") - print("\n\tIf you are going to use your local node leave IP:PORT/USER/PASSWORD in blank.\n") - path['ip_port'] = "http://{}".format(input("Insert IP:PORT to access your remote Bitcoin-Cli node: ")) - path['rpcuser'] = input("RPC User: ") - path['rpcpass'] = input("RPC Password: ") - print("\n\tLocal Bitcoin Core Node connection.\n") - path['bitcoincli']= input("Insert the Path to Bitcoin-Cli: ") - pickle.dump(path, open("bclock.conf", "wb")) - - if os.path.isfile('blndconnect.conf'): # Check if the file 'bclock.conf' is in the same folder - lndconnectData= pickle.load(open("blndconnect.conf", "rb")) # Load the file 'bclock.conf' - lndconnectload = lndconnectData # Copy the variable pathv to 'path' - else: - clear() - blogo() - if os.path.isfile('init.conf'): - pqr = pickle.load(open("init.conf", "rb")) - yesno = pqr - if yesno in ["NO", "no", "No", "nO"]: - pass - else: - yesno = input("Do you want to connect your Lightning Node? yes/no: ") - pickle.dump(yesno, open("init.conf", "wb")) - if yesno in ["YES", "yes", "yES", "yeS", "Yes", "YEs"]: - print("\n\tIf you are going to use your local node leave IP:PORT/CERT/MACAROONS in blank.\n") - lndconnectload["ip_port"] = input("Insert IP:PORT to your node: ") # path to the bitcoin-cli - lndconnectload["tls"] = input("Insert the path to tls.cert file: ") - lndconnectload["macaroon"] = input("Insert the path to admin.macaroon: ") - print("\n\tLocal Lightning Node connection.\n") - lndconnectload["ln"] = input("Insert the path to lncli: ") - pickle.dump(lndconnectload, open("blndconnect.conf", "wb")) # Save the file 'bclock.conf' - elif yesno in ["NO", "no", "No", "nO"]: - pass - - - menuSelection() + yesno = input("Do you want to connect your Lightning Node? yes/no: ") + pickle.dump(yesno, open("init.conf", "wb")) + if yesno in ["YES", "yes", "yES", "yeS", "Yes", "YEs"]: + print("\n\tIf you are going to use your local node leave IP:PORT/CERT/MACAROONS in blank.\n") + lndconnectload["ip_port"] = input("Insert IP:PORT to your node: ") # path to the bitcoin-cli + lndconnectload["tls"] = input("Insert the path to tls.cert file: ") + lndconnectload["macaroon"] = input("Insert the path to admin.macaroon: ") + print("\n\tLocal Lightning Node connection.\n") + lndconnectload["ln"] = input("Insert the path to lncli: ") + pickle.dump(lndconnectload, open("blndconnect.conf", "wb")) # Save the file 'bclock.conf' + menuSelection() #except: From 889f337a662de0cddd4e1ce2c6acb6002fb3eaf1 Mon Sep 17 00:00:00 2001 From: curly60e <55191248+curly60e@users.noreply.github.com> Date: Mon, 22 Nov 2021 14:52:04 -0300 Subject: [PATCH 3/3] Bug fix --- PyBlock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyBlock.py b/PyBlock.py index 7f64564..611c755 100644 --- a/PyBlock.py +++ b/PyBlock.py @@ -1216,7 +1216,7 @@ def dntDev(): # Dev Donation Menu lncli = " getinfo" lsd = os.popen(lndconnectload['ln'] + lncli).read() lsd0 = str(lsd) - alias = json.loads(lsd0), alias['alias'] + alias = json.loads(lsd0) else: a = "Local" if path['bitcoincli'] else "Remote" blk = rpc('getblockchaininfo')