MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / DefaultP2PConfig

Function DefaultP2PConfig

config/config.go:600–623  ·  view source on GitHub ↗

DefaultP2PConfig returns a default configuration for the peer-to-peer layer

()

Source from the content-addressed store, hash-verified

598
599// DefaultP2PConfig returns a default configuration for the peer-to-peer layer
600func DefaultP2PConfig() *P2PConfig {
601 return &P2PConfig{
602 ListenAddress: "tcp://0.0.0.0:26656",
603 ExternalAddress: "",
604 UPNP: false,
605 AddrBook: defaultAddrBookPath,
606 AddrBookStrict: true,
607 MaxNumInboundPeers: 40,
608 MaxNumOutboundPeers: 10,
609 PersistentPeersMaxDialPeriod: 1 * time.Second,
610 FlushThrottleTimeout: 100 * time.Millisecond,
611 MaxPacketMsgPayloadSize: 1024, // 1 kB
612 SendRate: 5120000, // 5 mB/s
613 RecvRate: 5120000, // 5 mB/s
614 PexReactor: true,
615 SeedMode: false,
616 AllowDuplicateIP: false,
617 HandshakeTimeout: 20 * time.Second,
618 DialTimeout: 3 * time.Second,
619 TestDialFail: false,
620 TestFuzz: false,
621 TestFuzzConfig: DefaultFuzzConnConfig(),
622 }
623}
624
625// TestP2PConfig returns a configuration for testing the peer-to-peer layer
626func TestP2PConfig() *P2PConfig {

Callers 6

initFunction · 0.92
initFunction · 0.92
FuzzFunction · 0.92
DefaultConfigFunction · 0.85
TestP2PConfigFunction · 0.85

Calls 1

DefaultFuzzConnConfigFunction · 0.85

Tested by 4

initFunction · 0.74
initFunction · 0.74
TestP2PConfigFunction · 0.68