-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpiderWeb.py
40 lines (32 loc) · 1.01 KB
/
SpiderWeb.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python2
import sys, os, tempfile, random, uuid, pickle, time
# ------------------------------------------
# first things first - import fcp module
#Maybe randomize used nodes? Possibly increased perf...
import fcp
fcpHost = "127.0.0.1"
fcpPort = "9485"
# ------------------------------------------
# create a node connection object
#
# we're setting a relatively high verbosity so you
# can see the traffic
#node = fcp.FCPNode(host=fcpHost, port = fcpPort, verbosity=fcp.DETAIL)
uriTable = pickle.load(open("./URI_table.txt","rb"))
nodes = []
numberOfNodes = 2+50 #+5+10
for i in range((numberOfNodes)):
fcpPort = 9481 + i
node = fcp.FCPNode(host=fcpHost, port = fcpPort, verbosity=fcp.FATAL)
nodes.append(node.listpeers())
i = 0
for item in nodes:
print ("Port =" + str(9481 + i))
# print(node.listpeers())
# time.sleep(8)
i += 1
for elem in item:
print (elem)
print ("\n \n")
print(len(item))
print ("\n next \n")