match = re.match(r"^fullreset-all$", do) if match: thisPeer.fullResetAll() continue match = re.match(r"kfind-test\s*(\S*)\s*(\S*)", do) if match: if len(match.group(1)) > 0: k = int(match.group(1)) else: k = 8 if len(match.group(2)) > 0: TTL = int(match.group(2)) else: TTL = 24 thisPeer.testHitRate( k, TTL, len(thisPeer.listPeers())) continue match = re.match(r"^kfind-multitest$", do) if match: print('Random kWalker hitrate test for '+str(len(thisPeer.listPeers()))+' peers') ks = [pow(2,k) for k in range(6)] TTLs = [pow(2,TTL) for TTL in range(8)] for k in ks: for TTL in TTLs: print('k = '+str(k)+' | TTL = '+str(TTL)) thisPeer.testHitRate(k, TTL, len(thisPeer.listPeers())) print('DONE!') continue match = re.match(r"bigtest", do)