def step_impl(context, i, j):
    i = int(i)
    j = int(j)
    iLayer = context.layers[i]
    jLayer = context.layers[j]

    assert (ip_address(j), port, jLayer.guid, nickname(j)) in iLayer.dht.knownNodes
def step_impl(context, i, j):
    i = int(i)
    j = int(j)
    iLayer = context.layers[i]
    jLayer = context.layers[j]

    assert (ip_address(j), port, jLayer.guid, nickname(j)) in iLayer.dht.knownNodes
Esempio n. 3
0
def step_impl(context, i, j):
    i = int(i)
    j = int(j)
    i_layer = context.layers[i]
    j_layer = context.layers[j]

    known_node = (ip_address(j), PORT, j_layer.guid, nickname(j))
    assert known_node in i_layer.dht.knownNodes
def step_impl(context, i, j):
    i = int(i)
    j = int(j)
    iLayer = context.layers[i]
    jLayer = context.layers[j]

    jLayer.join_network([])

    def cb(msg):
        ioloop.IOLoop.current().stop()

    iLayer.join_network([ip_address(j)], callback=cb)
    ioloop.IOLoop.current().start()
Esempio n. 5
0
def step_impl(context, i, j):
    i = int(i)
    j = int(j)
    i_layer = context.layers[i]
    j_layer = context.layers[j]

    j_layer.join_network([])

    def callback(msg):
        ioloop.IOLoop.current().stop()

    i_layer.join_network([ip_address(j)], callback=callback)
    ioloop.IOLoop.current().start()
def create_layers(context, num_layers):
    layers = []

    for i in range(num_layers):
        # dev_mode is True because otherwise the layer's ip is set to the
        # public ip of the node
        ob_ctx = OpenBazaarContext.create_default_instance()
        ob_ctx.dev_mode = True
        ob_ctx.server_ip = ip_address(i)
        ob_ctx.server_port = port
        db_path = get_db_path(i)
        setup_db(db_path, ob_ctx.disable_sqlite_crypt)
        layers.append(CryptoTransportLayer(ob_ctx, Obdb(db_path)))
    context.layers = layers
Esempio n. 7
0
def create_layers(context, num_layers):
    layers = []

    for i in range(num_layers):
        # dev_mode is True because otherwise the layer's ip is set to the
        # public ip of the node
        ob_ctx = OpenBazaarContext.create_default_instance()
        ob_ctx.dev_mode = True
        ob_ctx.server_ip = ip_address(i)
        ob_ctx.server_port = PORT
        db_path = get_db_path(i)
        setup_db(db_path, ob_ctx.disable_sqlite_crypt)
        layers.append(CryptoTransportLayer(ob_ctx, Obdb(db_path)))
    context.layers = layers