xrpld
Loading...
Searching...
No Matches
xrpl::test::TrustedPublisherServer Class Reference

#include <TrustedPublisherServer.h>

Inheritance diagram for xrpl::test::TrustedPublisherServer:
Collaboration diagram for xrpl::test::TrustedPublisherServer:

Classes

struct  BlobInfo
struct  Validator
struct  Lambda

Public Member Functions

 TrustedPublisherServer (boost::asio::io_context &ioc, std::vector< Validator > const &validators, NetClock::time_point validUntil, std::vector< std::pair< NetClock::time_point, NetClock::time_point > > const &futures, bool useSSL=false, int version=1, bool immediateStart=true, int sequence=1)
void start ()
void stop ()
 ~TrustedPublisherServer ()
endpoint_type localEndpoint () const
PublicKey const & publisherPublic () const
shared_from_this (T... args)
weak_from_this (T... args)

Static Public Member Functions

static std::string makeManifestString (PublicKey const &pk, SecretKey const &sk, PublicKey const &spk, SecretKey const &ssk, int seq)
static Validator randomValidator ()
static std::string const & cert ()
static std::string const & key ()
static std::string const & caCert ()
static std::string const & dh ()

Private Types

using endpoint_type = boost::asio::ip::tcp::endpoint
using address_type = boost::asio::ip::address
using socket_type = boost::asio::ip::tcp::socket
using req_type = boost::beast::http::request<boost::beast::http::string_body>
using resp_type = boost::beast::http::response<boost::beast::http::string_body>
using error_code = boost::system::error_code

Private Member Functions

void loadServerCertificate ()
void onAccept (error_code ec)
void doPeer (int id, socket_type &&s, bool ssl)

Private Attributes

socket_type sock_
endpoint_type ep_
boost::asio::ip::tcp::acceptor acceptor_
std::function< std::string(int)> getList_
std::function< std::string(int)> getList2_
bool useSSL_
boost::asio::ssl::context sslCtx_ {boost::asio::ssl::context::tlsv12}
SecretKey publisherSecret_
PublicKey publisherPublic_

Detailed Description

Definition at line 28 of file TrustedPublisherServer.h.

Member Typedef Documentation

◆ endpoint_type

using xrpl::test::TrustedPublisherServer::endpoint_type = boost::asio::ip::tcp::endpoint
private

Definition at line 30 of file TrustedPublisherServer.h.

◆ address_type

using xrpl::test::TrustedPublisherServer::address_type = boost::asio::ip::address
private

Definition at line 31 of file TrustedPublisherServer.h.

◆ socket_type

using xrpl::test::TrustedPublisherServer::socket_type = boost::asio::ip::tcp::socket
private

Definition at line 32 of file TrustedPublisherServer.h.

◆ req_type

using xrpl::test::TrustedPublisherServer::req_type = boost::beast::http::request<boost::beast::http::string_body>
private

Definition at line 34 of file TrustedPublisherServer.h.

◆ resp_type

using xrpl::test::TrustedPublisherServer::resp_type = boost::beast::http::response<boost::beast::http::string_body>
private

Definition at line 35 of file TrustedPublisherServer.h.

◆ error_code

using xrpl::test::TrustedPublisherServer::error_code = boost::system::error_code
private

Definition at line 36 of file TrustedPublisherServer.h.

Constructor & Destructor Documentation

◆ TrustedPublisherServer()

xrpl::test::TrustedPublisherServer::TrustedPublisherServer ( boost::asio::io_context & ioc,
std::vector< Validator > const & validators,
NetClock::time_point validUntil,
std::vector< std::pair< NetClock::time_point, NetClock::time_point > > const & futures,
bool useSSL = false,
int version = 1,
bool immediateStart = true,
int sequence = 1 )

Definition at line 140 of file TrustedPublisherServer.h.

◆ ~TrustedPublisherServer()

xrpl::test::TrustedPublisherServer::~TrustedPublisherServer ( )

