Create Account BadRequest
See original GitHub issueHi,
any idea why this doesn’t work? The documentation on creating accounts seems to use different values for the PublicKey
depending on the SDK.
public class Crypto
{
public static void Main ()
{
KeyPair keyPair = CreateKeyPair();
CreateAccount(keyPair);
}
private static string CreateAccount(KeyPair keyPair)
{
HttpClient client = new HttpClient();
var publicKey = Convert.ToBase64String(keyPair.PublicKey);
var response = client.GetAsync($"https://horizon-testnet.stellar.org/friendbot?addr={publicKey}");
Task.WaitAll(response);
var account = response.Result;
return account.Content.ToString();
}
public static KeyPair CreateKeyPair()
{
KeyPair keypair = KeyPair.Random();
return keypair;
}
}
}
I receive an Error 400 “Bad Request” when GETting this.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8
Top Results From Across the Web
Azure AD Create User Bad Request
I have created a flow to automate new hire processes, with the main part being the "Create User" from Azure AD.
Read more >Getting a "Bad Request" Message for signup and sign in
The sign up route for the website I'm working on isn't working fine. I get this once I click on sign up it...
Read more >How to Fix a 400 Bad Request Error (Causes and Fixes)
The 400 Bad Request error indicates that the server cannot or process the request due to a client error. Read about the common...
Read more >Solved: Re: Create User API giving 400 Bad Request Error
Hello, all, I am trying to create a new user using the "Create User" API. I'm sending the following and getting a 400...
Read more >Bad Request when creating a user without password #30241
A Bad Request occures. The error comes from UserManager which does not have a valid password for the account. It is because the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
David,
No, I do not think you are. It appears friendbot sometimes returns a tx_bad_seq and they are working on a fix. https://github.com/stellar/go/issues/134
That being said try using this code. It will work most of the time and should work all the time once Stellar implements the fix for friendbot.
That being said me and Eric are thinking about adding extra support for testnet specifically friendbot into the SDK so you don’t have to create the httpClient call manually.
Hope this helps.
Oops I was mistaken, the first server instantiation in needed as well, because we use it later to get our account info after friendbot gives us money. However we could just probably use just one server over again, like I said quick code.