diff --git a/README.md b/README.md index e07e217a..08b164f8 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,10 @@ To set your iniital password to 'password' use: >>> set_password 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. 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. -./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 ---------------------- diff --git a/libraries/app/application.cpp b/libraries/app/application.cpp index 0cadcf74..09126702 100644 --- a/libraries/app/application.cpp +++ b/libraries/app/application.cpp @@ -107,6 +107,7 @@ namespace detail { wsc->register_api(fc::api(login)); c->set_session_data( wsc ); }); + ilog("Configured websocket rpc to listen on ${ip}", ("ip",_options->at("rpc-endpoint").as())); _websocket_server->listen( fc::ip::endpoint::from_string(_options->at("rpc-endpoint").as()) ); _websocket_server->start_accept(); } FC_CAPTURE_AND_RETHROW() } @@ -117,7 +118,10 @@ namespace detail { if( !_options->count("rpc-tls-endpoint") ) return; if( !_options->count("server-pem") ) + { + wlog( "Please specify a server-pem to use rpc-tls-endpoint" ); return; + } string password = _options->count("server-pem-password") ? _options->at("server-pem-password").as() : ""; _websocket_tls_server = std::make_shared( _options->at("server-pem").as(), password ); @@ -130,6 +134,7 @@ namespace detail { wsc->register_api(fc::api(login)); c->set_session_data( wsc ); }); + ilog("Configured websocket TLS rpc to listen on ${ip}", ("ip",_options->at("rpc-tls-endpoint").as())); _websocket_tls_server->listen( fc::ip::endpoint::from_string(_options->at("rpc-tls-endpoint").as()) ); _websocket_tls_server->start_accept(); } FC_CAPTURE_AND_RETHROW() } diff --git a/libraries/db/include/graphene/db/object_id.hpp b/libraries/db/include/graphene/db/object_id.hpp index fc6d29e7..84428c7e 100644 --- a/libraries/db/include/graphene/db/object_id.hpp +++ b/libraries/db/include/graphene/db/object_id.hpp @@ -179,7 +179,8 @@ struct reflector > FC_ASSERT( first_dot != second_dot ); FC_ASSERT( first_dot != 0 && first_dot != std::string::npos ); 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 )); } FC_CAPTURE_AND_RETHROW( (var) ) } diff --git a/libraries/plugins/witness/witness.cpp b/libraries/plugins/witness/witness.cpp index 7f8f3221..eca76d97 100644 --- a/libraries/plugins/witness/witness.cpp +++ b/libraries/plugins/witness/witness.cpp @@ -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) { auto key_id_to_wif_pair = graphene::app::dejsonify >(key_id_to_wif_pair_string); + idump((key_id_to_wif_pair)); fc::optional private_key = graphene::utilities::wif_to_key(key_id_to_wif_pair.second); 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; } } - } - catch (const fc::exception& e){ edump((e)); throw; } -} +} FC_LOG_AND_RETHROW() } void witness_plugin::plugin_startup() { try { diff --git a/programs/cli_full_wallet/CMakeLists.txt b/programs/cli_full_wallet/CMakeLists.txt index 548993cf..b031363f 100644 --- a/programs/cli_full_wallet/CMakeLists.txt +++ b/programs/cli_full_wallet/CMakeLists.txt @@ -10,7 +10,7 @@ if( GPERFTOOLS_FOUND ) endif() 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) set_source_files_properties( main.cpp PROPERTIES COMPILE_FLAGS "/bigobj" ) diff --git a/programs/cli_full_wallet/main.cpp b/programs/cli_full_wallet/main.cpp index 45c183cf..cb704418 100644 --- a/programs/cli_full_wallet/main.cpp +++ b/programs/cli_full_wallet/main.cpp @@ -44,6 +44,7 @@ #include #include +#include #include #include @@ -73,7 +74,7 @@ int main( int argc, char** argv ) ("rpc-tls-certificate,c", bpo::value()->implicit_value("server.pem"), "PEM certificate for wallet websocket TLS RPC") ("rpc-http-endpoint,h", bpo::value()->implicit_value("127.0.0.1:8093"), "Endpoint for wallet HTTP RPC to listen on") ("daemon,d", "Run the wallet in daemon mode" ) - ("wallet-file,w", bpo::value()->implicit_value("wallet.json"), "wallet to load"); + ("wallet-file,W", bpo::value()->implicit_value("wallet.json"), "wallet to load"); bpo::options_description app_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; + auto witness_plug = node.register_plugin(); auto history_plug = node.register_plugin(); auto market_history_plug = node.register_plugin(); @@ -157,6 +159,7 @@ int main( int argc, char** argv ) node.startup(); 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); diff --git a/programs/cli_wallet/main.cpp b/programs/cli_wallet/main.cpp index 8c78ba50..65b1cbc1 100644 --- a/programs/cli_wallet/main.cpp +++ b/programs/cli_wallet/main.cpp @@ -110,6 +110,8 @@ int main( int argc, char** argv ) idump( (key_to_wif( genesis_private_key ) ) ); 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 ) ) ); //