OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
cbdc::sentinel::controller Class Reference

Sentinel implementation. More...

#include <controller.hpp>

Inheritance diagram for cbdc::sentinel::controller:
Collaboration diagram for cbdc::sentinel::controller:

Public Member Functions

 controller ()=delete
 
 controller (const controller &)=delete
 
auto operator= (const controller &) -> controller &=delete
 
 controller (controller &&)=delete
 
auto operator= (controller &&) -> controller &=delete
 
 controller (uint32_t sentinel_id, config::options opts, std::shared_ptr< logging::log > logger)
 Constructor.
 
 ~controller () override=default
 
auto init () -> bool
 Initializes the controller.
 
auto execute_transaction (transaction::full_tx tx) -> std::optional< cbdc::sentinel::execute_response > override
 Validate transaction, forward it to shards for processing, and return the validation result to send back to the originating client.
 
auto validate_transaction (transaction::full_tx tx) -> std::optional< validate_response > override
 Validate transaction and generate a sentinel attestation if the transaction is valid.
 
- Public Member Functions inherited from cbdc::sentinel::interface
virtual ~interface ()=default
 
 interface ()=default
 
 interface (const interface &)=delete
 
auto operator= (const interface &) -> interface &=delete
 
 interface (interface &&)=delete
 
auto operator= (interface &&) -> interface &=delete
 

Detailed Description

Sentinel implementation.

Definition at line 21 of file uhs/atomizer/sentinel/controller.hpp.

Constructor & Destructor Documentation

◆ controller() [1/4]

cbdc::sentinel::controller::controller ( )
delete

◆ controller() [2/4]

cbdc::sentinel::controller::controller ( const controller & )
delete

◆ controller() [3/4]

cbdc::sentinel::controller::controller ( controller && )
delete

◆ controller() [4/4]

cbdc::sentinel::controller::controller ( uint32_t sentinel_id,
config::options opts,
std::shared_ptr< logging::log > logger )

Constructor.

Parameters
sentinel_idthe running ID of this shard.
optspointer to configuration options.
loggerpointer shared logger.

Definition at line 15 of file uhs/atomizer/sentinel/controller.cpp.

◆ ~controller()

cbdc::sentinel::controller::~controller ( )
overridedefault

Member Function Documentation

◆ execute_transaction()

auto cbdc::sentinel::controller::execute_transaction ( transaction::full_tx tx) -> std::optional<cbdc::sentinel::execute_response>
overridevirtual

Validate transaction, forward it to shards for processing, and return the validation result to send back to the originating client.

Parameters
txtransaction to execute.
Returns
response with the transaction status to send to the client.

Implements cbdc::sentinel::interface.

Definition at line 86 of file uhs/atomizer/sentinel/controller.cpp.

References cbdc::transaction::validation::check_tx(), cbdc::sentinel::pending, cbdc::sentinel::static_invalid, cbdc::to_string(), and cbdc::transaction::tx_id().

Here is the call graph for this function:

◆ init()

auto cbdc::sentinel::controller::init ( ) -> bool

Initializes the controller.

Establishes connections to the shards

Returns
true if initialization succeeded.

Definition at line 22 of file uhs/atomizer/sentinel/controller.cpp.

References cbdc::client::init(), cbdc::pubkey_from_privkey(), and cbdc::to_string().

Here is the call graph for this function:

◆ operator=() [1/2]

auto cbdc::sentinel::controller::operator= ( const controller & ) -> controller &=delete
delete

◆ operator=() [2/2]

auto cbdc::sentinel::controller::operator= ( controller && ) -> controller &=delete
delete

◆ validate_transaction()

auto cbdc::sentinel::controller::validate_transaction ( transaction::full_tx tx) -> std::optional<validate_response>
overridevirtual

Validate transaction and generate a sentinel attestation if the transaction is valid.

Parameters
txtransaction to validate and attest to.
Returns
sentinel attestation for the given transaction, or std::nullopt if the transaction is invalid.

Implements cbdc::sentinel::interface.

Definition at line 118 of file uhs/atomizer/sentinel/controller.cpp.

References cbdc::transaction::validation::check_tx().

Here is the call graph for this function:

The documentation for this class was generated from the following files: