Golos
Разработчикам Статистика Баунти Документация Партнеры Github
Public Member Functions | Public Attributes | List of all members
golos::application::application Class Reference

#include <application.hpp>

Public Member Functions

 application ()
 
 ~application ()
 
void set_program_options (boost::program_options::options_description &command_line_options, boost::program_options::options_description &configuration_file_options) const
 
void initialize (const fc::path &data_dir, const boost::program_options::variables_map &options)
 
void initialize_plugins (const boost::program_options::variables_map &options)
 
void startup ()
 
void shutdown ()
 
void startup_plugins ()
 
void shutdown_plugins ()
 
template<typename PluginType >
std::shared_ptr< PluginType > register_plugin ()
 
void register_abstract_plugin (std::shared_ptr< abstract_plugin > plug)
 
void enable_plugin (const std::string &name)
 
std::shared_ptr< abstract_pluginget_plugin (const string &name) const
 
template<typename PluginType >
std::shared_ptr< PluginType > get_plugin (const string &name) const
 
network::node_ptr p2p_node ()
 
std::shared_ptr< chain::databasechain_database () const
 
void set_block_production (bool producing_blocks)
 
fc::optional< api_access_infoget_api_access_info (const string &username) const
 
void set_api_access_info (const string &username, api_access_info &&permissions)
 
void register_api_factory (const string &name, std::function< fc::api_ptr(const api_context &)> factory)
 
template<typename Api >
void register_api_factory (const string &name)
 
fc::api_ptr create_api_by_name (const api_context &ctx)
 
void get_max_block_age (int32_t &result)
 
void connect_to_write_node ()
 

Public Attributes

bool _read_only = true
 
fc::optional< string > _remote_endpoint
 
fc::optional< fc::api< network_broadcast_api > > _remote_net_api
 
fc::optional< fc::api< login_api > > _remote_login
 
fc::http::websocket_connection_ptr _ws_ptr
 
std::shared_ptr< fc::rpc::websocket_api_connection > _ws_apic
 
fc::http::websocket_client _client
 

Detailed Description

Definition at line 32 of file application.hpp.

Constructor & Destructor Documentation

◆ application()

golos::application::application::application ( )

Definition at line 838 of file application.cpp.

◆ ~application()

golos::application::application::~application ( )

Definition at line 842 of file application.cpp.

Member Function Documentation

◆ chain_database()

std::shared_ptr< chain::database > golos::application::application::chain_database ( ) const

Definition at line 933 of file application.cpp.

◆ connect_to_write_node()

void golos::application::application::connect_to_write_node ( )

Definition at line 966 of file application.cpp.

◆ create_api_by_name()

fc::api_ptr golos::application::application::create_api_by_name ( const api_context ctx)

Instantiate the named API. Currently this simply calls the previously registered factory method.

Definition at line 958 of file application.cpp.

◆ enable_plugin()

void golos::application::application::enable_plugin ( const std::string &  name)

Definition at line 1003 of file application.cpp.

◆ get_api_access_info()

optional< api_access_info > golos::application::application::get_api_access_info ( const string &  username) const

Definition at line 946 of file application.cpp.

◆ get_max_block_age()

void golos::application::application::get_max_block_age ( int32_t &  result)

Definition at line 962 of file application.cpp.

◆ get_plugin() [1/2]

std::shared_ptr< abstract_plugin > golos::application::application::get_plugin ( const string &  name) const

Definition at line 919 of file application.cpp.

◆ get_plugin() [2/2]

template<typename PluginType >
std::shared_ptr<PluginType> golos::application::application::get_plugin ( const string &  name) const
inline

Definition at line 65 of file application.hpp.

◆ initialize()

void golos::application::application::initialize ( const fc::path &  data_dir,
const boost::program_options::variables_map &  options 
)

Definition at line 902 of file application.cpp.

◆ initialize_plugins()

void golos::application::application::initialize_plugins ( const boost::program_options::variables_map &  options)

Definition at line 1012 of file application.cpp.

◆ p2p_node()

network::node_ptr golos::application::application::p2p_node ( )

Definition at line 929 of file application.cpp.

◆ register_abstract_plugin()

void golos::application::application::register_abstract_plugin ( std::shared_ptr< abstract_plugin plug)

Definition at line 988 of file application.cpp.

◆ register_api_factory() [1/2]

void golos::application::application::register_api_factory ( const string &  name,
std::function< fc::api_ptr(const api_context &)>  factory 
)

Register a way to instantiate the named API with the application.

Definition at line 954 of file application.cpp.

◆ register_api_factory() [2/2]

template<typename Api >
void golos::application::application::register_api_factory ( const string &  name)
inline

Convenience method to build an API factory from a type which only requires a reference to the application.

Definition at line 91 of file application.hpp.

◆ register_plugin()

template<typename PluginType >
std::shared_ptr<PluginType> golos::application::application::register_plugin ( )
inline

Definition at line 53 of file application.hpp.

◆ set_api_access_info()

void golos::application::application::set_api_access_info ( const string &  username,
api_access_info &&  permissions 
)

Definition at line 950 of file application.cpp.

◆ set_block_production()

void golos::application::application::set_block_production ( bool  producing_blocks)

Definition at line 942 of file application.cpp.

◆ set_program_options()

void golos::application::application::set_program_options ( boost::program_options::options_description &  command_line_options,
boost::program_options::options_description &  configuration_file_options 
) const

Definition at line 856 of file application.cpp.

◆ shutdown()

void golos::application::application::shutdown ( )

Definition at line 984 of file application.cpp.

◆ shutdown_plugins()

void golos::application::application::shutdown_plugins ( )

Definition at line 977 of file application.cpp.

◆ startup()

void golos::application::application::startup ( )

Definition at line 907 of file application.cpp.

◆ startup_plugins()

void golos::application::application::startup_plugins ( )

Definition at line 1029 of file application.cpp.

Member Data Documentation

◆ _client

fc::http::websocket_client golos::application::application::_client

Definition at line 120 of file application.hpp.

◆ _read_only

bool golos::application::application::_read_only = true

Definition at line 113 of file application.hpp.

◆ _remote_endpoint

fc::optional<string> golos::application::application::_remote_endpoint

Definition at line 115 of file application.hpp.

◆ _remote_login

fc::optional<fc::api<login_api> > golos::application::application::_remote_login

Definition at line 117 of file application.hpp.

◆ _remote_net_api

fc::optional<fc::api<network_broadcast_api> > golos::application::application::_remote_net_api

Definition at line 116 of file application.hpp.

◆ _ws_apic

std::shared_ptr<fc::rpc::websocket_api_connection> golos::application::application::_ws_apic

Definition at line 119 of file application.hpp.

◆ _ws_ptr

fc::http::websocket_connection_ptr golos::application::application::_ws_ptr

Definition at line 118 of file application.hpp.


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