long t2 = System.currentTimeMillis();
System.out.println("SEED-TIME:" + (t2 - t1));
csvLine.add(String.valueOf(t2 - t1));
FreenetURI todaysInsert = null;
// PUSH N+1 BLOCKS
for (int i = 0; i <= MAX_N; i++) {
RandomAccessBucket data = randomData(node);
HighLevelSimpleClient client = node.clientCore.makeClient((short) 0, false, false);
System.out.println("PUSHING " + i);
try {
InsertBlock block = new InsertBlock(data, new ClientMetadata(), FreenetURI.EMPTY_CHK_URI);
t1 = System.currentTimeMillis();
FreenetURI uri = client.insert(block, false, null);
if(i == 0) todaysInsert = uri;
t2 = System.currentTimeMillis();
System.out.println("PUSH-TIME-" + i + ":" + (t2 - t1)+" for "+uri);
csvLine.add(String.valueOf(t2 - t1));
csvLine.add(uri.toASCIIString());
} catch (InsertException e) {
e.printStackTrace();
csvLine.add("N/A");
csvLine.add("N/A");
}
data.free();
}
node.park();
// Node 2
File innerDir2 = new File(dir, Integer.toString(DARKNET_PORT2));
innerDir2.mkdir();
fis = new FileInputStream(seednodes);
FileUtil.writeTo(fis, new File(innerDir2, "seednodes.fref"));
fis.close();
node2 = NodeStarter.createTestNode(DARKNET_PORT2, OPENNET_PORT2, dir.getPath(), false,
Node.DEFAULT_MAX_HTL, 0, random, new PooledExecutor(), 1000, 5 * 1024 * 1024, true, true, true,
true, true, true, true, 12 * 1024, false, true, false, false, null);
node2.start(true);
t1 = System.currentTimeMillis();
if (!TestUtil.waitForNodes(node2)) {
exitCode = EXIT_FAILED_TARGET;
return;
}
t2 = System.currentTimeMillis();
System.out.println("SEED-TIME:" + (t2 - t1));
csvLine.add(String.valueOf(t2 - t1));
// PULL N+1 BLOCKS
for (int i = 0; i <= MAX_N; i++) {
HighLevelSimpleClient client = node2.clientCore.makeClient((short) 0, false, false);
Calendar targetDate = (Calendar) today.clone();
targetDate.add(Calendar.DAY_OF_MONTH, -((1 << i) - 1));
FreenetURI uri = null;
if(i == 0) uri = todaysInsert;
else {
uri = getHistoricURI(uid, i, targetDate);
}