rippled
PostgresDatabase.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_APP_RDB_BACKEND_POSTGRESDATABASE_H_INCLUDED
21 #define RIPPLE_APP_RDB_BACKEND_POSTGRESDATABASE_H_INCLUDED
22 
23 #include <ripple/app/rdb/RelationalDatabase.h>
24 
25 namespace ripple {
26 
28 {
29 public:
30  virtual void
31  stop() = 0;
32 
36  virtual void
37  sweep() = 0;
38 
44  virtual std::string
45  getCompleteLedgers() = 0;
46 
52  virtual std::chrono::seconds
54 
62  virtual bool
64  LedgerInfo const& info,
65  std::vector<AccountTransactionsData> const& accountTxData) = 0;
66 
73  virtual std::vector<uint256>
74  getTxHashes(LedgerIndex seq) = 0;
75 
84  getAccountTx(AccountTxArgs const& args) = 0;
85 
95  virtual Transaction::Locator
96  locateTransaction(uint256 const& id) = 0;
97 
107  virtual bool
108  isCaughtUp(std::string& reason) = 0;
109 };
110 
111 } // namespace ripple
112 
113 #endif
ripple::PostgresDatabase::getTxHashes
virtual std::vector< uint256 > getTxHashes(LedgerIndex seq)=0
getTxHashes Returns a vector of the hashes of transactions belonging to the ledger with the provided ...
std::string
STL class.
ripple::RelationalDatabase::AccountTxArgs
Definition: RelationalDatabase.h:96
std::pair
ripple::PostgresDatabase::getCompleteLedgers
virtual std::string getCompleteLedgers()=0
getCompleteLedgers Returns a string which contains a list of completed ledgers.
std::vector
STL class.
std::chrono::seconds
ripple::PostgresDatabase::locateTransaction
virtual Transaction::Locator locateTransaction(uint256 const &id)=0
locateTransaction Returns information used to locate a transaction.
ripple::PostgresDatabase::stop
virtual void stop()=0
ripple::PostgresDatabase::getAccountTx
virtual std::pair< AccountTxResult, RPC::Status > getAccountTx(AccountTxArgs const &args)=0
getAccountTx Get the last account transactions specified by the AccountTxArgs struct.
ripple::PostgresDatabase::getValidatedLedgerAge
virtual std::chrono::seconds getValidatedLedgerAge()=0
getValidatedLedgerAge Returns the age of the last validated ledger.
ripple::base_uint< 256 >
ripple::Transaction::Locator
Definition: Transaction.h:315
ripple::PostgresDatabase::sweep
virtual void sweep()=0
sweep Sweeps 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::PostgresDatabase::writeLedgerAndTransactions
virtual bool writeLedgerAndTransactions(LedgerInfo const &info, std::vector< AccountTransactionsData > const &accountTxData)=0
writeLedgerAndTransactions Writes new ledger and transaction data into the database.
ripple::PostgresDatabase::isCaughtUp
virtual bool isCaughtUp(std::string &reason)=0
isCaughtUp returns whether the database is caught up with the network
ripple::PostgresDatabase
Definition: PostgresDatabase.h:27
ripple::LedgerInfo
Information about the notional ledger backing the view.
Definition: ReadView.h:75
ripple::RelationalDatabase
Definition: RelationalDatabase.h:48