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

#include <net_api_plugin.hpp>

Inheritance diagram for sysio::net_api_plugin:
Collaboration diagram for sysio::net_api_plugin:

Public Member Functions

 APPBASE_PLUGIN_REQUIRES ((net_plugin)(http_plugin)) net_api_plugin()=default
 
 net_api_plugin (const net_api_plugin &)=delete
 
 net_api_plugin (net_api_plugin &&)=delete
 
net_api_pluginoperator= (const net_api_plugin &)=delete
 
net_api_pluginoperator= (net_api_plugin &&)=delete
 
virtual ~net_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< net_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< net_api_plugin >
 plugin (const string &name)
 

Detailed Description

Definition at line 12 of file net_api_plugin.hpp.

Constructor & Destructor Documentation

◆ net_api_plugin() [1/2]

sysio::net_api_plugin::net_api_plugin ( const net_api_plugin & )
delete

◆ net_api_plugin() [2/2]

sysio::net_api_plugin::net_api_plugin ( net_api_plugin && )
delete

◆ ~net_api_plugin()

virtual sysio::net_api_plugin::~net_api_plugin ( )
overridevirtualdefault

Member Function Documentation

◆ APPBASE_PLUGIN_REQUIRES()

sysio::net_api_plugin::APPBASE_PLUGIN_REQUIRES ( (net_plugin)(http_plugin) )
default

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ plugin_initialize()

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

Definition at line 74 of file net_api_plugin.cpp.

74 {
75 try {
76 const auto& _http_plugin = app().get_plugin<http_plugin>();
77 if( !_http_plugin.is_on_loopback()) {
78 wlog( "\n"
79 "**********SECURITY WARNING**********\n"
80 "* *\n"
81 "* -- Net API -- *\n"
82 "* - EXPOSED to the LOCAL NETWORK - *\n"
83 "* - USE ONLY ON SECURE NETWORKS! - *\n"
84 "* *\n"
85 "************************************\n" );
86 }
88}
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::net_api_plugin::plugin_shutdown ( )
inline

Definition at line 26 of file net_api_plugin.hpp.

26{}

◆ plugin_startup()

void sysio::net_api_plugin::plugin_startup ( )

Definition at line 52 of file net_api_plugin.cpp.

52 {
53 ilog("starting net_api_plugin");
54 // lifetime of plugin is lifetime of application
55 auto& net_mgr = app().get_plugin<net_plugin>();
56 app().get_plugin<http_plugin>().add_api({
57 // CALL(net, net_mgr, set_timeout,
58 // INVOKE_V_R(net_mgr, set_timeout, int64_t), 200),
59 // CALL(net, net_mgr, sign_transaction,
60 // INVOKE_R_R_R_R(net_mgr, sign_transaction, chain::signed_transaction, flat_set<public_key_type>, chain::chain_id_type), 201),
61 CALL_WITH_400(net, net_mgr, connect,
62 INVOKE_R_R(net_mgr, connect, std::string), 201),
63 CALL_WITH_400(net, net_mgr, disconnect,
64 INVOKE_R_R(net_mgr, disconnect, std::string), 201),
65 CALL_WITH_400(net, net_mgr, status,
66 INVOKE_R_R(net_mgr, status, std::string), 201),
67 CALL_WITH_400(net, net_mgr, connections,
68 INVOKE_R_V(net_mgr, connections), 201),
69 // CALL(net, net_mgr, open,
70 // INVOKE_V_R(net_mgr, open, std::string), 200),
72}
#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_R_R(api_handle, call_name, in_param)
static constexpr int medium_high
Here is the call graph for this function:

◆ set_program_options()

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

Implements appbase::abstract_plugin.

Definition at line 23 of file net_api_plugin.hpp.

23{}

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