P2P API

You are here:
< Back

TIP

You can find the source code of this package at packages/core-p2p.

Installation

yarn add @arkecosystem/core-p2p

Configuration

module.exports = {
  host: process.env.CORE_P2P_HOST || '0.0.0.0',
  port: process.env.CORE_P2P_PORT || 4002,
  remoteInterface: false,
  dns: [
    // Google
    '8.8.8.8',
    '8.8.4.4',
    // CloudFlare
    '1.1.1.1',
    '1.0.0.1',
    // OpenDNS
    '208.67.222.222',
    '208.67.220.220',
  ],
  ntp: ['pool.ntp.org', 'time.google.com'],
  whitelist: ['127.0.0.1', '::ffff:127.0.0.1'],
  // @see https://github.com/wraithgar/hapi-rate-limit
  rateLimit: {
    enabled: true,
    pathLimit: false,
    userLimit: 20,
    userCache: {
      expiresIn: 1000,
    },
    ipWhitelist: ['127.0.0.1', '::ffff:127.0.0.1'],
  },
  maxPeersBroadcast: 20,
}

 

Last Updated On January 26, 2019