private void startListeningEthstatsServer() {

    webSocket.textMessageHandler(
        message -> {
          try {
            if (PrimusHeartBeatsHelper.isHeartBeatsRequest(message)) {
              PrimusHeartBeatsHelper.sendHeartBeatsResponse(webSocket);
            } else {
              final JsonNode jsonNode = MAPPER.readTree(message);
              final JsonNode parameters = jsonNode.get(EMIT_FIELD);
              if (parameters.isArray()) {
                final EthStatsRequest.Type type =
                    EthStatsRequest.Type.fromValue(parameters.get(0).asText());
                if (type.equals(NODE_PONG)) {
                  sendLatencyReport();

                } else if (type.equals(HISTORY)) {
                  List<Long> list =
                      stream(parameters.get(1).withArray("list").elements())
                          .map(JsonNode::asLong)
                          .collect(Collectors.toList());
                  //  if the server does not send a list, we recover the last 50 blocks
                  if (list.isEmpty()) {
                    final long chainHeadBlockNumber =
                        blockchainQueries.getBlockchain().getChainHeadBlockNumber();
                    final long startHistoryBlockNumber =
                        Math.max(0, chainHeadBlockNumber - HISTORY_RANGE);
                    list =
                        LongStream.range(chainHeadBlockNumber, startHistoryBlockNumber)
                            .boxed()
                            .collect(Collectors.toList());
                  }
                  sendHistoryReport(list);
                }
              }
            }
          } catch (Exception e) {
            LOG.debug("Ignore invalid request {}", message);
          }
        });
  }
Sends information about the node (is mining, is syncing, etc.)
ethereum/ethstats/src/main/java/org/hyperledger/besu/ethstats/EthStatsService.java