-
Notifications
You must be signed in to change notification settings - Fork 297
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
Docs unclear, error when creating an account #115
Comments
@rizkysyazuli - Agree, the docs in the page aren't super clear. You can put all of them into a single file like you have seem to done. There is one caveat though. The second and third snippets are both asynchronous. The second snippet makes an API call to fund an account (and activate it), and only after that is successful, should you be executing the third snippet to get the account details. In your case, since you've pasted all the snippets as they are, in order, your third snippet is executed even before the api call in the second snippet returns. So, it is not able to find the account details you're looking for and that fails with a NotFoundError. Since this is also a promise, and it doesn't have the catch block you see the error This is the correct way to use the snippets from the documentation:
|
Also to answer the other part of your question on where do you run this. You can run this either in the terminal using node, like you've done or in the browser. If you were to run in the browser though, just make sure you have a way to get the dependencies available in the browser (stellar-sdk and request npm modules). |
got it! @therealsanmah. i'll try the tutorial again. |
Is it possible to extend this code to make a transaction to another account? |
Yeah,the docs are bad!I failed many times! |
Wait a minute!I paste @therealsanmah's code in the nodejs console and run it,but it still failed! The stellar official has change the API???Why does it failed to create accounts?? |
Docs are really confusing about creating an account I tried friendbot hosted here https://horizon-testnet.stellar.org/friendbot and it doesn't work. I tried dockerize testnet hosted on my machine and it gives me error. Friendbot is disabled |
I fixed friendbot URL in stellar-deprecated/docs@bdb8ea7 (changes will be visible at stellar.org/developers in no more than 30 minutes from now). |
Is that a friendbot for testnet? |
Oh,I got it.The previous friendbot url is valid.We have to use the new url:https://friendbot.stellar.org |
Agree - the docs don't make it clear that Anyway, even after I called
|
Where can we go to suggest a PR to improve the docs? I'm working through them currently building out may app and I've run into a few snags that could be made clearer. Also, I've seen some typos that and code errors that could easily be fixed. Since I'm working through them it would be an ideal time for me to help add to them. |
Hey @MeKyleH, we always gladly accept doc improvement PR's and suggestions! The repo for https://www.stellar.org/developers/guides/ is here: https://www.stellar.org/developers/guides/ The repo for https://www.stellar.org/developers/reference/ is here: https://github.com/stellar/go/tree/master/services/horizon/internal/docs/reference Let me know if you have any issues finding things. |
@robertDurst I specifically found an issue with the code sample on this page: https://stellar.github.io/js-stellar-sdk/TransactionBuilder.html Currently, it has:
but it should be:
Both of the inline comment lines need an additional closing paren and the amount line needs a comma added. I couldn't find where to go to fix this. |
We use jsdoc to generate the documentation, so the particular section you are interested in is a comment within the transaction builder file in Here is what you are looking for: https://github.com/stellar/js-stellar-base/blob/master/src/transaction_builder.js#L18 |
Rewrite the JS examples for creating an account with await so people can paste all the code into a console and run it without having to deal with async code. Fixes stellar/js-stellar-sdk#115.
- Add `Transaction.prototype.addSignature(publicKey: string, signature: string)` and `Transaction.prototype.getKeypairSIgnature(keypair: Keypair)` to allow, for example, parties to pre-sign their part of multi-signature transactions (fixes #109) - Fix syntax errors in the TransactionBuilder example code (fixes stellar/js-stellar-sdk#115)
I got an error from the very beginning. The code snippets in your "Create an Account" is very unclear.
Are they supposed to be inside a single or a separate files? (i pasted everything into one file)
Are they run from the browser or via Terminal? (i run it using Node from Terminal)
Anyway, here's the response that i get:
The text was updated successfully, but these errors were encountered: