public static Optional<DiscoveryPeer> from(final Peer peer) {
    if (peer instanceof DiscoveryPeer) {
      return Optional.of((DiscoveryPeer) peer);
    }

    return Optional.of(peer)
        .map(Peer::getEnodeURL)
        .filter(EnodeURL::isRunningDiscovery)
        .map(DiscoveryPeer::fromEnode);
  }
Represents an Ethereum node that we are interacting with through the discovery and wire
protocols.
ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/discovery/DiscoveryPeer.java