rippled
RelationalDBInterfacePostgres.h
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2020 Ripple Labs Inc.
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 //==============================================================================
19 
20 #ifndef RIPPLE_CORE_RELATIONALDBINTERFACEPOSTGRES_H_INCLUDED
21 #define RIPPLE_CORE_RELATIONALDBINTERFACEPOSTGRES_H_INCLUDED
22 
23 #include <ripple/app/rdb/RelationalDBInterface.h>
24 
25 namespace ripple {
26 
28 {
29 public:
38  virtual void
39  stop() = 0;
40 
44  virtual void
45  sweep() = 0;
46 
52  virtual std::string
53  getCompleteLedgers() = 0;
54 
60  virtual std::chrono::seconds
62 
70  virtual bool
72  LedgerInfo const& info,
73  std::vector<AccountTransactionsData> const& accountTxData) = 0;
74 
81  virtual std::vector<uint256>
82  getTxHashes(LedgerIndex seq) = 0;
83 
94  getAccountTx(AccountTxArgs const& args) = 0;
95 
105  virtual Transaction::Locator
106  locateTransaction(uint256 const& id) = 0;
107 
117  virtual bool
118  isCaughtUp(std::string& reason) = 0;
119 };
120 
121 } // namespace ripple
122 
123 #endif
ripple::RelationalDBInterface::AccountTxArgs
Definition: RelationalDBInterface.h:96
std::string
STL class.
ripple::RelationalDBInterfacePostgres::getValidatedLedgerAge
virtual std::chrono::seconds getValidatedLedgerAge()=0
getValidatedLedgerAge Returns age of last validated ledger.
std::pair
std::vector
STL class.
std::chrono::seconds
ripple::RelationalDBInterfacePostgres::stop
virtual void stop()=0
There is only one implementation of this interface: RelationalDBInterfacePostgresImp.
ripple::RelationalDBInterface
Definition: RelationalDBInterface.h:48
ripple::RelationalDBInterfacePostgres
Definition: RelationalDBInterfacePostgres.h:27
ripple::base_uint< 256 >
ripple::RelationalDBInterfacePostgres::getCompleteLedgers
virtual std::string getCompleteLedgers()=0
getCompleteLedgers Returns string which contains list of completed ledgers.
ripple::RelationalDBInterfacePostgres::getAccountTx
virtual std::pair< AccountTxResult, RPC::Status > getAccountTx(AccountTxArgs const &args)=0
getAccountTx Get last account transactions specifies by passed argumenrs structure.
ripple::Transaction::Locator
Definition: Transaction.h:315
ripple::RelationalDBInterfacePostgres::sweep
virtual void sweep()=0
sweep Sweep the database.
std::uint32_t
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::RelationalDBInterfacePostgres::isCaughtUp
virtual bool isCaughtUp(std::string &reason)=0
isCaughtUp returns whether the database is caught up with the network
ripple::LedgerInfo
Information about the notional ledger backing the view.
Definition: ReadView.h:84
ripple::RelationalDBInterfacePostgres::getTxHashes
virtual std::vector< uint256 > getTxHashes(LedgerIndex seq)=0
getTxHashes Returns vector of tx hashes by given ledger sequence.
ripple::RelationalDBInterfacePostgres::writeLedgerAndTransactions
virtual bool writeLedgerAndTransactions(LedgerInfo const &info, std::vector< AccountTransactionsData > const &accountTxData)=0
writeLedgerAndTransactions Write new ledger and transaction data into database.
ripple::RelationalDBInterfacePostgres::locateTransaction
virtual Transaction::Locator locateTransaction(uint256 const &id)=0
locateTransaction Returns information used to locate a transaction.