public RlpxAgent build() {
      validate();

      if (connectionEvents == null) {
        connectionEvents = new PeerConnectionEvents(metricsSystem);
      }
      if (connectionInitializer == null) {
        LOG.debug("Using default NettyConnectionInitializer");
        connectionInitializer =
            new NettyConnectionInitializer(
                nodeKey, config, localNode, connectionEvents, metricsSystem, peerTable);
      }

      final PeerRlpxPermissions rlpxPermissions =
          new PeerRlpxPermissions(localNode, peerPermissions);
      return new RlpxAgent(
          localNode,
          connectionEvents,
          connectionInitializer,
          rlpxPermissions,
          peerPrivileges,
          maxPeers,
          allConnectionsSupplier,
          allActiveConnectionsSupplier);
    }
Connect to the peer

@param peer The peer to connect to
@return A future that will resolve to the existing or newly-established connection with this
    peer.
ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/RlpxAgent.java