示例#1
0
def create_nodes(context, num_nodes):
    app = []
    for i in range(num_nodes):
        app.append(MarketApplication(ip_address(i), 12345, i, db_path=get_db_path(i), dev_mode=True))
        app[i].listen(node_to_ws_port(i))
        set_store_description(i)
    context.app = app
def create_layers(context, num_layers):
    layers = []
    for i in range(num_layers):
         db_path = get_db_path(i)
        setup_db(db_path)
        # dev_mode is True because otherwise the layer's ip is set to the
        # public ip of the node
        layers.append(CryptoTransportLayer(ip_address(i), port, i,
        Obdb(db_path), dev_mode=True))
def create_layers(context, num_layers):
    layers = []
    for i in range(num_layers):
        db_path = get_db_path(i)
        setup_db(db_path)
        # dev_mode is True because otherwise the layer's ip is set to the
        # public ip of the node
        layers.append(CryptoTransportLayer(ip_address(i), port, i,
                                           Obdb(db_path), dev_mode=True))
    context.layers = layers
示例#4
0
def create_nodes(context, num_nodes):
    app = []
    for i in range(num_nodes):
        app.append(
            MarketApplication(ip_address(i),
                              12345,
                              i,
                              db_path=get_db_path(i),
                              dev_mode=True))
        app[i].listen(node_to_ws_port(i))
        set_store_description(i)
    context.app = app