Ejemplo n.º 1
0
def load():
    global G
    global auths
    global common_key
    global unique_id
    global num_relays
    
    auths_str = sys.argv[1]
    processors_str = sys.argv[2]
    
    unique_id = int(sys.argv[3])
    print "Relay id: " + str(unique_id)
    num_relays = int(sys.argv[4])

    try:
        skip_ping = sys.argv[5]
    except Exception as e:
        skip_ping = False
    
    auths = auths_str.split('-')
    processors = processors_str.split('-')
    
    #Make sure all components are up
    all_responsive = True
    if utilities.alive(conf.AUTH_PORT, auths) or skip_ping:
        print "All authorities are responsive"
    else:
        all_responsive = False
        print "Not all authorities are responsive"

    if utilities.alive(conf.PROCESSOR_PORT, processors) or skip_ping:
        print "Processor is responsive."
    else:
        all_responsive = False
        print "Processor is not responsive."
    
    
    if all_responsive == True: #if all components up
        common_key = generate_group_key(auths) #compute common key
        print "Common key: " + str(common_key)
        print "Listening for requests..."
        listen_on_port(conf.RELAY_PORT) #listen for requests
Ejemplo n.º 2
0
def load():
    global G
    global auths
    global relays

    auths_str = sys.argv[1]
    relays_str = sys.argv[2]
    auths = auths_str.split("-")
    relays = relays_str.split("-")

    try:
        skip_ping = sys.argv[3]
    except Exception as e:
        skip_ping = False

    from pycallgraph import PyCallGraph
    from pycallgraph.output import GraphvizOutput

    if utilities.alive(conf.AUTH_PORT, auths) or skip_ping:
        print "Authorities responsive. Listening..."
        listen_on_port(conf.PROCESSOR_PORT)
    else:
        print "Not all authorities are responsive."
Ejemplo n.º 3
0
def load():
    global G
    global auths
    global relays

    auths_str = sys.argv[1]
    relays_str = sys.argv[2]
    auths = auths_str.split('-')
    relays = relays_str.split('-')

    try:
        skip_ping = sys.argv[3]
    except Exception as e:
        skip_ping = False

    from pycallgraph import PyCallGraph
    from pycallgraph.output import GraphvizOutput

    if utilities.alive(conf.AUTH_PORT, auths) or skip_ping:
        print "Authorities responsive. Listening..."
        listen_on_port(conf.PROCESSOR_PORT)
    else:
        print "Not all authorities are responsive."