diff --git a/libraries/wallet/include/graphene/wallet/wallet.hpp b/libraries/wallet/include/graphene/wallet/wallet.hpp index 952b1b33..0f13146f 100644 --- a/libraries/wallet/include/graphene/wallet/wallet.hpp +++ b/libraries/wallet/include/graphene/wallet/wallet.hpp @@ -274,6 +274,10 @@ class wallet_api fc::ecc::private_key derive_private_key(const std::string& prefix_string, int sequence_number) const; variant info(); + /** Returns info such as client version, git version of graphene/fc, version of boost, openssl. + * @returns compile time info and client and dependencies versions + */ + variant_object about() const; optional get_block( uint32_t num ); /** Returns the number of accounts registered on the blockchain * @returns the number of registered accounts @@ -1462,6 +1466,7 @@ FC_API( graphene::wallet::wallet_api, (help) (gethelp) (info) + (about) (begin_builder_transaction) (add_operation_to_builder_transaction) (replace_operation_in_builder_transaction) diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index 3858f4c1..bb8e989e 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -27,6 +27,10 @@ #include #include +#include +#include +#include + #include #include #include @@ -41,6 +45,7 @@ #include #include +#include #include #include #include @@ -55,6 +60,7 @@ #include #include #include +#include #include #include #include @@ -506,6 +512,41 @@ public: result["active_committee_members"] = global_props.active_committee_members; return result; } + + variant_object about() const + { + string client_version( graphene::utilities::git_revision_description ); + const size_t pos = client_version.find( '/' ); + if( pos != string::npos && client_version.size() > pos ) + client_version = client_version.substr( pos + 1 ); + + fc::mutable_variant_object result; + //result["blockchain_name"] = BLOCKCHAIN_NAME; + //result["blockchain_description"] = BTS_BLOCKCHAIN_DESCRIPTION; + result["client_version"] = client_version; + result["graphene_revision"] = graphene::utilities::git_revision_sha; + result["graphene_revision_age"] = fc::get_approximate_relative_time_string( fc::time_point_sec( graphene::utilities::git_revision_unix_timestamp ) ); + result["fc_revision"] = fc::git_revision_sha; + result["fc_revision_age"] = fc::get_approximate_relative_time_string( fc::time_point_sec( fc::git_revision_unix_timestamp ) ); + result["compile_date"] = "compiled on " __DATE__ " at " __TIME__; + result["boost_version"] = boost::replace_all_copy(std::string(BOOST_LIB_VERSION), "_", "."); + result["openssl_version"] = OPENSSL_VERSION_TEXT; + + std::string bitness = boost::lexical_cast(8 * sizeof(int*)) + "-bit"; +#if defined(__APPLE__) + std::string os = "osx"; +#elif defined(__linux__) + std::string os = "linux"; +#elif defined(_MSC_VER) + std::string os = "win32"; +#else + std::string os = "other"; +#endif + result["build"] = os + " " + bitness; + + return result; + } + chain_property_object get_chain_properties() const { return _remote_db->get_chain_properties(); @@ -2866,6 +2907,11 @@ variant wallet_api::info() return my->info(); } +variant_object wallet_api::about() const +{ + return my->about(); +} + fc::ecc::private_key wallet_api::derive_private_key(const std::string& prefix_string, int sequence_number) const { return detail::derive_private_key( prefix_string, sequence_number );