forked from OpenBazaar/OpenBazaar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.py
executable file
·48 lines (37 loc) · 1.27 KB
/
constants.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
41
42
43
44
45
46
47
48
# ######## KADEMLIA CONSTANTS ###########
# Small number representing the degree of
# parallelism in network calls
alpha = 3
# Maximum number of contacts stored in a bucket
# NOTE: Should be an even number
k = 80
# Timeout for network operations
# [seconds]
rpcTimeout = 0.1
# Delay between iterations of iterative node lookups
# (for loose parallelism)
# [seconds]
iterativeLookupDelay = rpcTimeout / 2
# If a k-bucket has not been used for this amount of time, refresh it.
# [seconds]
refreshTimeout = 60 * 60 * 1000 # 1 hour
# The interval at which nodes replicate (republish/refresh)
# the data they hold
# [seconds]
replicateInterval = refreshTimeout
# The time it takes for data to expire in the network;
# the original publisher of the data will also republish
# the data at this time if it is still valid
# [seconds]
dataExpireTimeout = 86400 # 24 hours
# ####### IMPLEMENTATION-SPECIFIC CONSTANTS ###########
# The interval in which the node should check whether any buckets
# need refreshing or whether any data needs to be republished
# [seconds]
checkRefreshInterval = refreshTimeout / 5
# Max size of a single UDP datagram.
# Any larger message will be spread accross several UDP packets.
# [bytes]
udpDatagramMaxSize = 8192 # 8 KB
DB_PATH = "db/ob.db"
VERSION = "0.2.3"