3#include <xrpl/basics/UnorderedContainers.h>
4#include <xrpl/basics/base_uint.h>
5#include <xrpl/beast/hash/uhash.h>
6#include <xrpl/beast/utility/Journal.h>
7#include <xrpl/core/PeerReservationTable.h>
8#include <xrpl/protocol/PublicKey.h>
9#include <xrpl/protocol/SecretKey.h>
10#include <xrpl/rdb/DatabaseCon.h>
11#include <xrpl/server/Manifest.h>
15#include <boost/optional/optional.hpp>
31std::unique_ptr<DatabaseCon>
41std::unique_ptr<DatabaseCon>
55 soci::session& session,
56 std::string
const& dbTable,
70 soci::session& session,
71 std::string
const& dbTable,
72 std::function<
bool(
PublicKey const&)>
const& isTrusted,
102std::pair<PublicKey, SecretKey>
111std::unordered_set<PeerReservation, beast::Uhash<>,
KeyEqual>
122 soci::session& session,
124 std::string
const& description);
155 soci::session& session,
157 boost::optional<std::string> amendmentHash,
158 boost::optional<std::string> amendmentName,
159 boost::optional<AmendmentVote> vote)>
const& callback);
170 soci::session& session,
Remembers manifests with the highest sequence number.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void saveManifests(soci::session &session, std::string const &dbTable, std::function< bool(PublicKey const &)> const &isTrusted, hash_map< PublicKey, Manifest > const &map, beast::Journal j)
saveManifests Saves all given manifests to the database.
void deletePeerReservation(soci::session &session, PublicKey const &nodeId)
deletePeerReservation Deletes an entry from the peer reservation table.
std::pair< PublicKey, SecretKey > getNodeIdentity(soci::session &session)
Returns a stable public and private key for this node.
void insertPeerReservation(soci::session &session, PublicKey const &nodeId, std::string const &description)
insertPeerReservation Adds an entry to the peer reservation table.
void readAmendments(soci::session &session, std::function< void(boost::optional< std::string > amendmentHash, boost::optional< std::string > amendmentName, boost::optional< AmendmentVote > vote)> const &callback)
readAmendments Reads all amendments from the FeatureVotes table.
std::unordered_set< PeerReservation, beast::Uhash<>, KeyEqual > getPeerReservationTable(soci::session &session, beast::Journal j)
getPeerReservationTable Returns the peer reservation table.
void addValidatorManifest(soci::session &session, std::string const &serialized)
addValidatorManifest Saves the manifest of a validator to the database.
std::unique_ptr< DatabaseCon > makeWalletDB(DatabaseCon::Setup const &setup, beast::Journal j)
makeWalletDB Opens the wallet database and returns it.
bool createFeatureVotes(soci::session &session)
createFeatureVotes Creates the FeatureVote table if it does not exist.
std::unordered_map< Key, Value, Hash, Pred, Allocator > hash_map
void clearNodeIdentity(soci::session &session)
Delete any saved public/private key associated with this node.
void getManifests(soci::session &session, std::string const &dbTable, ManifestCache &cache, beast::Journal j)
getManifests Loads a manifest from the wallet database and stores it in the cache.
std::unique_ptr< DatabaseCon > makeTestWalletDB(DatabaseCon::Setup const &setup, std::string const &dbname, beast::Journal j)
makeTestWalletDB Opens a test wallet database with an arbitrary name.
void voteAmendment(soci::session &session, uint256 const &amendment, std::string const &name, AmendmentVote vote)
voteAmendment Set the veto value for a particular amendment.