forked from aergoio/aergo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configs.go
73 lines (60 loc) · 1.98 KB
/
configs.go
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* @file
* @copyright defined in aergo/LICENSE.txt
*/
package p2p
import "time"
// constants for inter-communication of aergosvr
const (
// other actor
DefaultActorMsgTTL = time.Second * 4
)
// constants for peer communicating
const (
// peer handshake will be failed when taken more than defaultHandshakeTTL
defaultHandshakeTTL = time.Second * 20
defaultPingInterval = time.Second * 60
// txNoticeInterval is max wait time when not sufficient txs to notify is collected. i.e newTxNotice is sent to peer within this time.
txNoticeInterval = time.Second * 1
// writeMsgBufferSize is queue size of message to a peer. connection will be closed when queue is exceeded.
writeMsgBufferSize = 40
// time to determine which the remote designated peer is not working.
DesignatedNodeTTL = time.Minute * 60
// time to determine which the remote peer is not working.
DefaultNodeTTL = time.Minute * 10
)
// constants for legacy sync algorithm. DEPRECATED newer sync loging in syncer package is used now.
const (
SyncWorkTTL = time.Second * 30
AddBlockCheckpoint = 100
AddBlockWaitTime = time.Second * 10
)
// constants for node discovery
const (
DiscoveryQueryInterval = time.Minute * 5
MaxAddrListSizePolaris = 200
MaxAddrListSizePeer = 50
)
// constants for peer internal operations
const (
cleanRequestInterval = time.Hour
)
// constants for caching
// TODO this value better related to max peer and block produce interval, not constant
const (
DefaultGlobalBlockCacheSize = 300
DefaultPeerBlockCacheSize = 100
DefaultGlobalTxCacheSize = 50000
DefaultPeerTxCacheSize = 10000
// DefaultPeerTxQueueSize is maximum size of hashes in a single tx notice message
DefaultPeerTxQueueSize = 2000
// value to sent to cache, since block and tx cache need only hash itself (stored as key of map)
cachePlaceHolder = true
)
// constants about private key
const (
DefaultPkKeyPrefix = "aergo-peer"
DefaultPkKeyExt = ".key"
DefaultPubKeyExt = ".pub"
DefaultPeerIDExt = ".id"
)