#Developer: Curly60e #PyBLOCK its a clock of the Bitcoin blockchain. import os import os.path import time as t import pickle import psutil import qrcode import random import xmltodict import sys import subprocess import requests import json import simplejson as json import numpy as np from cfonts import render, say from clone import * from donation import * from feed import * from art import * from logos import * from sysinf import * from pblogo import * from apisnd import * from ppi import * from termcolor import colored, cprint from nodeconnection import * from terminal_matrix.matrix import * from PIL import Image from robohash import Robohash version = "0.9.3" def sysinfo(): #Cpu and memory usage print(" \033[0;37;40m----------------------") print(" \033[3;33;40mCPU Usage: \033[1;32;40m" + str(psutil.cpu_percent()) + "%\033[0;37;40m") print(" \033[3;33;40mMemory Usage: \033[1;32;40m" "{}% \033[0;37;40m".format(int(psutil.virtual_memory().percent))) print(" \033[0;37;40m----------------------") print("\a") def rpc(method, params=[]): payload = json.dumps({ "jsonrpc": "2.0", "id": "minebet", "method": method, "params": params }) path = {"ip_port":"", "rpcuser":"", "rpcpass":"", "bitcoincli":""} if os.path.isfile('bclock.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' return requests.post(path['ip_port'], auth=(path['rpcuser'], path['rpcpass']), data=payload).json()['result'] def getblock(): # get access to bitcoin-cli with the command getblockchaininfo while True: try: bitcoincli = " getblockchaininfo" a = os.popen(path['bitcoincli'] + bitcoincli).read() b = json.loads(a) d = b print(d) clear() print("\033[1;32;40m") blogo() print("\033[0;37;40m") print("<<< Back Control + C.\n\n") print("\n----------------------------------------------------------------------------------------------------") print(""" Chain: {} Blocks: {} Best BlockHash: {} Difficulty: {} Verification Progress: {} Size on Disk: {} Pruned: {} """.format(d['chain'], d['blocks'], d['bestblockhash'], d['difficulty'], d['verificationprogress'], d['size_on_disk'], d['pruned'])) print("----------------------------------------------------------------------------------------------------\n") t.sleep(10) except: break def getblockcount(): # get access to bitcoin-cli with the command getblockcount bitcoincli = " getblockcount" os.system(path['bitcoincli'] + bitcoincli) def getbestblockhash(): # get access to bitcoin-cli with the command getblockcount bitcoincli = " getbestblockhash" os.system(path['bitcoincli'] + bitcoincli) def clear(): # clear the screen os.system('cls' if os.name=='nt' else 'clear') def getgenesis(): # get and decode Genesis block bitcoincli = " getblock 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f 0 | xxd -r -p | hexyl -n 256" os.system(path['bitcoincli'] + bitcoincli) def close(): print("<<< Back Control + C.\n\n") def readHexBlock(): # Hex Decoder using Hexyl on local node hexa = input("Add the Block Hash you want to decode: ") blocknumber = input("Add the Block number: ") decodeBlock = path['bitcoincli'] + " getblock {} {}".format(hexa, blocknumber) + " | xxd -r -p | hexyl -n 256" os.system(decodeBlock) def readHexTx(): # Hex Decoder using Hexyl on an external node hexa = input("Add the Transaction ID. you want to decode: ") decodeTX = path['bitcoincli'] + " getrawtransaction {}".format(hexa) + " | xxd -r -p | hexyl -n 256" os.system(decodeTX) def tmp(): t.sleep(15) def console(): # get into the console from bitcoin-cli print("\t\033[0;37;40mThis is \033[1;33;40mBitcoin-cli's \033[0;37;40mconsole. Type your respective commands you want to display.\n\n") while True: cle = input("\033[1;32;40mconsole $>: \033[0;37;40m") lsd = os.popen(path['bitcoincli'] + " " + cle) lsd0 = lsd.read() lsd1 = str(lsd0) print(lsd1) lsd.close() def screensv(): try: doit() except (KeyboardInterrupt, SystemExit): matrix.close() clear() blogo() menu() def delay_print(s): for c in s: sys.stdout.write(c) sys.stdout.flush() time.sleep(0.25) #------------------------------------------------------ def connected(info): # here we complete the connection to the external node if info in ["Y", "y"]: clear() blogo() print("\nAdd your node information\n") menuUserConn() else: menu() def artist(): # here we convert the result of the command 'getblockcount' on a random art design while True: try: clear() close() design() except: break def design(): bitcoinclient = path['bitcoincli'] + " getblockcount" block = os.popen(str(bitcoinclient)).read() # 'getblockcount' convert to string b = block a = b while True: if os.path.isfile('pyblocksettingsClock.conf') or os.path.isfile('pyblocksettingsClock.conf'): # Check if the file 'bclock.conf' is in the same folder settingsv = pickle.load(open("pyblocksettingsClock.conf", "rb")) # Load the file 'bclock.conf' settingsClock = settingsv # Copy the variable pathv to 'path' else: settingsClock = {"gradient":"", "design":"block", "colorA":"green", "colorB":"yellow"} pickle.dump(settingsClock, open("pyblocksettingsClock.conf", "wb")) bitcoinclient = path['bitcoincli'] + " getblockcount" block = os.popen(str(bitcoinclient)).read() # 'getblockcount' convert to string b = block if b > a: output = render(str(b), colors=[settingsClock['colorA'], settingsClock['colorB']], align='center') print("\a" + output) bitcoinclient = path['bitcoincli'] + " getbestblockhash" bb = os.popen(str(bitcoinclient)).read() ll = bb bitcoinclientgetblock = path['bitcoincli'] + " getblock " + ll qq = os.popen(bitcoinclientgetblock).read() yy = json.loads(qq) mm = yy outputsize = render(str(mm['size']) + " bytes", colors=[settingsClock['colorA'], settingsClock['colorB']], align='center', font='tiny') print(outputsize) outputtxs = render(str(mm['nTx']) + " txs", colors=[settingsClock['colorA'], settingsClock['colorB']], align='center', font='tiny') print(outputtxs) t.sleep(10) break elif b == a: output = render(str(b), colors=[settingsClock['colorA'], settingsClock['colorB']], align='center') print(output) t.sleep(10) clear() close() else: break #--------------------------------- Hex Block Decoder Functions ------------------------------------- def getrawtx(): # show confirmatins from transactions while True: try: clear() blogo() close() tx = input("Insert your TxID: ") 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: bitcoincli = " getrawtransaction " lsd = os.popen(path['bitcoincli'] + bitcoincli + tx + " 1") lsd0 = lsd.read() lsd1 = str(lsd0) lsda = lsd1.split(',') lsdb = lsda[-3] lsdc = str(lsdb) print("\033[0;37;40mTransaction " + "\033[1;31;40m{}\033[0;37;40m".format(tx) + " has:\n" + "\033[1;31;40m{}\033[0;37;40m".format(lsdc)) tmp() lsd.close() input("Continue...") except: break def runthenumbers(): bitcoincli = " gettxoutsetinfo" os.system(path['bitcoincli'] + bitcoincli) input("\nContinue...") def countdownblock(): bitcoinclient = path['bitcoincli'] + " getblockcount" block = os.popen(str(bitcoinclient)).read() # 'getblockcount' convert to string b = block try: a = input("Insert your block target: ") clear() blogo() print(""" --------------------- BLOCK {} COUNTDOWN --------------------- """.format(a)) n = int(b) print("\nCountDown:", b) q = int(a) - int(b) print("Remaining: " + str(q) + " Blocks\n") while a > b: try: bitcoinclient = path['bitcoincli'] + " getblockcount" block = os.popen(str(bitcoinclient)).read() # 'getblockcount' convert to string b = block if a == b: break elif n != int(b): print("CountDown: ", b) q = int(a) - int(b) print("Remaining: " + str(q) + " Blocks\n") n = int(b) except: break print("#RunTheNumbers " + str(a) + " PyBLOCK") input("\nContinue...") except: menuSelection() def countdownblockConn(): b = rpc('getblockcount') c = str(b) try: a = int(input("Insert your block target: ")) clear() blogo() print(""" --------------------- BLOCK {} COUNTDOWN --------------------- """.format(a)) print("\nCountDown:", int(c)) n = int(c) q = int(a) - int(c) print("Remaining: " + str(q) + " Blocks\n") while a > int(c): try: b = rpc('getblockcount') c = str(b) if a == c: break elif n != int(c): print("CountDown: ", c) q = int(a) - int(c) print("Remaining: " + str(q) + " Blocks\n") n = int(c) except: break print("#RunTheNumbers " + str(a) + " PyBLOCK") input("\nContinue...") except: menuSelection() def localHalving(): bitcoinclient = path['bitcoincli'] + " getblockcount" block = os.popen(str(bitcoinclient)).read() # 'getblockcount' convert to string b = block c = b oneh = 0 - int(c) + 210000 twoh = 210000 - int(c) + 210000 thrh = 420000 - int(c) + 210000 forh = 630000 - int(c) + 210000 fifh = 840000 - int(c) + 210000 sixh = 1050000 - int(c) + 210000 sevh = 1260000 - int(c) + 210000 eith = 1470000 - int(c) + 210000 ninh = 1680000 - int(c) + 210000 tenh = 1890000 - int(c) + 210000 q = """ \033[0;37;40m------------------- HALVING CLOCK ------------------- 1st Halving: in {} Blocks {} 2nd Halving: in {} Blocks {} 3rd Halving: in {} Blocks {} 4th Halving: in {} Blocks {} 5th Halving: in {} Blocks {} 6th Halving: in {} Blocks {} 7th Halving: in {} Blocks {} 8th Halving: in {} Blocks {} 9th Halving: in {} Blocks {} 10th Halving: in {} Blocks {} ------------------------------------------------------- """.format("0" if int(c) == 210000 else oneh,"\033[1;32;40mCOMPLETE\033[0;37;40m","0" if int(c) == 420000 else twoh,"\033[1;32;40mCOMPLETE\033[0;37;40m", "0" if int(c) == 630000 else thrh,"\033[1;32;40mCOMPLETE\033[0;37;40m","0" if int(c) == 840000 else forh,"\033[1;32;40mCOMPLETE\033[0;37;40m" if int(c) >= 840000 else "\033[1;35;40mPENDING\033[0;37;40m", "0" if int(c) >= 1050000 else fifh , "\033[1;32;40mCOMPLETE\033[0;37;40m" if int(c) >= 1050000 else "\033[1;35;40mPENDING\033[0;37;40m", sixh, "\033[1;32;40mCOMPLETE\033[0;37;40m" if int(c) >= 1260000 else "\033[1;35;40mPENDING\033[0;37;40m", sevh,"\033[1;32;40mCOMPLETE\033[0;37;40m" if int(c) >= 1470000 else "\033[1;35;40mPENDING\033[0;37;40m", eith,"\033[1;32;40mCOMPLETE\033[0;37;40m" if int(c) >= 1680000 else "\033[1;35;40mPENDING\033[0;37;40m", ninh, "\033[1;32;40mCOMPLETE\033[0;37;40m" if int(c) >= 1890000 else "\033[1;35;40mPENDING\033[0;37;40m", tenh, "\033[1;32;40mCOMPLETE\033[0;37;40m" if int(c) >= 1890000 else "\033[1;35;40mPENDING\033[0;37;40m") print(q) input("\nContinue...") #--------------------------------- End Hex Block Decoder Functions ------------------------------------- #--------------------------------- NYMs ----------------------------------- def get_ansi_color_code(r, g, b): if r == g and g == b: if r < 8: return 16 if r > 248: return 231 return round(((r - 8) / 247) * 24) + 232 return 16 + (36 * round(r / 255 * 5)) + (6 * round(g / 255 * 5)) + round(b / 255 * 5) def get_color(r, g, b): return "\x1b[48;5;{}m \x1b[0m".format(int(get_ansi_color_code(r,g,b))) def robotNym(): try: if path['bitcoincli']: lncli = " getinfo" lsd = os.popen(lndconnectload['ln'] + lncli).read() lsd0 = str(lsd) alias = json.loads(lsd0) else: 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() 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\nContinue...") except: menuSelection() #---------------------------------Warden Terminal---------------------------------- def callGitWardenTerminal(): if not os.path.isdir('warden_terminal'): git = "git clone https://github.com/pxsocs/warden_terminal.git" os.system(git) os.system("cd warden_terminal && python3 node_warden.py") #--------------------------------- Menu section ----------------------------------- def MainMenuLOCAL(): #Main Menu clear() blogo() sysinfo() 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) 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: {} \u001b[31;1mA.\033[0;37;40m PyBLOCK \u001b[38;5;202mB.\033[0;37;40m Bitcoin Core \u001b[33;1mL.\033[0;37;40m Lightning Network \u001b[38;5;40mP.\033[0;37;40m Platforms \u001b[38;5;27mS.\033[0;37;40m Settings \u001b[38;5;15mX.\033[0;37;40m Donate \u001b[38;5;93mQ.\033[0;37;40m Exit \n\n""".format(n, alias['alias'], d['blocks'], version, checkupdate())) mainmenuLOCALcontrol(input("\033[1;32;40mSelect option: \033[0;37;40m")) def MainMenuREMOTE(): #Main Menu clear() blogo() sysinfo() 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: {} \u001b[31;1mA.\033[0;37;40m PyBLOCK \u001b[38;5;202mB.\033[0;37;40m Bitcoin Core \u001b[33;1mL.\033[0;37;40m Lightning Network \u001b[38;5;40mP.\033[0;37;40m Platforms \u001b[38;5;27mS.\033[0;37;40m Settings \u001b[38;5;15mX.\033[0;37;40m Donate \u001b[38;5;93mQ.\033[0;37;40m Exit \n\n""".format(a, alias['alias'], d['blocks'], version, checkupdate())) mainmenuREMOTEcontrol(input("\033[1;32;40mSelect option: \033[0;37;40m")) def bitcoincoremenuLOCAL(): clear() blogo() sysinfo() 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) 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: {} \u001b[38;5;202mA.\033[0;37;40m Bitcoin-cli Console \u001b[38;5;202mB.\033[0;37;40m Show Genesis Block \u001b[38;5;202mC.\033[0;37;40m Show Blockchain Information \u001b[38;5;202mD.\033[0;37;40m Run the Numbers \u001b[38;5;202mE.\033[0;37;40m Decode in HEX \u001b[38;5;202mF.\033[0;37;40m Show QR from a Bitcoin Address \u001b[38;5;202mG.\033[0;37;40m Show confirmations from a transaction \u001b[38;5;202mH.\033[0;37;40m Miscellaneous \u001b[33;1mR.\033[0;37;40m Return \n\n""".format(n, alias['alias'], d['blocks'], version, checkupdate())) bitcoincoremenuLOCALcontrolA(input("\033[1;32;40mSelect option: \033[0;37;40m")) def bitcoincoremenuREMOTE(): clear() blogo() sysinfo() 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: {} \u001b[38;5;202mA.\033[0;37;40m Bitcoin-cli Console \u001b[38;5;202mB.\033[0;37;40m Show Blockchain Information \u001b[38;5;202mC.\033[0;37;40m Run the Numbers \u001b[38;5;202mD.\033[0;37;40m Show QR from a Bitcoin Address \u001b[38;5;202mE.\033[0;37;40m Miscellaneous \u001b[33;1mR.\033[0;37;40m Return \n\n""".format(a, alias['alias'], d['blocks'], version, checkupdate())) bitcoincoremenuREMOTEcontrol(input("\033[1;32;40mSelect option: \033[0;37;40m")) def lightningnetworkLOCAL(): clear() blogo() sysinfo() 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) 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: {} \u001b[33;1mA.\033[0;37;40m Lncli Console \u001b[33;1mB.\033[0;37;40m New Invoice \u001b[33;1mC.\033[0;37;40m Pay Invoice \u001b[33;1mD.\033[0;37;40m Make a KeySend Payment \u001b[33;1mE.\033[0;37;40m New Bitcoin Address \u001b[33;1mF.\033[0;37;40m List Invoices \u001b[33;1mG.\033[0;37;40m Channel Balance \u001b[33;1mH.\033[0;37;40m Show Channels \u001b[33;1mI.\033[0;37;40m Rebalance Channel \u001b[33;1mJ.\033[0;37;40m Show Peers \u001b[33;1mK.\033[0;37;40m Connect Peers \u001b[33;1mL.\033[0;37;40m Onchain Balance \u001b[33;1mM.\033[0;37;40m List Onchain Transactions \u001b[33;1mN.\033[0;37;40m Get Node Info \u001b[33;1mO.\033[0;37;40m Get Network Information \u001b[31;1mR.\033[0;37;40m Return \n\n""".format(n, alias['alias'], d['blocks'], version, checkupdate())) lightningnetworkLOCALcontrol(input("\033[1;32;40mSelect option: \033[0;37;40m")) def lightningnetworkREMOTE(): clear() blogo() sysinfo() 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: {} \u001b[33;1mA.\033[0;37;40m New Invoice \u001b[33;1mB.\033[0;37;40m Pay Invoice \u001b[33;1mC.\033[0;37;40m New Bitcoin Address \u001b[33;1mD.\033[0;37;40m List Invoices \u001b[33;1mE.\033[0;37;40m Channel Balance \u001b[33;1mF.\033[0;37;40m Show Channels \u001b[33;1mG.\033[0;37;40m Onchain Balance \u001b[33;1mH.\033[0;37;40m List Onchain Transactions \u001b[33;1mI.\033[0;37;40m Get Node Info \u001b[31;1mR.\033[0;37;40m Return \n\n""".format(a, alias['alias'], d['blocks'], version, checkupdate())) lightningnetworkREMOTEcontrol(input("\033[1;32;40mSelect option: \033[0;37;40m")) def APIMenuLOCAL(): 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 TippinMe FREE \033[1;32;40mB.\033[0;37;40m Tallycoin FREE \033[1;32;40mC.\033[0;37;40m Mempool FREE \033[1;32;40mD.\033[0;37;40m CoinGecko FREE \033[1;32;40mE.\033[0;37;40m Rate.sx FREE \033[1;32;40mF.\033[0;37;40m BWT FREE \033[1;32;40mG.\033[0;37;40m LNBits \033[3;35;40m{lnbitspaid}\033[0;37;40m \033[1;32;40mH.\033[0;37;40m LNPay \033[3;35;40m{lnpaypaid}\033[0;37;40m \033[1;32;40mI.\033[0;37;40m OpenNode \033[3;35;40m{opennodepaid}\033[0;37;40m \033[1;32;40mJ.\033[0;37;40m SatNode FREE \033[1;32;40mK.\033[0;37;40m Weather FREE \033[1;32;40mL.\033[0;37;40m Arcade FREE \u001b[31;1mR.\033[0;37;40m Return \n\n""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate(),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")) platfformsLOCALcontrol(input("\033[1;32;40mSelect option: \033[0;37;40m")) def decodeHex(): clear() blogo() sysinfo() 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) 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: {} \u001b[38;5;202mA.\033[0;37;40m Decode Blocks in HEX \u001b[38;5;202mB.\033[0;37;40m Decode Transactions in HEX \u001b[31;1mQ.\033[0;37;40m Return \n\n""".format(n, alias['alias'], d['blocks'], version, checkupdate())) decodeHexLOCAL(input("\033[1;32;40mSelect option: \033[0;37;40m")) def miscellaneousLOCAL(): 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: {} \u001b[38;5;202mA.\033[0;37;40m FunB \u001b[38;5;202mB.\033[0;37;40m Sysinfo \u001b[31;1mR.\033[0;37;40m Return \n\n""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) miscellaneousLOCALmenu(input("\033[1;32;40mSelect option: \033[0;37;40m")) def runTheNumbersMenu(): 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 Countdown Block \033[1;32;40mB.\033[0;37;40m Countdown Halving \033[1;32;40mC.\033[0;37;40m Audit \u001b[31;1mR.\033[0;37;40m Return \n\n""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) runTheNumbersControl(input("\033[1;32;40mSelect option: \033[0;37;40m")) def runTheNumbersMenuConn(): 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 Countdown Block \033[1;32;40mB.\033[0;37;40m Countdown Halving \033[1;32;40mC.\033[0;37;40m Audit \u001b[31;1mR.\033[0;37;40m Return \n\n""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) runTheNumbersControlConn(input("\033[1;32;40mSelect option: \033[0;37;40m")) def weatherMenu(): 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 Version 1 \033[1;32;40mB.\033[0;37;40m Version 2 \u001b[31;1mR.\033[0;37;40m Return \n\n""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuWeather(input("\033[1;32;40mSelect option: \033[0;37;40m")) def dnt(): # 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 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: {} \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""".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 dntDev(): # 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 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: {} \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""".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 dntTst(): # 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 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: {} \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""".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 satnodeMenu(): # Satnode 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 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 Start SatNode \033[1;32;40mB.\033[0;37;40m Feed \033[1;32;40mC.\033[0;37;40m Setup \033[1;34;40mS.\033[0;37;40m Send a Message to Space \u001b[31;1mR.\033[0;37;40m Return \n\n""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuD(input("\033[1;32;40mSelect option: \033[0;37;40m")) def rateSX(): 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 Rate \033[1;32;40mB.\033[0;37;40m Chart \u001b[31;1mR.\033[0;37;40m Return \n\n""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) rateSXMenu(input("\033[1;32;40mSelect option: \033[0;37;40m")) def mempoolmenu(): 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 Blocks \033[1;32;40mB.\033[0;37;40m Recommended Fee \u001b[31;1mR.\033[0;37;40m Return \n\n""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) mempoolmenuS(input("\033[1;32;40mSelect option: \033[0;37;40m")) def APILnbit(): bitLN = {"NN":"","pd":""} if os.path.isfile('lnbitSN.conf'): # Check if the file 'bclock.conf' is in the same folder bitData= pickle.load(open("lnbitSN.conf", "rb")) # Load the file 'bclock.conf' bitLN = bitData # Copy the variable pathv to 'path' 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[0;37;40mLNBits SN:{} \033[1;34;40mPremium\033[0;37;40m \033[1;32;40mA.\033[0;37;40m New Invoice \033[1;32;40mB.\033[0;37;40m Pay Invoice \033[1;32;40mC.\033[0;37;40m New PayWall \033[1;32;40mD.\033[0;37;40m Delete PayWall \033[1;32;40mE.\033[0;37;40m List PayWalls \u001b[31;1mR.\033[0;37;40m Return \n\n""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, bitLN['NN'], checkupdate())) menuLNBPI(input("\033[1;32;40mSelect option: \033[0;37;40m")) def APILnPay(): bitLN = {"NN":"","pd":""} if os.path.isfile('lnpaySN.conf'): # Check if the file 'bclock.conf' is in the same folder bitData= pickle.load(open("lnpaySN.conf", "rb")) # Load the file 'bclock.conf' bitLN = bitData # Copy the variable pathv to 'path' 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[0;37;40mLNPay SN:{} \033[1;34;40mPremium\033[0;37;40m \033[1;32;40mA.\033[0;37;40m New Invoice \033[1;32;40mB.\033[0;37;40m Pay Invoice \033[1;32;40mC.\033[0;37;40m Wallet Balance \033[1;32;40mD.\033[0;37;40m List Invoices \033[1;32;40mE.\033[0;37;40m Transfer Between Wallets \u001b[31;1mR.\033[0;37;40m Return \n\n""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, bitLN['NN'], checkupdate())) menuLNPAY(input("\033[1;32;40mSelect option: \033[0;37;40m")) def APIOpenNode(): bitLN = {"NN":"","pd":""} if os.path.isfile('opennodeSN.conf'): # Check if the file 'bclock.conf' is in the same folder bitData= pickle.load(open("opennodeSN.conf", "rb")) # Load the file 'bclock.conf' bitLN = bitData # Copy the variable pathv to 'path' 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[0;37;40mOpenNode SN:{} \033[1;34;40mPremium\033[0;37;40m \033[1;32;40mA.\033[0;37;40m New Invoice \033[1;32;40mB.\033[0;37;40m Pay Invoice \033[1;32;40mC.\033[0;37;40m Wallet Balance \033[1;32;40mD.\033[0;37;40m List Payments \033[1;32;40mS.\033[0;37;40m Status \u001b[31;1mR.\033[0;37;40m Return \n\n""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, bitLN['NN'], checkupdate())) menuOpenNode(input("\033[1;32;40mSelect option: \033[0;37;40m")) def APITippinMe(): 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[0;37;40mTippinMe \033[1;32;40mA.\033[0;37;40m New Invoice \u001b[31;1mR.\033[0;37;40m Return \n\n""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuTippinMe(input("\033[1;32;40mSelect option: \033[0;37;40m")) def APITallyCo(): 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[0;37;40mTallyCoin \033[1;32;40mA.\033[0;37;40m Get Payment \033[1;32;40mB.\033[0;37;40m Tip User \u001b[31;1mR.\033[0;37;40m Return \n\n""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuTallyCo(input("\033[1;32;40mSelect option: \033[0;37;40m")) #-------------------------------- SETTINGS ----------------------------------------------- def settings4Local(): clear() blogo() sysinfo() 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) 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: {} \u001b[38;5;27mA.\033[0;37;40m Change Logo Design \u001b[38;5;27mB.\033[0;37;40m Change Logo Colors \u001b[38;5;27mC.\033[0;37;40m Change Clock Colors \u001b[31;1mR.\033[0;37;40m Return \n\n""".format(n, alias['alias'], d['blocks'], version, checkupdate())) menuSettingsLocal(input("\033[1;32;40mSelect option: \033[0;37;40m")) def settings4Remote(): clear() blogo() sysinfo() 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: {} \u001b[38;5;27mA.\033[0;37;40m Change Logo Design \u001b[38;5;27mB.\033[0;37;40m Change Logo Colors \u001b[38;5;27mC.\033[0;37;40m Change Clock Colors \u001b[31;1mR.\033[0;37;40m Return \n\n""".format(a, alias['alias'], d['blocks'], version, checkupdate())) menuSettingsRemote(input("\033[1;32;40mSelect option: \033[0;37;40m")) def designQ(): 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 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""".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 designC(): 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 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""".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 designCRemote(): 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 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""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuDesignClockRemote(input("\033[1;32;40mSelect option: \033[0;37;40m")) def colors(): 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 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""".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 colorsC(): 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 Front Color \033[1;31;40mB.\033[0;37;40m Back Color \033[1;36;40mR.\033[0;37;40m Return \n\n""".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 colorsCRemote(): 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 Front Color \033[1;31;40mB.\033[0;37;40m Back Color \033[1;36;40mR.\033[0;37;40m Return \n\n""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuColorsClockRemote(input("\033[1;32;40mSelect option: \033[0;37;40m")) def colorsSelectFront(): 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""".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 colorsSelectFrontClock(): 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""".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 colorsSelectFrontClockRemote(): 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""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuColorsSelectFrontClockRemote(input("\033[1;32;40mSelect option: \033[0;37;40m")) def colorsSelectBack(): 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""".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 colorsSelectBackClock(): 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""".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 colorsSelectBackClockRemote(): 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""".format(n if path['bitcoincli'] else a , alias['alias'], d['blocks'], version, checkupdate())) menuColorsSelectBackClockRemote(input("\033[1;32;40mSelect option: \033[0;37;40m")) def colorsSelectRainbow(): 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 Start Color \033[1;31;40mB.\033[0;37;40m End Color \033[1;36;40mR.\033[0;37;40m Return \n\n""".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 colorsSelectRainbowStart(): 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""".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 colorsSelectRainbowEnd(): 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""".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 menuSelection(): path = {"ip_port":"", "rpcuser":"", "rpcpass":"", "bitcoincli":""} pathv = pickle.load(open("bclock.conf", "rb")) # Load the file 'bclock.conf' path = pathv # Copy the variable pathv to 'path' if path['bitcoincli']: MainMenuLOCAL() else: MainMenuREMOTE() def menuSelectionLN(): lndconnectload = {"ip_port":"", "tls":"", "macaroon":"", "lncli":""} lndconnectData = pickle.load(open("blndconnect.conf", "rb")) # Load the file 'bclock.conf' lndconnectload = lndconnectData # Copy the variable pathv to 'path' if lndconnectload['ln']: menuLNDLOCAL() else: menuLND() def aaccPPiLNBits(): try: bitLN = {"NN":"","pd":""} if os.path.isfile('lnbitSN.conf'): bitData= pickle.load(open("lnbitSN.conf", "rb")) bitLN = bitData APILnbit() else: qr = qrcode.QRCode( version=1, error_correction=qrcode.constants.ERROR_CORRECT_L, box_size=10, border=4, ) bitLN['NN'] = randrange(10000000) curl = 'curl -X POST https://lnbits.com/api/v1/payments -d ' + "'{" + """"out": false, "amount": 100000, "memo": "LNBits on PyBLOCK {}" """.format(bitLN['NN']) + "}'" + """ -H "X-Api-Key: 1d646820055e4e2da218e801eaacfc94 " -H "Content-type: application/json" """ sh = os.popen(curl).read() clear() blogo() n = str(sh) d = json.loads(n) q = d['payment_request'] c = q.lower() while True: print("\033[1;30;47m") qr.add_data(c) qr.print_ascii() print("\033[0;37;40m") qr.clear() print("Lightning Invoice: " + c) dn = str(d['checking_id']) t.sleep(10) checkcurl = 'curl -X GET https://lnbits.com/api/v1/payments/' + dn + """ -H "X-Api-Key: 1d646820055e4e2da218e801eaacfc94" -H "Content-type: application/json" """ rsh = os.popen(checkcurl).read() clear() blogo() nn = str(rsh) dd = json.loads(nn) db = dd['paid'] if db is not True: continue clear() blogo() tick() bitLN['pd'] = "PAID" pickle.dump(bitLN, open("lnbitSN.conf", "wb")) createFileConnLNBits() break except: clear() blogo() print("\n\tSERIAL NUMBER NOT FOUND\n") input("Continue...") def aaccPPiLNPay(): try: bitLN = {"NN":"","pd":""} if os.path.isfile('lnpaySN.conf'): # Check if the file 'bclock.conf' is in the same folder bitData= pickle.load(open("lnpaySN.conf", "rb")) # Load the file 'bclock.conf' bitLN = bitData # Copy the variable pathv to 'path' APILnPay() else: qr = qrcode.QRCode( version=1, error_correction=qrcode.constants.ERROR_CORRECT_L, box_size=10, border=4, ) bitLN['NN'] = randrange(10000000) curl = 'curl -X POST https://lnbits.com/api/v1/payments -d ' + "'{" + """"out": false, "amount": 100000, "memo": "LNPay on PyBLOCK {}" """.format(bitLN['NN']) + "}'" + """ -H "X-Api-Key: 1d646820055e4e2da218e801eaacfc94 " -H "Content-type: application/json" """ sh = os.popen(curl).read() clear() blogo() n = str(sh) d = json.loads(n) q = d['payment_request'] c = q.lower() while True: print("\033[1;30;47m") qr.add_data(c) qr.print_ascii() print("\033[0;37;40m") qr.clear() print("Lightning Invoice: " + c) dn = str(d['checking_id']) t.sleep(10) checkcurl = 'curl -X GET https://lnbits.com/api/v1/payments/' + dn + """ -H "X-Api-Key: 1d646820055e4e2da218e801eaacfc94" -H "Content-type: application/json" """ rsh = os.popen(checkcurl).read() clear() blogo() nn = str(rsh) dd = json.loads(nn) db = dd['paid'] if db is not True: continue clear() blogo() tick() bitLN['pd'] = "PAID" pickle.dump(bitLN, open("lnpaySN.conf", "wb")) createFileConnLNPay() break except: clear() blogo() print("\n\tSERIAL NUMBER NOT FOUND\n") input("Continue...") def aaccPPiOpenNode(): try: bitLN = {"NN":"","pd":""} if os.path.isfile('opennodeSN.conf'): # Check if the file 'bclock.conf' is in the same folder bitData= pickle.load(open("opennodeSN.conf", "rb")) # Load the file 'bclock.conf' bitLN = bitData # Copy the variable pathv to 'path' APIOpenNode() else: qr = qrcode.QRCode( version=1, error_correction=qrcode.constants.ERROR_CORRECT_L, box_size=10, border=4, ) bitLN['NN'] = randrange(10000000) curl = 'curl -X POST https://lnbits.com/api/v1/payments -d ' + "'{" + """"out": false, "amount": 100000, "memo": "OpenNode on PyBLOCK {}" """.format(bitLN['NN']) + "}'" + """ -H "X-Api-Key: 1d646820055e4e2da218e801eaacfc94 " -H "Content-type: application/json" """ sh = os.popen(curl).read() clear() blogo() n = str(sh) d = json.loads(n) q = d['payment_request'] c = q.lower() while True: print("\033[1;30;47m") qr.add_data(c) qr.print_ascii() print("\033[0;37;40m") qr.clear() print("Lightning Invoice: " + c) dn = str(d['checking_id']) t.sleep(10) checkcurl = 'curl -X GET https://lnbits.com/api/v1/payments/' + dn + """ -H "X-Api-Key: 1d646820055e4e2da218e801eaacfc94" -H "Content-type: application/json" """ rsh = os.popen(checkcurl).read() clear() blogo() nn = str(rsh) dd = json.loads(nn) db = dd['paid'] if db is not True: continue clear() blogo() tick() bitLN['pd'] = "PAID" pickle.dump(bitLN, open("opennodeSN.conf", "wb")) createFileConnOpenNode() break except: clear() blogo() print("\n\tSERIAL NUMBER NOT FOUND\n") input("Continue...") def aaccPPiTippinMe(): if os.path.isfile('tippinme.conf'): # Check if the file 'bclock.conf' is in the same folder APITippinMe() else: createFileTippinMe() def aaccPPiTallyCo(): if os.path.isfile('tallyco.conf'): # Check if the file 'bclock.conf' is in the same folder APITallyCo() else: createFileConnTallyCo() def checkupdate(): 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(" ") else: print("\n---------------------------------------------------") q = print("\n \033[1;31;40mNew version available\033[0;37;40m > Press U to Upgrade\n") print("---------------------------------------------------") def upgrade(): gitfetch = "git fetch" gitchekcout = "git checkout origin/master -- PyBlock.py ppi.py pblogo.py sysinf.py apisnd.py clone.py donation.py feed.py logos.py nodeconnection.py lnd.py logic.py rebalance.py routes.py grpc_generated/router_pb2.py grpc_generated/router_pb2_grpc.py grpc_generated/rpc_pb2.py grpc_generated/rpc_pb2_grpc.py requirements.txt" clear() blogo() b = os.popen(gitfetch).read() a = os.popen(gitchekcout).read() print(b) print(a) print("\n---------------------------------------------------") print("\n\t\033[1;31;40mYou'll need to restart PyBLOCK\033[0;37;40m\n") print("---------------------------------------------------\n") input("Continue...") 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" pickle.dump(settings, open("pyblocksettings.conf", "wb")) except: pass 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" pickle.dump(settings, open("pyblocksettings.conf", "wb")) except: pass def testClock(): bitcoinclient = path['bitcoincli'] + " getblockcount" block = os.popen(str(bitcoinclient)).read() # 'getblockcount' convert to string b = block output = render(str(b), 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" pickle.dump(settingsClock, open("pyblocksettingsClock.conf", "wb")) except: pass #--------------------------------- End Menu section ----------------------------------- #--------------------------------- Main Menu execution -------------------------------- def menuSettingsLocal(menuSTT): if menuSTT in ["A", "a"]: clear() blogo() designQ() elif menuSTT in ["B", "b"]: clear() blogo() colors() elif menuSTT in ["C", "c"]: clear() blogo() colorsC() 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() 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() def menuColorsClock(menuCLS): if menuCLS in ["A", "a"]: colorsSelectFrontClock() elif menuCLS in ["B", "b"]: colorsSelectBackClock() elif menuCLS in ["F", "f"]: colors() def menuColorsClockRemote(menuCLS): if menuCLS in ["A", "a"]: colorsSelectFrontClockRemote() elif menuCLS in ["B", "b"]: colorsSelectBackClockRemote() elif menuCLS in ["F", "f"]: colors() def menuColorsSelectRainbow(menuRF): if menuRF in ["A", "a"]: colorsSelectRainbowStart() elif menuRF in ["B", "b"]: colorsSelectRainbowEnd() elif menuRF in ["F", "f"]: colors() def menuColorsSelectRainbowEnd(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"]: colors() def menuColorsSelectRainbowStart(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"]: colors() def menuColorsSelectBack(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"]: colors() def menuColorsSelectFront(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"]: colors() def menuColorsSelectFrontClock(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"]: colors() def menuColorsSelectBackClock(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"]: colors() def menuColorsSelectFrontClockRemote(menuCF): if menuCF in ["A", "a"]: clear() blogo() settingsClock["colorA"] = "black" testClockRemote() elif menuCF in ["B", "b"]: clear() blogo() settingsClock["colorA"] = "red" testClockRemote() elif menuCF in ["C", "c"]: clear() blogo() settingsClock["colorA"] = "green" testClockRemote() elif menuCF in ["D", "d"]: clear() blogo() settingsClock["colorA"] = "yellow" testClockRemote() elif menuCF in ["E", "e"]: clear() blogo() settingsClock["colorA"] = "blue" testClockRemote() elif menuCF in ["F", "f"]: clear() blogo() settingsClock["colorA"] = "magenta" testClockRemote() elif menuCF in ["G", "g"]: clear() blogo() settingsClock["colorA"] = "cyan" testClockRemote() elif menuCF in ["H", "h"]: clear() blogo() settingsClock["colorA"] = "white" testClockRemote() elif menuCF in ["I", "i"]: clear() blogo() settingsClock["colorA"] = "gray" testClockRemote() elif menuCF in ["R", "r"]: colors() def menuColorsSelectBackClockRemote(menuCF): if menuCF in ["A", "a"]: clear() blogo() settingsClock["colorB"] = "black" testClockRemote() elif menuCF in ["B", "b"]: clear() blogo() settingsClock["colorB"] = "red" testClockRemote() elif menuCF in ["C", "c"]: clear() blogo() settingsClock["colorB"] = "green" testClockRemote() elif menuCF in ["D", "d"]: clear() blogo() settingsClock["colorB"] = "yellow" testClockRemote() elif menuCF in ["E", "e"]: clear() blogo() settingsClock["colorB"] = "blue" testClockRemote() elif menuCF in ["F", "f"]: clear() blogo() settingsClock["colorB"] = "magenta" testClockRemote() elif menuCF in ["G", "g"]: clear() blogo() settingsClock["colorB"] = "cyan" testClockRemote() elif menuCF in ["H", "h"]: clear() blogo() settingsClock["colorB"] = "white" testClockRemote() elif menuCF in ["I", "i"]: clear() blogo() settingsClock["colorB"] = "gray" testClockRemote() elif menuCF in ["R", "r"]: colors() def menuDesign(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): if menuWN in ["A", "a"]: aaccPPiTippinMe() elif menuWN in ["B", "b"]: aaccPPiTallyCo() elif menuWN in ["C", "c"]: mempoolmenu() elif menuWN in ["D", "d"]: clear() blogo() CoingeckoPP() elif menuWN in ["E", "e"]: rateSX() elif menuWN in ["F", "f"]: bwtConn() elif menuWN in ["G", "g"]: aaccPPiLNBits() elif menuWN in ["H", "h"]: aaccPPiLNPay() elif menuWN in ["I", "i"]: aaccPPiOpenNode() def mempoolmenuS(menuMem): if menuMem in ["A", "a"]: blocks() elif menuMem in ["B", "b"]: fee() elif menuMem in ["R", "r"]: menuSelection() def menuTallyCo(menuTLC): if menuTLC in ["A", "a"]: tallycoGetPayment() elif menuTLC in ["B", "b"]: tallycoDonateid() elif menuTLC in ["R", "r"]: menuSelection() def menuTippinMe(menuTM): if menuTM in ["A", "a"]: tippinmeGetInvoice() elif menuTM in ["R", "r"]: menuSelection() def menuOpenNode(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() def menuLNPAY(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() def menuLNBPI(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 ["R", "r"]: menuSelection() def rateSXMenu(menuSX): if menuSX in ["A", "a"]: clear() blogo() rateSXList() elif menuSX in ["B", "b"]: clear() blogo() rateSXGraph() elif menuSX in ["R", "r"]: menuSelection() #---------------END API----------- def runTheNumbersControl(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() def runTheNumbersControlConn(menuNumbersconn): if menuNumbersconn in ["A", "a"]: clear() blogo() countdownblockConn() elif menuNumbersconn in ["B", "b"]: clear() blogo() remoteHalving() elif menuNumbersconn 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']) runthenumbersConn() def menuWeather(menuWD): if menuWD in ["A", "a"]: wttrDataV1() elif menuWD in ["B", "b"]: wttrDataV2() def mainmenuLOCALcontrol(menuS): #Execution of the Main Menu options if menuS in ["A", "a"]: artist() elif menuS in ["B", "b"]: bitcoincoremenuLOCAL() elif menuS in ["L", "l"]: lightningnetworkLOCAL() elif menuS in ["S", "s"]: settings4Local() elif menuS in ["P", "p"]: APIMenuLOCAL() elif menuS in ["X", "x"]: dnt() elif menuS in ["U", "u"]: upgrade() elif menuS in ["Q", "q"]: os._exit(0) apisnd.close() donation.close() clone.close() logos.close() feed.close() sysinf.close() nodeconnection.close() exit() elif menuS in ["T", "t"]: clear() delay_print("\033[1;32;40mWake up, Neo...") t.sleep(2) clear() delay_print("The Matrix has you...") t.sleep(2) 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) screensv() elif menuS in ["nym", "Nym", "NYM", "nYm", "nyM", "NYm", "NyM", "nYM"]: clear() blogo() robotNym() elif menuS in ["wt", "WT", "Wt", "wT"]: clear() blogo() callGitWardenTerminal() def bitcoincoremenuLOCALcontrolA(bcore): if bcore in ["A", "a"]: while True: try: clear() blogo() sysinfo() close() console() t.sleep(5) except: break elif bcore in ["B", "b"]: clear() blogo() getgenesis() input("Continue...") menuSelection() elif bcore in ["C", "c"]: getblock() elif bcore in ["D", "d"]: runTheNumbersMenu() elif bcore in ["E", "e"]: decodeHex() elif bcore in ["F", "f"]: try: clear() blogo() sysinfo() close() decodeQR() input("Continue...") except: pass elif bcore in ["G", "g"]: getrawtx() elif bcore in ["H", "h"]: miscellaneousLOCAL() def miscellaneousLOCALmenu(misce): while True: if misce in ["A", "a"]: try: clear() blogo() close() logoA() tmp() clear() blogo() close() logoB() tmp() clear() blogo() close() logoC() tmp() except: break elif misce in ["B", "b"]: while True: try: clear() blogo() close() sysinfoDetail() t.sleep(1) except: break elif misce in ["R", "r"]: menuSelection() 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 except: pass 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() except: pass def lightningnetworkLOCALcontrol(lncore): if lncore in ["A", "a"]: while True: try: clear() blogo() sysinfo() close() consoleLN() t.sleep(5) except: break 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() elif lncore in ["R", "r"]: menuSelection() 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"]: clear() blogo() CoingeckoPP() elif platf in ["E", "e"]: rateSX() elif platf in ["F", "f"]: bwtConn() elif platf in ["G", "g"]: aaccPPiLNBits() elif platf in ["H", "h"]: aaccPPiLNPay() elif platf in ["I", "i"]: aaccPPiOpenNode() elif platf in ["J", "j"]: satnodeMenu() elif platf in ["K", "k"]: weatherMenu() elif platf in ["L", "l"]: gameroom() elif platf in ["R", "r"]: menuSelection() #----------------------------REMOTE MENUS def mainmenuREMOTEcontrol(menuS): #Execution of the Main Menu options if menuS in ["A", "a"]: while True: try: clear() close() remotegetblock() tmp() except: break elif menuS in ["B", "b"]: bitcoincoremenuREMOTE() elif menuS in ["L", "l"]: lightningnetworkREMOTE() elif menuS in ["P", "p"]: APIMenuLOCAL() elif menuS in ["X", "x"]: dnt() elif menuS in ["U", "u"]: upgrade() elif menuS in ["S", "s"]: settings4Remote() elif menuS in ["Q", "q"]: os._exit(0) apisnd.close() donation.close() clone.close() logos.close() feed.close() sysinf.close() nodeconnection.close() exit() elif menuS in ["T", "t"]: #Test feature fast access clear() delay_print("\033[1;32;40mWake up, Neo...") t.sleep(2) clear() delay_print("The Matrix has you...") t.sleep(2) 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) screensv() elif menuS in ["nym", "Nym", "NYM", "nYm", "nyM", "NYm", "NyM", "nYM"]: clear() blogo() robotNym() elif menuS in ["wt", "WT", "Wt", "wT"]: clear() blogo() callGitWardenTerminal() def bitcoincoremenuREMOTEcontrol(bcore): if bcore in ["A", "a"]: while True: try: clear() blogo() sysinfo() close() remoteconsole() t.sleep(5) except: break elif bcore in ["B", "b"]: remotegetblockcount() elif bcore in ["C", "c"]: runTheNumbersMenuConn() elif bcore in ["D", "d"]: try: clear() blogo() sysinfo() close() decodeQR() input("Continue...") except: pass elif bcore in ["E", "e"]: miscellaneousLOCAL() def lightningnetworkREMOTEcontrol(lncore): if lncore in ["A", "a"]: clear() blogo() getnewinvoice() elif lncore in ["B", "b"]: clear() blogo() payinvoice() elif lncore in ["C", "c"]: clear() blogo() getnewaddress() elif lncore in ["D", "d"]: clear() blogo() listinvoice() elif lncore in ["E", "e"]: clear() blogo() channelbalance() elif lncore in ["F", "f"]: clear() blogo() channels() elif lncore in ["G", "g"]: clear() blogo() balanceOC() elif lncore in ["H", "h"]: clear() blogo() listonchaintxs() elif lncore in ["I", "i"]: clear() blogo() getinfo() elif lncore in ["R", "r"]: menuSelection() def menuC(menuO): # Donation access Menu if menuO in ["A", "a"]: dntDev() elif menuO in ["B", "b"]: dntTst() elif menuO in ["R", "r"]: menuSelection() def menuD(menuN): # Satnode access Menu if menuN in ["A", "a"]: satnode() elif menuN in ["B", "b"]: readFile() elif menuN in ["S", "s"]: try: clear() blogo() close() 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: ") if message in ["F", "f"]: try: clear() blogo() close() apisenderFile() t.sleep(30) menuSelection() except: menuSelection() elif message in ["T", "t"]: try: clear() blogo() close() apisender() t.sleep(30) menuSelection() except: menuSelection() except: menuSelection() elif menuN in ["C", "c"]: 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() except: pass elif menuN in ["R", "r"]: menuSelection() def menuE(menuQ): # Dev Donation access Menu if menuQ in ["A", "a"]: try: clear() blogo() close() donationAddr() t.sleep(50) menuSelection() except: menuSelection() elif menuQ in ["B", "b"]: 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: 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') 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" pickle.dump(settingsClock, open("pyblocksettingsClock.conf", "wb")) except: pass #--------------------------------- End Main Menu execution -------------------------------- 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")) menuSelection() except: print("\n") sys.exit(101)