Esempio n. 1
0
def Non_Interactive_Client():
    Sync_Messanger = Run_HayStack_Client(Function="Sync_Messanger")
    Sync_Messanger.start()
    DynamicPublicLedger = Run_HayStack_Client(Function="Dynamic_Public_Ledger")
    DynamicPublicLedger.start()
    PingFunction = Run_HayStack_Client(Function="Ping_Function")
    PingFunction.start()
    while True:
        User_Input = raw_input(
            "Press 'b' to go back or press 'Enter' for a status >>> ")
        if User_Input == "b":
            Sync_Messanger.Terminate()
            DynamicPublicLedger.Terminate()
            PingFunction.Terminate()
            config.RunTime = False
            break
        else:
            print("Node status: " + Sync_Messanger.Output() +
                  " Block Height: " + str(DynamicPublicLedger.Output()))
Esempio n. 2
0
                        Last_Block = 1
                    if Block == Last_Block:
                        x = Interactive_Client()
                        try:
                            x.Background(Action="Start")
                            x.Third_Screen()
                            x.Background(Action="Stop")
                            Sync_Messanger.Terminate()
                            break
                        except KeyboardInterrupt:
                            x.Background(Action="Stop")
                            Sync_Messanger.Terminate()
                            break
                    else:
                        try:
                            if Sync_Messanger.Output() == "":
                                print(
                                    "Please wait. The node is being started. You can quit via pressing ctrl + c."
                                )
                            else:
                                print("Node is being synced. ---> " +
                                      Sync_Messanger.Output() +
                                      " Current block: " + str(Block))
                            sleep(15)
                        except KeyboardInterrupt:
                            Sync_Messanger.Terminate()
                            break

            except KeyboardInterrupt:
                Node_Finder.Terminate()
                break