|
@@ -1,5 +1,8 @@
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
+import random # For simulation, not cryptography!
|
|
|
+import math
|
|
|
+
|
|
|
import nacl.utils
|
|
|
import nacl.signing
|
|
|
import nacl.public
|
|
@@ -66,7 +69,13 @@ if __name__ == '__main__':
|
|
|
# Start some relays
|
|
|
numrelays = 10
|
|
|
for i in range(numrelays):
|
|
|
- Relay(dirauthaddrs, 500, 0)
|
|
|
+ # Relay bandwidths (at least the ones fast enough to get used)
|
|
|
+ # in the live Tor network (as of Dec 2019) are well approximated
|
|
|
+ # by (200000-(200000-25000)/3*log10(x)) where x is a
|
|
|
+ # uniform integer in [1,2500]
|
|
|
+ x = random.randint(1,2500)
|
|
|
+ bw = int(200000-(200000-25000)/3*math.log10(x))
|
|
|
+ Relay(dirauthaddrs, bw, 0)
|
|
|
|
|
|
# Tick the epoch
|
|
|
network.thenetwork.nextepoch()
|