private-key option update
This commit is contained in:
parent
b857603f10
commit
a4c922cee9
2 changed files with 8 additions and 3 deletions
|
|
@ -14,6 +14,7 @@ VERSION=`cat /etc/peerplays/version`
|
||||||
# * $PEERPLAYSD_P2P_ENDPOINT
|
# * $PEERPLAYSD_P2P_ENDPOINT
|
||||||
# * $PEERPLAYSD_WITNESS_ID
|
# * $PEERPLAYSD_WITNESS_ID
|
||||||
# * $PEERPLAYSD_PRIVATE_KEY
|
# * $PEERPLAYSD_PRIVATE_KEY
|
||||||
|
# * $PEERPLAYSD_DEBUG_PRIVATE_KEY
|
||||||
# * $PEERPLAYSD_TRACK_ACCOUNTS
|
# * $PEERPLAYSD_TRACK_ACCOUNTS
|
||||||
# * $PEERPLAYSD_PARTIAL_OPERATIONS
|
# * $PEERPLAYSD_PARTIAL_OPERATIONS
|
||||||
# * $PEERPLAYSD_MAX_OPS_PER_ACCOUNT
|
# * $PEERPLAYSD_MAX_OPS_PER_ACCOUNT
|
||||||
|
|
@ -51,6 +52,10 @@ if [[ ! -z "$PEERPLAYSD_PRIVATE_KEY" ]]; then
|
||||||
ARGS+=" --private-key=$PEERPLAYSD_PRIVATE_KEY"
|
ARGS+=" --private-key=$PEERPLAYSD_PRIVATE_KEY"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ ! -z "$PEERPLAYSD_DEBUG_PRIVATE_KEY" ]]; then
|
||||||
|
ARGS+=" --debug-private-key=$PEERPLAYSD_DEBUG_PRIVATE_KEY"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ! -z "$PEERPLAYSD_TRACK_ACCOUNTS" ]]; then
|
if [[ ! -z "$PEERPLAYSD_TRACK_ACCOUNTS" ]]; then
|
||||||
for ACCOUNT in $PEERPLAYSD_TRACK_ACCOUNTS ; do
|
for ACCOUNT in $PEERPLAYSD_TRACK_ACCOUNTS ; do
|
||||||
ARGS+=" --track-account=$ACCOUNT"
|
ARGS+=" --track-account=$ACCOUNT"
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ void debug_witness_plugin::plugin_set_program_options(
|
||||||
{
|
{
|
||||||
auto default_priv_key = fc::ecc::private_key::regenerate(fc::sha256::hash(std::string("nathan")));
|
auto default_priv_key = fc::ecc::private_key::regenerate(fc::sha256::hash(std::string("nathan")));
|
||||||
command_line_options.add_options()
|
command_line_options.add_options()
|
||||||
("private-key", bpo::value<vector<string>>()->composing()->multitoken()->
|
("debug-private-key", bpo::value<vector<string>>()->composing()->multitoken()->
|
||||||
DEFAULT_VALUE_VECTOR(std::make_pair(chain::public_key_type(default_priv_key.get_public_key()), graphene::utilities::key_to_wif(default_priv_key))),
|
DEFAULT_VALUE_VECTOR(std::make_pair(chain::public_key_type(default_priv_key.get_public_key()), graphene::utilities::key_to_wif(default_priv_key))),
|
||||||
"Tuple of [PublicKey, WIF private key] (may specify multiple times)");
|
"Tuple of [PublicKey, WIF private key] (may specify multiple times)");
|
||||||
config_file_options.add(command_line_options);
|
config_file_options.add(command_line_options);
|
||||||
|
|
@ -63,9 +63,9 @@ void debug_witness_plugin::plugin_initialize(const boost::program_options::varia
|
||||||
ilog("debug_witness plugin: plugin_initialize() begin");
|
ilog("debug_witness plugin: plugin_initialize() begin");
|
||||||
_options = &options;
|
_options = &options;
|
||||||
|
|
||||||
if( options.count("private-key") )
|
if( options.count("debug-private-key") )
|
||||||
{
|
{
|
||||||
const std::vector<std::string> key_id_to_wif_pair_strings = options["private-key"].as<std::vector<std::string>>();
|
const std::vector<std::string> key_id_to_wif_pair_strings = options["debug-private-key"].as<std::vector<std::string>>();
|
||||||
for (const std::string& key_id_to_wif_pair_string : key_id_to_wif_pair_strings)
|
for (const std::string& key_id_to_wif_pair_string : key_id_to_wif_pair_strings)
|
||||||
{
|
{
|
||||||
auto key_id_to_wif_pair = graphene::app::dejsonify<std::pair<chain::public_key_type, std::string> >(key_id_to_wif_pair_string, GRAPHENE_MAX_NESTED_OBJECTS);
|
auto key_id_to_wif_pair = graphene::app::dejsonify<std::pair<chain::public_key_type, std::string> >(key_id_to_wif_pair_string, GRAPHENE_MAX_NESTED_OBJECTS);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue