Update documentation and fix error messages, Fix #127

This commit is contained in:
Daniel Larimer 2015-07-02 12:11:43 -04:00
parent 68fabe1464
commit 871aa734ae
7 changed files with 21 additions and 7 deletions

View file

@ -31,6 +31,10 @@ To set your iniital password to 'password' use:
>>> set_password password >>> set_password password
>>> unlock password >>> unlock password
To import your initial balance:
>>> import_balance nathan [5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3] true
If you send private keys over this connection, `rpc-endpoint` should be bound to localhost for security. If you send private keys over this connection, `rpc-endpoint` should be bound to localhost for security.
A list of CLI wallet commands is available [here](https://bitshares.github.io/doxygen/classgraphene_1_1wallet_1_1wallet__api.html). A list of CLI wallet commands is available [here](https://bitshares.github.io/doxygen/classgraphene_1_1wallet_1_1wallet__api.html).
@ -75,7 +79,7 @@ Witness node
The role of the witness node is to broadcast transactions, download blocks, and optionally sign them. The role of the witness node is to broadcast transactions, download blocks, and optionally sign them.
./witness_node --rpc-endpoint "127.0.0.1:8090" --enable-stale-production -w \""1.7.0"\" \""1.7.1"\" \""1.7.2"\" \""1.7.3"\" \""1.7.4"\" --private-key "[\"1.2.0\",\"d2653ff7cbb2d8ff129ac27ef5781ce68b2558c41a74af1f2ddca635cbeef07d\"]" ./witness_node --rpc-endpoint "127.0.0.1:8090" --enable-stale-production -w \""1.6.0"\" \""1.6.1"\" \""1.6.2"\" \""1.6.3"\" \""1.6.4"\"
Running specific tests Running specific tests
---------------------- ----------------------

View file

@ -107,6 +107,7 @@ namespace detail {
wsc->register_api(fc::api<graphene::app::login_api>(login)); wsc->register_api(fc::api<graphene::app::login_api>(login));
c->set_session_data( wsc ); c->set_session_data( wsc );
}); });
ilog("Configured websocket rpc to listen on ${ip}", ("ip",_options->at("rpc-endpoint").as<string>()));
_websocket_server->listen( fc::ip::endpoint::from_string(_options->at("rpc-endpoint").as<string>()) ); _websocket_server->listen( fc::ip::endpoint::from_string(_options->at("rpc-endpoint").as<string>()) );
_websocket_server->start_accept(); _websocket_server->start_accept();
} FC_CAPTURE_AND_RETHROW() } } FC_CAPTURE_AND_RETHROW() }
@ -117,7 +118,10 @@ namespace detail {
if( !_options->count("rpc-tls-endpoint") ) if( !_options->count("rpc-tls-endpoint") )
return; return;
if( !_options->count("server-pem") ) if( !_options->count("server-pem") )
{
wlog( "Please specify a server-pem to use rpc-tls-endpoint" );
return; return;
}
string password = _options->count("server-pem-password") ? _options->at("server-pem-password").as<string>() : ""; string password = _options->count("server-pem-password") ? _options->at("server-pem-password").as<string>() : "";
_websocket_tls_server = std::make_shared<fc::http::websocket_tls_server>( _options->at("server-pem").as<string>(), password ); _websocket_tls_server = std::make_shared<fc::http::websocket_tls_server>( _options->at("server-pem").as<string>(), password );
@ -130,6 +134,7 @@ namespace detail {
wsc->register_api(fc::api<graphene::app::login_api>(login)); wsc->register_api(fc::api<graphene::app::login_api>(login));
c->set_session_data( wsc ); c->set_session_data( wsc );
}); });
ilog("Configured websocket TLS rpc to listen on ${ip}", ("ip",_options->at("rpc-tls-endpoint").as<string>()));
_websocket_tls_server->listen( fc::ip::endpoint::from_string(_options->at("rpc-tls-endpoint").as<string>()) ); _websocket_tls_server->listen( fc::ip::endpoint::from_string(_options->at("rpc-tls-endpoint").as<string>()) );
_websocket_tls_server->start_accept(); _websocket_tls_server->start_accept();
} FC_CAPTURE_AND_RETHROW() } } FC_CAPTURE_AND_RETHROW() }

View file

@ -179,7 +179,8 @@ struct reflector<graphene::db::object_id<SpaceID,TypeID,T> >
FC_ASSERT( first_dot != second_dot ); FC_ASSERT( first_dot != second_dot );
FC_ASSERT( first_dot != 0 && first_dot != std::string::npos ); FC_ASSERT( first_dot != 0 && first_dot != std::string::npos );
FC_ASSERT( fc::to_uint64( s.substr( 0, first_dot ) ) == SpaceID && FC_ASSERT( fc::to_uint64( s.substr( 0, first_dot ) ) == SpaceID &&
fc::to_uint64( s.substr( first_dot+1, second_dot-first_dot-1 ) ) == TypeID ); fc::to_uint64( s.substr( first_dot+1, second_dot-first_dot-1 ) ) == TypeID,
"Space.Type.0 (${SpaceID}.${TypeID}.0) doesn't match expected value ${var}", ("TypeID",TypeID)("SpaceID",SpaceID)("var",var) );
vo.instance = fc::to_uint64(s.substr( second_dot+1 )); vo.instance = fc::to_uint64(s.substr( second_dot+1 ));
} FC_CAPTURE_AND_RETHROW( (var) ) } } FC_CAPTURE_AND_RETHROW( (var) ) }

