DefaultP2PConfig returns a default configuration for the peer-to-peer layer
()
| 598 | |
| 599 | // DefaultP2PConfig returns a default configuration for the peer-to-peer layer |
| 600 | func 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 |
| 626 | func TestP2PConfig() *P2PConfig { |