mirror of
https://github.com/curly60e/pyblock.git
synced 2026-08-17 13:07:17 +02:00
Added a new "blockcount" feature
New feature added, the "getblockcount" from bitcoin-cli.
This commit is contained in:
parent
6af49beca8
commit
e38734dfcd
1 changed files with 16 additions and 3 deletions
|
|
@ -3,17 +3,30 @@ import time as t
|
|||
|
||||
|
||||
def getblock(): #get access to bitcoin-cli with the command getblockchaininfo
|
||||
bitcoincli = " getblockchaininfo" #get blockchain information
|
||||
bitcoincli = " getblockchaininfo"
|
||||
os.system(path + bitcoincli)
|
||||
|
||||
def getblockcount(): #get access to bitcoin-cli with the command getblockcount
|
||||
bitcoincli = " getblockcount"
|
||||
os.system(path + bitcoincli)
|
||||
|
||||
def clear(): #clear the screen
|
||||
os.system('cls' if os.name=='nt' else 'clear')
|
||||
|
||||
clear()
|
||||
path = input("Path to your Bitcoin-cli: ")
|
||||
print("Welcome to the Python Block Clock\n\n")
|
||||
path = input("Insert the Path to Bitcoin-Cli: ") #path to the bitcoin-cli
|
||||
a = input("Do you want to see just Block height? 'Yes', for just Block Height. 'No', for full blockchain data. Y/n: ") #select if block height or just fullblockchain information
|
||||
|
||||
|
||||
while True: #Loop
|
||||
clear() #call clear function that clears the screen
|
||||
getblock() #call getblock function
|
||||
|
||||
if a == "y" or a == "Y":
|
||||
getblockcount()
|
||||
else:
|
||||
getblock()
|
||||
|
||||
|
||||
t.sleep(3) #pause the loop for 3 seconds
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue