20 #include <ripple/app/main/Application.h>
21 #include <ripple/app/main/NodeIdentity.h>
22 #include <ripple/app/rdb/Wallet.h>
23 #include <ripple/core/Config.h>
24 #include <ripple/core/ConfigSections.h>
25 #include <boost/optional.hpp>
32 boost::program_options::variables_map
const& cmdline)
36 if (cmdline.count(
"nodeid"))
41 Throw<std::runtime_error>(
"Invalid 'nodeid' in command line");
45 seed = parseBase58<Seed>(
49 Throw<std::runtime_error>(
"Invalid [" SECTION_NODE_SEED
50 "] in configuration file");
58 return {publicKey, secretKey};
63 if (cmdline.count(
"newnodeid") != 0)
virtual DatabaseCon & getWalletDB()=0
Retrieve the "wallet database".
LockedSociSession checkoutDb()
PublicKey derivePublicKey(KeyType type, SecretKey const &sk)
Derive the public key from a secret key.
virtual Config & config()=0
std::vector< std::string > const & lines() const
Returns all the lines in the section.
SecretKey generateSecretKey(KeyType type, Seed const &seed)
Generate a new secret key deterministically.
std::optional< Seed > parseGenericSeed(std::string const &str, bool rfc1751)
Attempt to parse a string as a seed.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::pair< PublicKey, SecretKey > getNodeIdentity(Application &app, boost::program_options::variables_map const &cmdline)
The cryptographic credentials identifying this server instance.
void clearNodeIdentity(soci::session &session)
Delete any saved public/private key associated with this node.
bool exists(std::string const &name) const
Returns true if a section with the given name exists.
Section & section(std::string const &name)
Returns the section with the given name.