0

I have been successfully creating accounts for months before the reset but I am now running into a problem and not clear what the actual problem is.

I am executing the following code:

final KeyPair newAccountKeyPair = KeyPair.random(); final KeyPair sourceKeyPair = KeyPair.fromSecretSeed(seed); final String secret = new String(newAccountKeyPair.getSecretSeed()); final AccountResponse sourceAccount = server.accounts().account(sourceKeyPair.getAccountId());

        final Transaction transaction = new Transaction.Builder(sourceAccount, network)
                .addOperation(new CreateAccountOperation.Builder(newAccountKeyPair.getAccountId(), startingBalance)
                        .build())
                .addMemo(Memo.text("CreateAccount Tx"))
                .setTimeout(STELLAR_TIMEOUT_IN_SECONDS)
                .setBaseFee(STELLAR_BASE_FEE).build();

        transaction.sign(sourceKeyPair);

        final SubmitTransactionResponse submitTransactionResponse = server.submitTransaction(transaction);

The reponse from the server: org.stellar.sdk.requests.ErrorResponse: Error response from the server. at org.stellar.sdk.requests.ResponseHandler.handleResponse(ResponseHandler.java:39) at org.stellar.sdk.requests.AccountsRequestBuilder.account(AccountsRequestBuilder.java:38) at org.stellar.sdk.requests.AccountsRequestBuilder.account(AccountsRequestBuilder.java:49)

I have ensured that I am on the latest version of the Java SDK (0.19.0). I have searched on the web and have not found any joy. What can I do to resolve this error?

Thank You! Aubrey

1
  • An update to my question: I ran a debugger and the line that causes the problem is the last line in the code below: final KeyPair newAccountKeyPair = KeyPair.random(); final KeyPair sourceKeyPair = KeyPair.fromSecretSeed(seed); final String secret = new String(newAccountKeyPair.getSecretSeed()); final AccountResponse sourceAccount = server.accounts().account(sourceKeyPair.getAccountId()); Commented Oct 30, 2020 at 17:10

1 Answer 1

1

I resolved the problem. It turns out that I was using a seed from pre-reset days. I obtained a new seed from Stellar Lab and everything's back to normal. Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.