2

I want to create a stellar application which will have these functionality

  • Account creation
  • XLM Balance checking
  • Doing Transaction
  • XLM Receive notification

I have read stellar documenation https://www.stellar.org/developers/

Based on that i have generated keys:

var pair = StellarSdk.Keypair.random();
pair.secret();
pair.publicKey();

And to create account i hit this url in browser

https://friendbot.stellar.org?addr=XXXXXXXXXXXXXXXXXX

How can i create a account in livenet without installing stellar-core

I did't find any livenet endpoint in stellar docs

4

To create accounts you create a transaction containing a createAccount operation.

https://www.stellar.org/developers/guides/concepts/list-of-operations.html#create-account

Friendbot is only there to give you an initial sum of testnet XLMs. Nothing else.

  • I have used this code to create account :` StellarSdk.Keypair.random(); pair.secret(); pair.publicKey();` . If i make transaction without hitting https://friendbot.stellar.org?addr=XXXXXXXXXXXXXXXXXX url gives a 404 and Resource Missing exception – Zinc Aug 11 '18 at 14:51
  • Keypair.random() only generates a keypair for you. To be able to use the account, it has to be registered on the ledger, and that's what the createAccount operation does. – Johan Stén Aug 11 '18 at 14:54
  • Thanks for the link. This means I need a account (which have funds) to create a new account. :( – Zinc Aug 11 '18 at 15:09
  • That's right. An account can't exist without a minimum balance. And you can't create that minimum balance out of thin air, someone has to give it to you by way of a CreateAccount operation. – Synesso Aug 12 '18 at 7:26
1

You don't need to directly access Stellar Core, if you just want the above functionalities.

Use the livenet Horizon endpoint would be sufficient:

https://horizon.stellar.org/

For pre-built UI version, use the Laboratory: https://www.stellar.org/laboratory/


To see JS example code for your target actions, refer to https://www.stellar.org/developers/js-stellar-base/reference/base-examples.html

NOTE: StellarSdk.Network.useTestNetwork(); is for TESTNET, so you need to change it to something like StellarSdk.Network.usePublicNetwork();

p.s. I'd recommend trying first with testnet and observe if your calls match with the expected behaviour first.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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