public DiscoveryPeer createDiscoveryPeer(final NodeKey nodeKey) {
    final Bytes peerId = nodeKey.getPublicKey().getEncodedBytes();
    final int port = nextAvailablePort.incrementAndGet();
    final DiscoveryPeer discoveryPeer =
        DiscoveryPeer.fromEnode(
            EnodeURLImpl.builder()
                .nodeId(peerId)
                .ipAddress(LOOPBACK_IP_ADDR)
                .discoveryAndListeningPorts(port)
                .build());
    discoveryPeer.setNodeRecord(
        NodeRecord.fromValues(IdentitySchemaInterpreter.V4, UInt64.ONE, Collections.emptyList()));

    return discoveryPeer;
  }
Starts multiple discovery agents from generated peers.

@param count the number of agents to start
@return a list of discovery agents.
ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/discovery/PeerDiscoveryTestHelper.java