Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_keys - no need to start the engine #1

Open
DaveAppleton opened this issue Dec 5, 2014 · 0 comments
Open

create_keys - no need to start the engine #1

DaveAppleton opened this issue Dec 5, 2014 · 0 comments

Comments

@DaveAppleton
Copy link

Daves-MacBook-Pro:build daveappleton$ sudo ./stellard --conf stellar.cfg -a create_keys
Loading: "stellar.cfg"
Connecting to: 127.0.0.1:5005
{
"error" : "internal",
"error_code" : 62,
"error_message" : "Internal error.",
"error_what" : "no response from server"
}

  • actually you do not need to start the engine to create keys.

  • the code below works in main()

    int iResult = 0;
    RippleAddress naSeed;
    std::cout << "Dave's Hacked Version" << std::endl;
    if (! RandomNumbers::getInstance ().initialize ()) {
    std::cout << "Unable to add system entropy" << std::endl ;
    return -1;
    }
    // next bit is from my implementation - you will need to get the passphrase
    if (argc < 2)
    naSeed.setSeedRandom ();
    else
    if (!naSeed.setSeedGeneric (argv[1])) {
    std::cout << "Bad passphrase" << std::endl;
    return -1;
    }
    RippleAddress naAccount = RippleAddress::createAccountPublic(naSeed);
    Json::Value obj (Json::objectValue);
    obj["master_seed"] = naSeed.humanSeed ();
    obj["account_id"] = naAccount.humanAccountID ();
    obj["public_key"] = naAccount.humanAccountPublic();

    //obj["master_seed_hex"] = to_string (naSeed.getSeed ());
    //auto acct = naAccount.getAccountPublic();
    //obj["public_key_hex"] = strHex(acct.begin(), acct.size());

    std::cout << "account ID : " << obj["account_id"]<< std::endl;
    std::cout << "private key : " << obj["master_seed"]<< std::endl;
    std::cout << "public key : " << obj["public_key"]<< std::endl;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant