From 750184c13046b831042f590c2b1cee3d0c3ddfc7 Mon Sep 17 00:00:00 2001 From: clemahieu Date: Sun, 30 Nov 2014 11:49:52 -0600 Subject: [PATCH] Adding utillity functions and beta genesis keys. --- rai/cli/entry.cpp | 13 ++++++++++++- rai/secure.cpp | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/rai/cli/entry.cpp b/rai/cli/entry.cpp index 549309d6..f8d913ee 100644 --- a/rai/cli/entry.cpp +++ b/rai/cli/entry.cpp @@ -107,6 +107,7 @@ int main (int argc, char * const * argv) ("debug_activity", "Generates fake debug activity") ("profile_work", "Profile the work function") ("generate_key", "Generates a random keypair") + ("get_account", boost::program_options::value (), "Get base58check encoded account from public key") ("xorshift_profile", "Profile xorshift algorithms") ("verify_profile", "Profile signature verification"); boost::program_options::variables_map vm; @@ -128,7 +129,17 @@ int main (int argc, char * const * argv) else if (vm.count ("generate_key")) { rai::keypair pair; - std::cout << "Private: " << pair.prv.to_string () << " Public: " << pair.pub.to_string () << std::endl; + std::string account; + pair.pub.encode_base58check (account); + std::cout << "Private: " << pair.prv.to_string () << std::endl << "Public: " << pair.pub.to_string () << std::endl << "Account: " << account << std::endl; + } + else if (vm.count ("get_account")) + { + rai::uint256_union pub; + pub.decode_hex (vm ["get_account"].as ()); + std::string account; + pub.encode_base58check (account); + std::cout << "Account: " << account << std::endl; } else if (vm.count ("profile_work")) { diff --git a/rai/secure.cpp b/rai/secure.cpp index 2d79efb0..ca03a7d4 100644 --- a/rai/secure.cpp +++ b/rai/secure.cpp @@ -9,7 +9,7 @@ namespace { std::string rai_test_private_key = "34F0A37AAD20F4A260F0A5B3CB3D7FB50673212263E58A380BC10474BB039CE4"; std::string rai_test_public_key = "B241CC17B3684D22F304C7AF063D1B833124F7F1A4DAD07E6DA60D7D8F334911"; // U63Kt3B7yp2iQB4GsVWriGv34kk2qwhT7acKvn8yWZGdNVesJ8 - std::string rai_beta_public_key = "0"; + std::string rai_beta_public_key = "1A99D99731BC08252C8762FBB2CBB7BA3520039109FCE869C75406E722C636E3"; // TV67A7XWyLF7njTjTZC9zQ4iLftsVDRQUDmW7LieZzqZm2gMnz std::string rai_live_public_key = "0"; }