<commit_before>/*
 * This file is part of Bisq.
 *
 * Bisq is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at
 * your option) any later version.
 *
 * Bisq is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Bisq. If not, see <http://www.gnu.org/licenses/>.
 */

package bisq.daemon.grpc;

import bisq.core.api.CoreApi;
import bisq.core.trade.statistics.TradeStatistics2;

import bisq.common.config.Config;

import bisq.proto.grpc.GetTradeStatisticsGrpc;
import bisq.proto.grpc.GetTradeStatisticsReply;
import bisq.proto.grpc.GetTradeStatisticsRequest;
import bisq.proto.grpc.GetVersionGrpc;
import bisq.proto.grpc.GetVersionReply;
import bisq.proto.grpc.GetVersionRequest;

import io.grpc.Server;
import io.grpc.ServerBuilder;
import io.grpc.stub.StreamObserver;

import javax.inject.Inject;

import java.io.IOException;
import java.io.UncheckedIOException;

import java.util.stream.Collectors;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class GrpcServer {

    private final CoreApi coreApi;
    private final Server server;

    @Inject
    public GrpcServer(Config config,
                      CoreApi coreApi,
                      GrpcOffersService offersService,
                      GrpcPaymentAccountsService paymentAccountsService,
                      GrpcWalletsService walletsService) {
        this.coreApi = coreApi;
        this.server = ServerBuilder.forPort(config.apiPort)
                .addService(new GetVersionService())
                .addService(new GetTradeStatisticsService())
                .addService(offersService)
                .addService(paymentAccountsService)
                .addService(walletsService)
                .intercept(new PasswordAuthInterceptor(config.apiPassword))
                .build();
    }
<commit_msg>Add GrpcDisputeAgentsService to GrpcServer<commit_after>/*
 * This file is part of Bisq.
 *
 * Bisq is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at
 * your option) any later version.
 *
 * Bisq is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Bisq. If not, see <http://www.gnu.org/licenses/>.
 */

package bisq.daemon.grpc;

import bisq.core.api.CoreApi;
import bisq.core.trade.statistics.TradeStatistics2;

import bisq.common.config.Config;

import bisq.proto.grpc.GetTradeStatisticsGrpc;
import bisq.proto.grpc.GetTradeStatisticsReply;
import bisq.proto.grpc.GetTradeStatisticsRequest;
import bisq.proto.grpc.GetVersionGrpc;
import bisq.proto.grpc.GetVersionReply;
import bisq.proto.grpc.GetVersionRequest;

import io.grpc.Server;
import io.grpc.ServerBuilder;
import io.grpc.stub.StreamObserver;

import javax.inject.Inject;

import java.io.IOException;
import java.io.UncheckedIOException;

import java.util.stream.Collectors;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class GrpcServer {

    private final CoreApi coreApi;
    private final Server server;

    @Inject
    public GrpcServer(Config config,
                      CoreApi coreApi,
                      GrpcDisputeAgentsService disputeAgentsService,
                      GrpcOffersService offersService,
                      GrpcPaymentAccountsService paymentAccountsService,
                      GrpcWalletsService walletsService) {
        this.coreApi = coreApi;
        this.server = ServerBuilder.forPort(config.apiPort)
                .addService(disputeAgentsService)
                .addService(new GetVersionService())
                .addService(new GetTradeStatisticsService())
                .addService(offersService)
                .addService(paymentAccountsService)
                .addService(walletsService)
                .intercept(new PasswordAuthInterceptor(config.apiPassword))
                .build();
    }

{'fraction_non_alphanumeric': 0.07227332457293036, 'fraction_numerical': 0.002190100744634253, 'mean_word_length': 3.0631672597864767, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3627593', 'n_tokens_mistral': 1272, 'n_tokens_neox': 1259, 'n_words': 366}