def val_thread(port):
    val = Validator(port=port)
    val.create_connections()
    while True:
        val.receive()
        if len(val.mempool) == 5:
            blk = val.create_block(0, 5)
            print(blk)
            break
def val_thread(port, leader):
    val = Validator(port=port)
    val.create_connections()
    while True:
        val.receive()