hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
wsv_query.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_WSV_QUERY_HPP
7 #define IROHA_WSV_QUERY_HPP
8 
9 #include <boost/optional.hpp>
10 #include <vector>
11 
12 #include "common/result.hpp"
15 
16 namespace iroha {
17  struct TopBlockInfo;
18 
19  namespace ametsuchi {
23  class WsvQuery {
24  public:
25  virtual ~WsvQuery() = default;
26 
32  virtual boost::optional<std::vector<std::string>> getSignatories(
33  const shared_model::interface::types::AccountIdType &account_id) = 0;
34 
39  virtual boost::optional<
40  std::vector<std::shared_ptr<shared_model::interface::Peer>>>
41  getPeers() = 0;
42 
43  // ToDo?(kuvaldini,iceseer) #997
44  // /**
45  // * @brief Fetch domains stored in ledger
46  // * @return list of domains in insertion to ledger order
47  // */
48  // virtual iroha::expected::Result<
49  // std::vector<std::shared_ptr<shared_model::interface::Domain>>,
50  // std::string>
51  // getDomains() = 0;
52 
58 
64 
70  countTransactions() = 0;
71 
76  virtual boost::optional<std::shared_ptr<shared_model::interface::Peer>>
77  getPeerByPublicKey(shared_model::interface::types::PublicKeyHexStringView
78  public_key) = 0;
79 
82  getTopBlockInfo() const = 0;
83  };
84 
85  } // namespace ametsuchi
86 } // namespace iroha
87 
88 #endif // IROHA_WSV_QUERY_HPP
virtual boost::optional< std::shared_ptr< shared_model::interface::Peer > > getPeerByPublicKey(shared_model::interface::types::PublicKeyHexStringView public_key)=0
Definition: block_query.hpp:17
Definition: result_fwd.hpp:27
virtual ~WsvQuery()=default
virtual iroha::expected::Result< size_t, std::string > countTransactions()=0
Fetch number of valid transactions in ledger.
Definition: block_query.hpp:15
std::string AccountIdType
Type of account id.
Definition: types.hpp:38
virtual boost::optional< std::vector< std::string > > getSignatories(const shared_model::interface::types::AccountIdType &account_id)=0
Definition: wsv_query.hpp:23
virtual iroha::expected::Result< iroha::TopBlockInfo, std::string > getTopBlockInfo() const =0
Get top block info from ledger state.
virtual boost::optional< std::vector< std::shared_ptr< shared_model::interface::Peer > > > getPeers()=0
virtual iroha::expected::Result< size_t, std::string > countPeers()=0
Fetch domains stored in ledger.
virtual iroha::expected::Result< size_t, std::string > countDomains()=0
Fetch number of domains in ledger.