Definition at line 260 of file TrustedPublisherServer.h.

Member Function Documentation

◆ loadServerCertificate()

void xrpl::test::TrustedPublisherServer::loadServerCertificate ( )
private

Definition at line 58 of file TrustedPublisherServer.h.

◆ makeManifestString()

std::string xrpl::test::TrustedPublisherServer::makeManifestString ( PublicKey const & pk,
SecretKey const & sk,
PublicKey const & spk,
SecretKey const & ssk,
int seq )
static

Definition at line 97 of file TrustedPublisherServer.h.

◆ randomValidator()

Validator xrpl::test::TrustedPublisherServer::randomValidator ( )
static

Definition at line 122 of file TrustedPublisherServer.h.

◆ start()

void xrpl::test::TrustedPublisherServer::start ( )

Definition at line 235 of file TrustedPublisherServer.h.

◆ stop()

void xrpl::test::TrustedPublisherServer::stop ( )

Definition at line 252 of file TrustedPublisherServer.h.

◆ localEndpoint()

endpoint_type xrpl::test::TrustedPublisherServer::localEndpoint ( ) const

Definition at line 266 of file TrustedPublisherServer.h.

◆ publisherPublic()

PublicKey const & xrpl::test::TrustedPublisherServer::publisherPublic ( ) const

Definition at line 272 of file TrustedPublisherServer.h.

◆ cert()

std::string const & xrpl::test::TrustedPublisherServer::cert ( )
static

Definition at line 340 of file TrustedPublisherServer.h.

◆ key()

std::string const & xrpl::test::TrustedPublisherServer::key ( )
static

Definition at line 347 of file TrustedPublisherServer.h.

◆ caCert()

std::string const & xrpl::test::TrustedPublisherServer::caCert ( )
static

Definition at line 354 of file TrustedPublisherServer.h.

◆ dh()

std::string const & xrpl::test::TrustedPublisherServer::dh ( )
static

Definition at line 361 of file TrustedPublisherServer.h.

◆ onAccept()

void xrpl::test::TrustedPublisherServer::onAccept ( error_code ec)
private

Definition at line 389 of file TrustedPublisherServer.h.

◆ doPeer()

void xrpl::test::TrustedPublisherServer::doPeer ( int id,
socket_type && s,
bool ssl )
private

Definition at line 406 of file TrustedPublisherServer.h.

Member Data Documentation

◆ sock_

socket_type xrpl::test::TrustedPublisherServer::sock_
private

Definition at line 38 of file TrustedPublisherServer.h.

◆ ep_

endpoint_type xrpl::test::TrustedPublisherServer::ep_
private

Definition at line 39 of file TrustedPublisherServer.h.

◆ acceptor_

boost::asio::ip::tcp::acceptor xrpl::test::TrustedPublisherServer::acceptor_
private

Definition at line 40 of file TrustedPublisherServer.h.

◆ getList_

std::function<std::string(int)> xrpl::test::TrustedPublisherServer::getList_
private

Definition at line 43 of file TrustedPublisherServer.h.

◆ getList2_

std::function<std::string(int)> xrpl::test::TrustedPublisherServer::getList2_
private

Definition at line 46 of file TrustedPublisherServer.h.

◆ useSSL_

bool xrpl::test::TrustedPublisherServer::useSSL_
private

Definition at line 49 of file TrustedPublisherServer.h.

◆ sslCtx_

boost::asio::ssl::context xrpl::test::TrustedPublisherServer::sslCtx_ {boost::asio::ssl::context::tlsv12}
private

Definition at line 50 of file TrustedPublisherServer.h.

◆ publisherSecret_

SecretKey xrpl::test::TrustedPublisherServer::publisherSecret_
private

Definition at line 52 of file TrustedPublisherServer.h.

◆ publisherPublic_

PublicKey xrpl::test::TrustedPublisherServer::publisherPublic_
private

Definition at line 53 of file TrustedPublisherServer.h.