Line data Source code
1 : /**
2 : * Copyright Soramitsu Co., Ltd. All Rights Reserved.
3 : * SPDX-License-Identifier: Apache-2.0
4 : */
5 :
6 : #ifndef IROHA_GOSSIP_PROPAGATION_STRATEGY_PARAMS_HPP
7 : #define IROHA_GOSSIP_PROPAGATION_STRATEGY_PARAMS_HPP
8 :
9 : #include <chrono>
10 :
11 : #include <boost/optional.hpp>
12 :
13 : // TODO: IR-1317 @l4l (02/05/18) magics should be replaced with options via
14 : // cli parameters
15 : static constexpr std::chrono::milliseconds kDefaultPeriod =
16 : std::chrono::seconds(5);
17 : static constexpr uint32_t kDefaultAmount = 2;
18 :
19 : namespace iroha {
20 : /**
21 : * This structure provides configuration parameters for propagation strategy
22 : */
23 : struct GossipPropagationStrategyParams {
24 : /// period of emitting data in ms
25 5 : std::chrono::milliseconds emission_period{kDefaultPeriod};
26 :
27 : /// amount of data (peers) emitted per once
28 5 : uint32_t amount_per_once{kDefaultAmount};
29 : };
30 :
31 : } // namespace iroha
32 :
33 : #endif // IROHA_GOSSIP_PROPAGATION_STRATEGY_PARAMS_HPP
|