def main(argv):
    if len(argv) != 1:
        arg_1 = argv[1]
        print("argument 1: " + arg_1)
        if arg_1 == "monitor":
            app = QtWidgets.QApplication(sys.argv)
            monitoring.Main_form = monitoring.Form()
            initialize_process_for_trust_peer()
            sys.exit(app.exec())
    else:
        initialize_process_for_trust_peer()
def main():
    main_form = monitoring.Form()
    logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
    logmsg = "log." + "Start Logchain launcher for TrustPeer..."
    main_form.add_queue_data(logmsg)


    initialize()

    logging.info('Run threads for PeerMgr.')
    if not peermgr.start_peermgr():
        logging.info('Aborted because PeerMgr execution failed.')
        return

    set_peer.set_my_peer_num()
    logging.info("My peer num: " + str(nodeproperty.My_peer_num))

    'Genesis Block Create'
    genesisblock.genesisblock_generate()

    logging.info("Start a thread to receive messages from other peers.")
    recv_thread = receiver.ReceiverThread(
        1, "RECEIVER", nodeproperty.My_IP_address, nodeproperty.My_receiver_port)
    recv_thread.start()
    logging.info("The thread for receiving messages from other peers has started.")


    t_type_qt = t_type_queue_thread.TransactionTypeQueueThread(
        1, "TransactionTypeQueueThread",
        dispatch_queue_list.T_type_q,
        dispatch_queue_list.Connected_socket_q
    )
    t_type_qt.start()

    v_type_qt = v_type_queue_thread.VotingTypeQueueThread(
        1, "VotingTypeQueueThread",
        dispatch_queue_list.V_type_q,
        dispatch_queue_list.Connected_socket_q
    )
    v_type_qt.start()

    b_type_qt = b_type_queue_thread.BlockTypeQueueThread(
        1, "BlockTypeQueueThread",
        dispatch_queue_list.B_type_q,
        dispatch_queue_list.Connected_socket_q
    )
    b_type_qt.start()
def monitoring_run(args=None):
    monitor_app = QtWidgets.QApplication(sys.argv)
    monitoring.Main_form = monitoring.Form(args)
    monitor_app.exec()