-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move --plugins from application to binary #1427 #1437
Merged
Merged
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
0abcff9
Allow required plugins
nathanielhourt b5362ce
Clean up plugin loader
nathanielhourt 3e683ed
Merge commit 'refs/pull/1427/head' of https://github.com/bitshares/bi…
oxarbitrage f5031bd
move plugins option to witness_node executable
oxarbitrage adef6a2
fix cli wallet test
oxarbitrage 9647ad1
remove double space line
oxarbitrage ce35a79
add default plugin values to option
oxarbitrage 58ad814
remove not needed check
oxarbitrage 7089d2a
fix delayed node
oxarbitrage 1dd719f
use auto load plugins in delayed node
oxarbitrage a8020a7
reverse delayed node and only add auto to needed plugins
oxarbitrage 1326a5c
make plugins option work in delayed
oxarbitrage a590c25
remove useless check
oxarbitrage caf7f7f
add default value to trusted-node
oxarbitrage bac55a4
Merge branch 'develop' into pull1427_2
oxarbitrage e198552
remove default option in delayed plugin
oxarbitrage File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,9 +64,11 @@ int main(int argc, char** argv) { | |
bpo::options_description app_options("Graphene Delayed Node"); | ||
bpo::options_description cfg_options("Graphene Delayed Node"); | ||
app_options.add_options() | ||
("help,h", "Print this help message and exit.") | ||
("data-dir,d", bpo::value<boost::filesystem::path>()->default_value("delayed_node_data_dir"), "Directory containing databases, configuration file, etc.") | ||
; | ||
("help,h", "Print this help message and exit.") | ||
("data-dir,d", bpo::value<boost::filesystem::path>()->default_value("delayed_node_data_dir"), "Directory containing databases, configuration file, etc.") | ||
("plugins", bpo::value<std::string>()->default_value("delayed_node account_history market_history"), | ||
"Space-separated list of plugins to activate"); | ||
; | ||
|
||
bpo::variables_map options; | ||
|
||
|
@@ -84,8 +86,8 @@ int main(int argc, char** argv) { | |
} | ||
catch (const boost::program_options::error& e) | ||
{ | ||
std::cerr << "Error parsing command line: " << e.what() << "\n"; | ||
return 1; | ||
std::cerr << "Error parsing command line: " << e.what() << "\n"; | ||
return 1; | ||
} | ||
|
||
if( options.count("help") ) | ||
|
@@ -160,9 +162,20 @@ int main(int argc, char** argv) { | |
elog("Error parsing configuration file: ${e}", ("e", e.what())); | ||
return 1; | ||
} | ||
if( !options.count("plugins") ) | ||
options.insert( std::make_pair( "plugins", bpo::variable_value(std::string("delayed_node account_history market_history"), true) ) ); | ||
|
||
std::set<std::string> plugins; | ||
boost::split(plugins, options.at("plugins").as<std::string>(), [](char c){return c == ' ';}); | ||
|
||
if(plugins.count("account_history") && plugins.count("elasticsearch")) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This check is useless. Elasticsearch is not available in delayed_node. |
||
std::cerr << "Plugin conflict: Cannot load both account_history plugin and elasticsearch plugin\n"; | ||
return 1; | ||
} | ||
|
||
std::for_each(plugins.begin(), plugins.end(), [&](const std::string& plug) mutable { | ||
if (!plug.empty()) { | ||
node.enable_plugin(plug); | ||
} | ||
}); | ||
node.initialize(data_dir, options); | ||
node.initialize_plugins( options ); | ||
|
||
|
@@ -171,7 +184,7 @@ int main(int argc, char** argv) { | |
|
||
fc::promise<int>::ptr exit_promise = new fc::promise<int>("UNIX Signal Handler"); | ||
fc::set_signal_handler([&exit_promise](int signal) { | ||
exit_promise->set_value(signal); | ||
exit_promise->set_value(signal); | ||
}, SIGINT); | ||
|
||
ilog("Started delayed node on a chain with ${h} blocks.", ("h", node.chain_database()->head_block_num())); | ||
|
@@ -241,14 +254,14 @@ fc::optional<fc::logging_config> load_logging_config_from_ini_file(const fc::pat | |
// stdout/stderr will be taken from ini file, everything else hard-coded here | ||
fc::console_appender::config console_appender_config; | ||
console_appender_config.level_colors.emplace_back( | ||
fc::console_appender::level_color(fc::log_level::debug, | ||
fc::console_appender::color::green)); | ||
fc::console_appender::level_color(fc::log_level::debug, | ||
fc::console_appender::color::green)); | ||
console_appender_config.level_colors.emplace_back( | ||
fc::console_appender::level_color(fc::log_level::warn, | ||
fc::console_appender::color::brown)); | ||
fc::console_appender::level_color(fc::log_level::warn, | ||
fc::console_appender::color::brown)); | ||
console_appender_config.level_colors.emplace_back( | ||
fc::console_appender::level_color(fc::log_level::error, | ||
fc::console_appender::color::cyan)); | ||
fc::console_appender::level_color(fc::log_level::error, | ||
fc::console_appender::color::cyan)); | ||
console_appender_config.stream = fc::variant(stream_name, 1).as<fc::console_appender::stream::type>(1); | ||
logging_config.appenders.push_back(fc::appender_config(console_appender_name, "console", fc::variant(console_appender_config, GRAPHENE_MAX_NESTED_OBJECTS))); | ||
found_logging_config = true; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should keep the "plugins" option. We don't want to change the behaviour of the executable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is done 1326a5c