Compare commits
27 commits
master
...
feature/SO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8aa95606f | ||
|
|
57a5edd98d | ||
|
|
48887429ca | ||
|
|
a0f24b775b | ||
|
|
e1a3241f93 | ||
|
|
5468873e0a | ||
|
|
436aebc73b | ||
|
|
65719df879 | ||
|
|
f19957c9f6 | ||
|
|
c206466b31 | ||
|
|
e0a7172b04 | ||
|
|
d1ddbe5afb | ||
|
|
9d30da3259 | ||
|
|
a1d3de2eb5 | ||
|
|
18225433ad | ||
|
|
1c2c0f900d | ||
|
|
b85dd083fb | ||
|
|
f7f7669e02 | ||
|
|
0581df5245 | ||
|
|
604439dcaf | ||
|
|
f097f94bdc | ||
|
|
5c3dcc2693 | ||
|
|
d99aa73104 | ||
|
|
bf3cc4b658 | ||
|
|
3198c37dbe | ||
|
|
bfb220e76f | ||
|
|
4caaf2321d |
7 changed files with 36 additions and 8 deletions
|
|
@ -135,7 +135,7 @@ else( WIN32 ) # Apple AND Linux
|
|||
endif( APPLE )
|
||||
|
||||
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin-memcmp -Wno-class-memaccess -Wno-parentheses -Wno-terminate -Wno-invalid-offsetof" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin-memcmp -Wno-parentheses -Wno-invalid-offsetof" )
|
||||
elseif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
|
||||
if( CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.0.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.0.0 )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-partial-specialization" )
|
||||
|
|
|
|||
|
|
@ -375,7 +375,6 @@ namespace detail {
|
|||
}
|
||||
_chain_db->add_checkpoints( loaded_checkpoints );
|
||||
|
||||
bool replay = false;
|
||||
std::string replay_reason = "reason not provided";
|
||||
|
||||
if( _options->count("replay-blockchain") )
|
||||
|
|
|
|||
|
|
@ -56,12 +56,19 @@ namespace graphene { namespace app {
|
|||
auto plug = std::make_shared<PluginType>();
|
||||
plug->plugin_set_app(this);
|
||||
|
||||
boost::program_options::options_description plugin_cli_options("Options for plugin " + plug->plugin_name()), plugin_cfg_options;
|
||||
string cli_plugin_desc = plug->plugin_name() + " plugin. " + plug->plugin_description() + "\nOptions";
|
||||
boost::program_options::options_description plugin_cli_options( cli_plugin_desc ), plugin_cfg_options;
|
||||
plug->plugin_set_program_options(plugin_cli_options, plugin_cfg_options);
|
||||
if( !plugin_cli_options.options().empty() )
|
||||
_cli_options.add(plugin_cli_options);
|
||||
|
||||
if( !plugin_cfg_options.options().empty() )
|
||||
{
|
||||
std::string header_name = "plugin-cfg-header-" + plug->plugin_name();
|
||||
std::string header_desc = plug->plugin_name() + " plugin options";
|
||||
_cfg_options.add_options()(header_name.c_str(), header_desc.c_str());
|
||||
_cfg_options.add(plugin_cfg_options);
|
||||
}
|
||||
|
||||
add_available_plugin( plug );
|
||||
return plug;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ class abstract_plugin
|
|||
public:
|
||||
virtual ~abstract_plugin(){}
|
||||
virtual std::string plugin_name()const = 0;
|
||||
virtual std::string plugin_description()const = 0;
|
||||
|
||||
/**
|
||||
* @brief Perform early startup routines and register plugin indexes, callbacks, etc.
|
||||
|
|
@ -100,6 +101,7 @@ class plugin : public abstract_plugin
|
|||
virtual ~plugin() override;
|
||||
|
||||
virtual std::string plugin_name()const override;
|
||||
virtual std::string plugin_description()const override;
|
||||
virtual void plugin_initialize( const boost::program_options::variables_map& options ) override;
|
||||
virtual void plugin_startup() override;
|
||||
virtual void plugin_shutdown() override;
|
||||
|
|
|
|||
|
|
@ -43,6 +43,11 @@ std::string plugin::plugin_name()const
|
|||
return "<unknown plugin>";
|
||||
}
|
||||
|
||||
std::string plugin::plugin_description()const
|
||||
{
|
||||
return "<no description>";
|
||||
}
|
||||
|
||||
void plugin::plugin_initialize( const boost::program_options::variables_map& options )
|
||||
{
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ class peerplays_sidechain_plugin_impl
|
|||
virtual ~peerplays_sidechain_plugin_impl();
|
||||
|
||||
peerplays_sidechain_plugin& _self;
|
||||
|
||||
uint32_t parameter;
|
||||
uint32_t optional_parameter;
|
||||
};
|
||||
|
||||
peerplays_sidechain_plugin_impl::~peerplays_sidechain_plugin_impl()
|
||||
|
|
@ -40,15 +43,27 @@ std::string peerplays_sidechain_plugin::plugin_name()const
|
|||
}
|
||||
|
||||
void peerplays_sidechain_plugin::plugin_set_program_options(
|
||||
boost::program_options::options_description& /*cli*/,
|
||||
boost::program_options::options_description& /*cfg*/
|
||||
boost::program_options::options_description& cli,
|
||||
boost::program_options::options_description& cfg
|
||||
)
|
||||
{
|
||||
cli.add_options()
|
||||
("parameter", boost::program_options::value<uint32_t>(), "Parameter")
|
||||
("optional-parameter", boost::program_options::value<uint32_t>(), "Optional parameter")
|
||||
;
|
||||
cfg.add(cli);
|
||||
}
|
||||
|
||||
void peerplays_sidechain_plugin::plugin_initialize(const boost::program_options::variables_map& /*options*/)
|
||||
void peerplays_sidechain_plugin::plugin_initialize(const boost::program_options::variables_map& options)
|
||||
{
|
||||
ilog("peerplays sidechain plugin: plugin_initialize()");
|
||||
|
||||
if (options.count("parameter")) {
|
||||
my->parameter = options["optional-parameter"].as<uint32_t>();
|
||||
}
|
||||
if (options.count("optional-parameter")) {
|
||||
my->optional_parameter = options["optional-parameter"].as<uint32_t>();
|
||||
}
|
||||
}
|
||||
|
||||
void peerplays_sidechain_plugin::plugin_startup()
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@
|
|||
#include <fc/interprocess/signals.hpp>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/container/flat_set.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
|
@ -149,10 +148,11 @@ int main(int argc, char** argv) {
|
|||
std::for_each(plugins.begin(), plugins.end(), [node](const std::string& plug) mutable {
|
||||
if (!plug.empty()) {
|
||||
node->enable_plugin(plug);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
bpo::notify(options);
|
||||
|
||||
node->initialize(data_dir, options);
|
||||
node->initialize_plugins( options );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue