Please help me creating a new account in a private Stellar network. The existing documentation is surprisingly confusing to follow!
There is zero documentation in the javadoc of the Java SDK to create an account. The example mentioned claims that the SDK does not support test network. This is surprising! Given that, all requests route to the Horizon server as HTTP requests, why should it matter whether one connects to a test, main or private network? Sure, there is the friendly bot; but, the bot should be used only for funding not for account creation.
Then, the example mentions that, "you will have to make your own HTTP request". ok, where are the details - endpoint, body, parameters, etc.? Also, it is not clear, if the request made is a POST
as a new resource is to be added as an account in the network.
Moving on to the REST API reference. Do I have to build the payload with an id, links to previous and successor just so that I can create an account? I don't recall coming across such an interface to create a new resource. At best, the HTTP POST verb should use the following payload at an end-point as /accounts
{
"account": "GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ",
"funder": "GBIA4FH6TV64KSPDAJCNUQSM7PFL4ILGUVJDPCLUOPJ7ONMKBBVUQHRO",
"starting_balance": "10000.0",
}
and respond with a JSON somewhat like this.
{"transactionId" : "9430630328265928"}
Javadoc: https://stellar.github.io/java-stellar-sdk/
Example in SDK: https://www.stellar.org/developers/guides/get-started/create-account.html
REST API: https://www.stellar.org/developers/horizon/reference/resources/operation.html#create-account