Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::producer_api_plugin Class Reference

#include <producer_api_plugin.hpp>

Inheritance diagram for sysio::producer_api_plugin:
Collaboration diagram for sysio::producer_api_plugin:

Public Member Functions

 APPBASE_PLUGIN_REQUIRES ((producer_plugin)(http_plugin)) producer_api_plugin()=default
 
 producer_api_plugin (const producer_api_plugin &)=delete
 
 producer_api_plugin (producer_api_plugin &&)=delete
 
producer_api_pluginoperator= (const producer_api_plugin &)=delete
 
producer_api_pluginoperator= (producer_api_plugin &&)=delete
 
virtual ~producer_api_plugin () override=default
 
virtual void set_program_options (options_description &cli, options_description &cfg) override
 
void plugin_initialize (const variables_map &vm)
 
void plugin_startup ()
 
void plugin_shutdown ()
 
- Public Member Functions inherited from appbase::plugin< producer_api_plugin >
 plugin ()
 
virtual ~plugin ()
 
virtual state get_state () const override
 
virtual const std::string & name () const override
 
virtual void register_dependencies ()
 
virtual void initialize (const variables_map &options) override
 
virtual void handle_sighup () override
 
virtual void startup () override
 
virtual void shutdown () override
 
- Public Member Functions inherited from appbase::abstract_plugin
virtual ~abstract_plugin ()
 

Additional Inherited Members

- Public Types inherited from appbase::abstract_plugin
enum  state { registered , initialized , started , stopped }
 
- Protected Member Functions inherited from appbase::plugin< producer_api_plugin >
 plugin (const string &name)
 

Detailed Description

Definition at line 12 of file producer_api_plugin.hpp.

Constructor & Destructor Documentation

◆ producer_api_plugin() [1/2]

sysio::producer_api_plugin::producer_api_plugin ( const producer_api_plugin & )
delete

◆ producer_api_plugin() [2/2]

sysio::producer_api_plugin::producer_api_plugin ( producer_api_plugin && )
delete

◆ ~producer_api_plugin()

virtual sysio::producer_api_plugin::~producer_api_plugin ( )
overridevirtualdefault

Member Function Documentation

◆ APPBASE_PLUGIN_REQUIRES()

sysio::producer_api_plugin::APPBASE_PLUGIN_REQUIRES ( (producer_plugin)(http_plugin) )
default

◆ operator=() [1/2]

producer_api_plugin & sysio::producer_api_plugin::operator= ( const producer_api_plugin & )
delete

◆ operator=() [2/2]

producer_api_plugin & sysio::producer_api_plugin::operator= ( producer_api_plugin && )
delete

◆ plugin_initialize()

void sysio::producer_api_plugin::plugin_initialize ( const variables_map & vm)

Definition at line 128 of file producer_api_plugin.cpp.

128 {
129 try {
130 const auto& _http_plugin = app().get_plugin<http_plugin>();
131 if( !_http_plugin.is_on_loopback()) {
132 wlog( "\n"
133 "**********SECURITY WARNING**********\n"
134 "* *\n"
135 "* -- Producer API -- *\n"
136 "* - EXPOSED to the LOCAL NETWORK - *\n"
137 "* - USE ONLY ON SECURE NETWORKS! - *\n"
138 "* *\n"
139 "************************************\n" );
140
141 }
143}
abstract_plugin & get_plugin(const string &name) const
#define FC_LOG_AND_RETHROW()
#define wlog(FORMAT,...)
Definition logger.hpp:124
application & app()
Here is the call graph for this function:

◆ plugin_shutdown()

void sysio::producer_api_plugin::plugin_shutdown ( )
inline

Definition at line 26 of file producer_api_plugin.hpp.

26{}

◆ plugin_startup()

void sysio::producer_api_plugin::plugin_startup ( )

Definition at line 86 of file producer_api_plugin.cpp.

86 {
87 ilog("starting producer_api_plugin");
88 // lifetime of plugin is lifetime of application
89 auto& producer = app().get_plugin<producer_plugin>();
90
91 app().get_plugin<http_plugin>().add_api({
92 CALL_WITH_400(producer, producer, pause,
93 INVOKE_V_V(producer, pause), 201),
94 CALL_WITH_400(producer, producer, resume,
95 INVOKE_V_V(producer, resume), 201),
96 CALL_WITH_400(producer, producer, paused,
97 INVOKE_R_V(producer, paused), 201),
98 CALL_WITH_400(producer, producer, get_runtime_options,
99 INVOKE_R_V(producer, get_runtime_options), 201),
100 CALL_WITH_400(producer, producer, update_runtime_options,
101 INVOKE_V_R(producer, update_runtime_options, producer_plugin::runtime_options), 201),
102 CALL_WITH_400(producer, producer, add_greylist_accounts,
103 INVOKE_V_R(producer, add_greylist_accounts, producer_plugin::greylist_params), 201),
104 CALL_WITH_400(producer, producer, remove_greylist_accounts,
105 INVOKE_V_R(producer, remove_greylist_accounts, producer_plugin::greylist_params), 201),
106 CALL_WITH_400(producer, producer, get_greylist,
107 INVOKE_R_V(producer, get_greylist), 201),
108 CALL_WITH_400(producer, producer, get_whitelist_blacklist,
109 INVOKE_R_V(producer, get_whitelist_blacklist), 201),
110 CALL_WITH_400(producer, producer, set_whitelist_blacklist,
111 INVOKE_V_R(producer, set_whitelist_blacklist, producer_plugin::whitelist_blacklist), 201),
112 CALL_WITH_400(producer, producer, get_integrity_hash,
113 INVOKE_R_V(producer, get_integrity_hash), 201),
114 CALL_ASYNC(producer, producer, create_snapshot, producer_plugin::snapshot_information,
115 INVOKE_R_V_ASYNC(producer, create_snapshot), 201),
116 CALL_WITH_400(producer, producer, get_scheduled_protocol_feature_activations,
117 INVOKE_R_V(producer, get_scheduled_protocol_feature_activations), 201),
118 CALL_WITH_400(producer, producer, schedule_protocol_feature_activations,
119 INVOKE_V_R(producer, schedule_protocol_feature_activations, producer_plugin::scheduled_protocol_feature_activations), 201),
120 CALL_WITH_400(producer, producer, get_supported_protocol_features,
121 INVOKE_R_R_II(producer, get_supported_protocol_features,
122 producer_plugin::get_supported_protocol_features_params), 201),
123 CALL_WITH_400(producer, producer, get_account_ram_corrections,
124 INVOKE_R_R(producer, get_account_ram_corrections, producer_plugin::get_account_ram_corrections_params), 201),
126}
#define CALL_WITH_400(api_name, api_handle, api_namespace, call_name, http_response_code, params_type)
#define INVOKE_R_V(api_handle, call_name)
#define ilog(FORMAT,...)
Definition logger.hpp:118
#define INVOKE_V_R(api_handle, call_name, in_param)
#define INVOKE_V_V(api_handle, call_name)
#define INVOKE_R_R(api_handle, call_name, in_param)
#define INVOKE_R_R_II(api_handle, call_name, in_param)
#define INVOKE_R_V_ASYNC(api_handle, call_name)
#define CALL_ASYNC(api_name, api_handle, call_name, call_result, INVOKE, http_response_code)
static constexpr int medium_high
void pause()
Here is the call graph for this function:

◆ set_program_options()

virtual void sysio::producer_api_plugin::set_program_options ( options_description & cli,
options_description & cfg )
inlineoverridevirtual

Implements appbase::abstract_plugin.

Definition at line 23 of file producer_api_plugin.hpp.

23{}

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