@Override
    protected Message processRequest0(final CliRequestContext ctx, final GetPeersRequest request,
                                      final RpcRequestClosure done) {
        final List<PeerId> peers;
        final List<PeerId> learners;
        if (request.hasOnlyAlive() && request.getOnlyAlive()) {
            peers = ctx.node.listAlivePeers();
            learners = ctx.node.listAliveLearners();
        } else {
            peers = ctx.node.listPeers();
            learners = ctx.node.listLearners();
        }
        final GetPeersResponse.Builder builder = GetPeersResponse.newBuilder();
        for (final PeerId peerId : peers) {
            builder.addPeers(peerId.toString());
        }
        for (final PeerId peerId : learners) {
            builder.addLearners(peerId.toString());
        }
        return builder.build();
    }
Process get all peers of the replication group request.

@author jiachun.fjc
jraft-core/src/main/java/com/alipay/sofa/jraft/rpc/impl/cli/GetPeersRequestProcessor.java