View file

@ -63,6 +63,7 @@ void witness_plugin::plugin_initialize(const boost::program_options::variables_m
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); auto key_id_to_wif_pair = graphene::app::dejsonify<std::pair<chain::public_key_type, std::string> >(key_id_to_wif_pair_string);
idump((key_id_to_wif_pair));
fc::optional<fc::ecc::private_key> private_key = graphene::utilities::wif_to_key(key_id_to_wif_pair.second); fc::optional<fc::ecc::private_key> private_key = graphene::utilities::wif_to_key(key_id_to_wif_pair.second);
if (!private_key) if (!private_key)
{ {
@ -80,9 +81,7 @@ void witness_plugin::plugin_initialize(const boost::program_options::variables_m
_private_keys[key_id_to_wif_pair.first] = *private_key; _private_keys[key_id_to_wif_pair.first] = *private_key;
} }
} }
} } FC_LOG_AND_RETHROW() }
catch (const fc::exception& e){ edump((e)); throw; }
}
void witness_plugin::plugin_startup() void witness_plugin::plugin_startup()
{ try { { try {

View file

@ -10,7 +10,7 @@ if( GPERFTOOLS_FOUND )
endif() endif()
target_link_libraries( cli_full_wallet target_link_libraries( cli_full_wallet
PRIVATE graphene_account_history graphene_market_history graphene_app graphene_net graphene_chain graphene_utilities graphene_wallet fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) PRIVATE graphene_witness graphene_account_history graphene_market_history graphene_app graphene_net graphene_chain graphene_utilities graphene_wallet fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} )
if(MSVC) if(MSVC)
set_source_files_properties( main.cpp PROPERTIES COMPILE_FLAGS "/bigobj" ) set_source_files_properties( main.cpp PROPERTIES COMPILE_FLAGS "/bigobj" )

View file

@ -44,6 +44,7 @@
#include <fc/log/logger.hpp> #include <fc/log/logger.hpp>
#include <fc/log/logger_config.hpp> #include <fc/log/logger_config.hpp>
#include <graphene/witness/witness.hpp>
#include <graphene/account_history/account_history_plugin.hpp> #include <graphene/account_history/account_history_plugin.hpp>
#include <graphene/market_history/market_history_plugin.hpp> #include <graphene/market_history/market_history_plugin.hpp>
@ -73,7 +74,7 @@ int main( int argc, char** argv )
("rpc-tls-certificate,c", bpo::value<string>()->implicit_value("server.pem"), "PEM certificate for wallet websocket TLS RPC") ("rpc-tls-certificate,c", bpo::value<string>()->implicit_value("server.pem"), "PEM certificate for wallet websocket TLS RPC")
("rpc-http-endpoint,h", bpo::value<string>()->implicit_value("127.0.0.1:8093"), "Endpoint for wallet HTTP RPC to listen on") ("rpc-http-endpoint,h", bpo::value<string>()->implicit_value("127.0.0.1:8093"), "Endpoint for wallet HTTP RPC to listen on")
("daemon,d", "Run the wallet in daemon mode" ) ("daemon,d", "Run the wallet in daemon mode" )
("wallet-file,w", bpo::value<string>()->implicit_value("wallet.json"), "wallet to load"); ("wallet-file,W", bpo::value<string>()->implicit_value("wallet.json"), "wallet to load");
bpo::options_description app_options("Graphene Witness Node"); bpo::options_description app_options("Graphene Witness Node");
bpo::options_description cfg_options("Graphene Witness Node"); bpo::options_description cfg_options("Graphene Witness Node");
@ -83,6 +84,7 @@ int main( int argc, char** argv )
bpo::variables_map options; bpo::variables_map options;
auto witness_plug = node.register_plugin<witness_plugin::witness_plugin>();
auto history_plug = node.register_plugin<account_history::account_history_plugin>(); auto history_plug = node.register_plugin<account_history::account_history_plugin>();
auto market_history_plug = node.register_plugin<market_history::market_history_plugin>(); auto market_history_plug = node.register_plugin<market_history::market_history_plugin>();
@ -157,6 +159,7 @@ int main( int argc, char** argv )
node.startup(); node.startup();
node.startup_plugins(); node.startup_plugins();
ilog("Started witness node on a chain with ${h} blocks.", ("h", node.chain_database()->head_block_num()));
// auto remote_api = apic->get_remote_api< login_api >(1); // auto remote_api = apic->get_remote_api< login_api >(1);

View file

@ -110,6 +110,8 @@ int main( int argc, char** argv )
idump( (key_to_wif( genesis_private_key ) ) ); idump( (key_to_wif( genesis_private_key ) ) );
fc::ecc::private_key nathan_private_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("nathan"))); fc::ecc::private_key nathan_private_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("nathan")));
public_key_type nathan_pub_key = nathan_private_key.get_public_key();
idump( (nathan_pub_key) );
idump( (key_to_wif( nathan_private_key ) ) ); idump( (key_to_wif( nathan_private_key ) ) );
// //