rippled
Loading...
Searching...
No Matches
Wallet.h
1#ifndef XRPL_APP_RDB_WALLET_H_INCLUDED
2#define XRPL_APP_RDB_WALLET_H_INCLUDED
3
4#include <xrpld/app/misc/Manifest.h>
5#include <xrpld/core/Config.h>
6#include <xrpld/core/DatabaseCon.h>
7#include <xrpld/overlay/PeerReservationTable.h>
8
9namespace ripple {
10
18makeWalletDB(DatabaseCon::Setup const& setup, beast::Journal j);
19
29 DatabaseCon::Setup const& setup,
30 std::string const& dbname,
32
42void
44 soci::session& session,
45 std::string const& dbTable,
46 ManifestCache& mCache,
48
57void
59 soci::session& session,
60 std::string const& dbTable,
61 std::function<bool(PublicKey const&)> const& isTrusted,
62 hash_map<PublicKey, Manifest> const& map,
64
71void
72addValidatorManifest(soci::session& session, std::string const& serialized);
73
75void
76clearNodeIdentity(soci::session& session);
77
89getNodeIdentity(soci::session& session);
90
98getPeerReservationTable(soci::session& session, beast::Journal j);
99
106void
108 soci::session& session,
109 PublicKey const& nodeId,
110 std::string const& description);
111
118void
119deletePeerReservation(soci::session& session, PublicKey const& nodeId);
120
126bool
127createFeatureVotes(soci::session& session);
128
129// For historical reasons the up-vote and down-vote integer representations
130// are unintuitive.
131enum class AmendmentVote : int { obsolete = -1, up = 0, down = 1 };
132
139void
141 soci::session& session,
142 std::function<void(
143 boost::optional<std::string> amendment_hash,
144 boost::optional<std::string> amendment_name,
145 boost::optional<AmendmentVote> vote)> const& callback);
146
154void
156 soci::session& session,
157 uint256 const& amendment,
158 std::string const& name,
159 AmendmentVote vote);
160
161} // namespace ripple
162
163#endif
A generic endpoint for log messages.
Definition Journal.h:41
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
AmendmentVote
Definition Wallet.h:131
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.
Definition Wallet.cpp:75
base_uint< 256 > uint256
Definition base_uint.h:539
std::unordered_set< PeerReservation, beast::uhash<>, KeyEqual > getPeerReservationTable(soci::session &session, beast::Journal j)
getPeerReservationTable Returns the peer reservation table.
Definition Wallet.cpp:151
void insertPeerReservation(soci::session &session, PublicKey const &nodeId, std::string const &description)
insertPeerReservation Adds an entry to the peer reservation table.
Definition Wallet.cpp:188
void addValidatorManifest(soci::session &session, std::string const &serialized)
addValidatorManifest Saves the manifest of a validator to the database.
Definition Wallet.cpp:100
std::pair< PublicKey, SecretKey > getNodeIdentity(Application &app, boost::program_options::variables_map const &cmdline)
The cryptographic credentials identifying this server instance.
bool createFeatureVotes(soci::session &session)
createFeatureVotes Creates the FeatureVote table if it does not exist.
Definition Wallet.cpp:210
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.
Definition Wallet.cpp:16
void readAmendments(soci::session &session, std::function< void(boost::optional< std::string > amendment_hash, boost::optional< std::string > amendment_name, boost::optional< AmendmentVote > vote)> const &callback)
readAmendments Reads all amendments from the FeatureVotes table.
Definition Wallet.cpp:234
void clearNodeIdentity(soci::session &session)
Delete any saved public/private key associated with this node.
Definition Wallet.cpp:108
std::unique_ptr< DatabaseCon > makeWalletDB(DatabaseCon::Setup const &setup, beast::Journal j)
makeWalletDB Opens the wallet database and returns it.
Definition Wallet.cpp:8
void getManifests(soci::session &session, std::string const &dbTable, ManifestCache &mCache, beast::Journal j)
getManifests Loads a manifest from the wallet database and stores it in the cache.
Definition Wallet.cpp:27
void deletePeerReservation(soci::session &session, PublicKey const &nodeId)
deletePeerReservation Deletes an entry from the peer reservation table.
Definition Wallet.cpp:202
void voteAmendment(soci::session &session, uint256 const &amendment, std::string const &name, AmendmentVote vote)
voteAmendment Set the veto value for a particular amendment.
Definition Wallet.cpp:270