rippled
Loading...
Searching...
No Matches
Wallet.h
1#pragma once
2
3#include <xrpl/core/PeerReservationTable.h>
4#include <xrpl/rdb/DatabaseCon.h>
5#include <xrpl/server/Manifest.h>
6
7namespace xrpl {
8
16makeWalletDB(DatabaseCon::Setup const& setup, beast::Journal j);
17
26makeTestWalletDB(DatabaseCon::Setup const& setup, std::string const& dbname, beast::Journal j);
27
37void
39 soci::session& session,
40 std::string const& dbTable,
41 ManifestCache& mCache,
43
52void
54 soci::session& session,
55 std::string const& dbTable,
56 std::function<bool(PublicKey const&)> const& isTrusted,
57 hash_map<PublicKey, Manifest> const& map,
59
66void
67addValidatorManifest(soci::session& session, std::string const& serialized);
68
70void
71clearNodeIdentity(soci::session& session);
72
84getNodeIdentity(soci::session& session);
85
93getPeerReservationTable(soci::session& session, beast::Journal j);
94
101void
103 soci::session& session,
104 PublicKey const& nodeId,
105 std::string const& description);
106
113void
114deletePeerReservation(soci::session& session, PublicKey const& nodeId);
115
121bool
122createFeatureVotes(soci::session& session);
123
124// For historical reasons the up-vote and down-vote integer representations
125// are unintuitive.
126enum class AmendmentVote : int { obsolete = -1, up = 0, down = 1 };
127
134void
136 soci::session& session,
137 std::function<void(
138 boost::optional<std::string> amendment_hash,
139 boost::optional<std::string> amendment_name,
140 boost::optional<AmendmentVote> vote)> const& callback);
141
149void
151 soci::session& session,
152 uint256 const& amendment,
153 std::string const& name,
154 AmendmentVote vote);
155
156} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:40
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
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:25
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:69
void deletePeerReservation(soci::session &session, PublicKey const &nodeId)
deletePeerReservation Deletes an entry from the peer reservation table.
Definition Wallet.cpp:192
std::pair< PublicKey, SecretKey > getNodeIdentity(soci::session &session)
Returns a stable public and private key for this node.
Definition Wallet.cpp:108
void insertPeerReservation(soci::session &session, PublicKey const &nodeId, std::string const &description)
insertPeerReservation Adds an entry to the peer reservation table.
Definition Wallet.cpp:178
std::unordered_set< PeerReservation, beast::uhash<>, KeyEqual > getPeerReservationTable(soci::session &session, beast::Journal j)
getPeerReservationTable Returns the peer reservation table.
Definition Wallet.cpp:143
void addValidatorManifest(soci::session &session, std::string const &serialized)
addValidatorManifest Saves the manifest of a validator to the database.
Definition Wallet.cpp:94
base_uint< 256 > uint256
Definition base_uint.h:531
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:223
std::unique_ptr< DatabaseCon > makeWalletDB(DatabaseCon::Setup const &setup, beast::Journal j)
makeWalletDB Opens the wallet database and returns it.
Definition Wallet.cpp:9
bool createFeatureVotes(soci::session &session)
createFeatureVotes Creates the FeatureVote table if it does not exist.
Definition Wallet.cpp:199
AmendmentVote
Definition Wallet.h:126
void clearNodeIdentity(soci::session &session)
Delete any saved public/private key associated with this node.
Definition Wallet.cpp:102
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:17
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:258