Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::trace_api_plugin_impl Struct Reference

Public Types

using chain_extraction_t = chain_extraction_impl_type<shared_store_provider<store_provider>>
 

Public Member Functions

 trace_api_plugin_impl (const std::shared_ptr< trace_api_common_impl > &common)
 
void plugin_initialize (const appbase::variables_map &options)
 
void plugin_startup ()
 
void plugin_shutdown ()
 

Static Public Member Functions

static void set_program_options (appbase::options_description &cli, appbase::options_description &cfg)
 

Public Attributes

std::shared_ptr< trace_api_common_implcommon
 
std::shared_ptr< chain_extraction_textraction
 
std::optional< scoped_connection > applied_transaction_connection
 
std::optional< scoped_connection > block_start_connection
 
std::optional< scoped_connection > accepted_block_connection
 
std::optional< scoped_connection > irreversible_block_connection
 

Detailed Description

Definition at line 358 of file trace_api_plugin.cpp.

Member Typedef Documentation

◆ chain_extraction_t

Constructor & Destructor Documentation

◆ trace_api_plugin_impl()

sysio::trace_api_plugin_impl::trace_api_plugin_impl ( const std::shared_ptr< trace_api_common_impl > & common)
inline

Definition at line 359 of file trace_api_plugin.cpp.

360 :common(common) {}
std::shared_ptr< trace_api_common_impl > common

Member Function Documentation

◆ plugin_initialize()

void sysio::trace_api_plugin_impl::plugin_initialize ( const appbase::variables_map & options)
inline

Definition at line 365 of file trace_api_plugin.cpp.

365 {
366 ilog("initializing trace api plugin");
367 auto log_exceptions_and_shutdown = [](const exception_with_context& e) {
368 log_exception(e, fc::log_level::error);
369 app().quit();
370 throw yield_exception("shutting down");
371 };
372 extraction = std::make_shared<chain_extraction_t>(shared_store_provider<store_provider>(common->store), log_exceptions_and_shutdown);
373
374 auto& chain = app().find_plugin<chain_plugin>()->chain();
375
377 chain.applied_transaction.connect([this](std::tuple<const chain::transaction_trace_ptr&, const chain::packed_transaction_ptr&> t) {
378 emit_killer([&](){
379 extraction->signal_applied_transaction(std::get<0>(t), std::get<1>(t));
380 });
381 }));
382
384 chain.block_start.connect([this](uint32_t block_num) {
385 emit_killer([&](){
386 extraction->signal_block_start(block_num);
387 });
388 }));
389
391 chain.accepted_block.connect([this](const chain::block_state_ptr& p) {
392 emit_killer([&](){
393 extraction->signal_accepted_block(p);
394 });
395 }));
396
398 chain.irreversible_block.connect([this](const chain::block_state_ptr& p) {
399 emit_killer([&](){
400 extraction->signal_irreversible_block(p);
401 });
402 }));
403
404 }
const mie::Vuint & p
Definition bn.cpp:27
abstract_plugin * find_plugin(const string &name) const
#define ilog(FORMAT,...)
Definition logger.hpp:118
application & app()
std::shared_ptr< block_state > block_state_ptr
std::tuple< const std::exception_ptr &, char const *, uint64_t, char const * > exception_with_context
Definition common.hpp:40
unsigned int uint32_t
Definition stdint.h:126
std::optional< scoped_connection > applied_transaction_connection
std::optional< scoped_connection > block_start_connection
std::optional< scoped_connection > irreversible_block_connection
std::optional< scoped_connection > accepted_block_connection
std::shared_ptr< chain_extraction_t > extraction
Here is the call graph for this function:

◆ plugin_shutdown()

void sysio::trace_api_plugin_impl::plugin_shutdown ( )
inline

Definition at line 410 of file trace_api_plugin.cpp.

410 {
411 common->plugin_shutdown();
412 }

◆ plugin_startup()

void sysio::trace_api_plugin_impl::plugin_startup ( )
inline

Definition at line 406 of file trace_api_plugin.cpp.

406 {
407 common->plugin_startup();
408 }

◆ set_program_options()

static void sysio::trace_api_plugin_impl::set_program_options ( appbase::options_description & cli,
appbase::options_description & cfg )
inlinestatic

Definition at line 362 of file trace_api_plugin.cpp.

362 {
363 }
Here is the caller graph for this function:

Member Data Documentation

◆ accepted_block_connection

std::optional<scoped_connection> sysio::trace_api_plugin_impl::accepted_block_connection

Definition at line 421 of file trace_api_plugin.cpp.

◆ applied_transaction_connection

std::optional<scoped_connection> sysio::trace_api_plugin_impl::applied_transaction_connection

Definition at line 419 of file trace_api_plugin.cpp.

◆ block_start_connection

std::optional<scoped_connection> sysio::trace_api_plugin_impl::block_start_connection

Definition at line 420 of file trace_api_plugin.cpp.

◆ common

std::shared_ptr<trace_api_common_impl> sysio::trace_api_plugin_impl::common

Definition at line 414 of file trace_api_plugin.cpp.

◆ extraction

std::shared_ptr<chain_extraction_t> sysio::trace_api_plugin_impl::extraction

Definition at line 417 of file trace_api_plugin.cpp.

◆ irreversible_block_connection

std::optional<scoped_connection> sysio::trace_api_plugin_impl::irreversible_block_connection

Definition at line 422 of file trace_api_plugin.cpp.


The documentation for this struct was generated from the following file: