def test_set_stun_servers(self):
     new_stun_servers = (
         'stun.openbazaar1.com',
         'stun.openbazaar2.com'
     )
     network_util.set_stun_servers(servers=new_stun_servers)
     self.assertItemsEqual(new_stun_servers, stun.stun_servers_list)
Beispiel #2
0
def start(arguments):
    defaults = OpenBazaarContext.get_defaults()
    network_util.set_stun_servers()

    # Turn off checks that don't make sense in development mode
    if arguments.dev_mode:
        print "DEVELOPMENT MODE! (Disable STUN check and UPnP mappings)"
        arguments.disable_stun_check = True
        arguments.disable_upnp = True

    # Try to get NAT escape UDP port
    nat_status = None
    if not arguments.disable_stun_check:
        print "Checking NAT Status..."
        nat_status = network_util.get_NAT_status()
    elif not arguments.dev_mode and network_util.is_private_ip_address(
            arguments.server_ip):
        print "openbazaar: Could not start. The given/default server IP address",
        print arguments.server_ip, "is not a public ip address."
        print "(Try './openbazaar help' and read about the '--server-ip', '-i' options)"
        sys.exit(1)

    ob_ctxs = create_openbazaar_contexts(arguments, nat_status)

    for ob_ctx in ob_ctxs:
        ensure_database_setup(ob_ctx, defaults)

    if hasattr(sys, 'frozen'):
        start_node(ob_ctxs[0])
    else:
        p = multiprocessing.Process(target=node_starter, args=(ob_ctxs, ))
        p.start()
 def test_set_stun_servers(self):
     new_stun_servers = (
         'stun.openbazaar1.com',
         'stun.openbazaar2.com'
     )
     network_util.set_stun_servers(servers=new_stun_servers)
     self.assertItemsEqual(new_stun_servers, stun.stun_servers_list)
Beispiel #4
0
def start(arguments):
    defaults = OpenBazaarContext.get_defaults()
    network_util.set_stun_servers()

    # Turn off checks that don't make sense in development mode
    if arguments.dev_mode:
        print "DEVELOPMENT MODE! (Disable STUN check and UPnP mappings)"
        arguments.disable_stun_check = True
        arguments.disable_upnp = True

    # Try to get NAT escape UDP port
    nat_status = None
    if not arguments.disable_stun_check:
        print "Checking NAT Status..."
        nat_status = network_util.get_NAT_status()
    elif not arguments.dev_mode and network_util.is_private_ip_address(arguments.server_ip):
        print "openbazaar: Could not start. The given/default server IP address",
        print arguments.server_ip, "is not a public ip address."
        print "(Try './openbazaar help' and read about the '--server-ip', '-i' options)"
        sys.exit(1)

    ob_ctxs = create_openbazaar_contexts(arguments, nat_status)

    for ob_ctx in ob_ctxs:
        ensure_database_setup(ob_ctx, defaults)

    if hasattr(sys, 'frozen'):
        start_node(ob_ctxs[0])
    else:
        p = multiprocessing.Process(target=node_starter,
                                    args=(ob_ctxs,))
        p.start()