From 10a193e25031717297ea19ca9d44fe1725a555d2 Mon Sep 17 00:00:00 2001 From: Silence <35656692+silence48@users.noreply.github.com> Date: Mon, 5 Dec 2022 22:02:45 -0500 Subject: [PATCH 1/6] add link to additional docs for error handling Everywhere else that an 'encyclopedia' entry is referenced, it is a link. this updates the 'error handling encyclopedia' reference to also be a link. --- docs/issuing-assets/control-asset-access.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/issuing-assets/control-asset-access.mdx b/docs/issuing-assets/control-asset-access.mdx index 5319e03ae..d19bbd6cc 100644 --- a/docs/issuing-assets/control-asset-access.mdx +++ b/docs/issuing-assets/control-asset-access.mdx @@ -111,7 +111,7 @@ The authorization sandwich allows the issuer to inspect the specific payment and ### Sample code -In the following code samples, proper error checking is omitted. However, you should always validate your results, as there are many ways that requests can fail. Refer to the Error Handling Encyclopedia Entry for tips on error management strategies. +In the following code samples, proper error checking is omitted. However, you should always validate your results, as there are many ways that requests can fail. Refer to the [Error Handling Encyclopedia Entry](../encyclopedia/error-handling) for tips on error management strategies. The following example sets authorization to be both required and revocable: From 33493fc15cd40d9ce2d47bf1043a81166f7d6cc3 Mon Sep 17 00:00:00 2001 From: Silence <35656692+silence48@users.noreply.github.com> Date: Mon, 5 Dec 2022 22:14:13 -0500 Subject: [PATCH 2/6] add link to discord Added an invite to the developers discord, adjacent to the invite to keybase, since the discord server is used more frequently now for discussion. --- docs/run-core-node/configuring.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/run-core-node/configuring.mdx b/docs/run-core-node/configuring.mdx index 928391378..015b52ac4 100644 --- a/docs/run-core-node/configuring.mdx +++ b/docs/run-core-node/configuring.mdx @@ -219,7 +219,7 @@ Without those settings, your validator depends on other nodes on the network to ### Updating and Coordinating Your Quorum Set -When you join the ranks of node operators, it's also important to join the conversation. The best way to do that: get on the #validators channel on the [Stellar Keybase](https://keybase.io/team/stellar.public) and sign up for the [validators google group](https://groups.google.com/forum/#!forum/stellar-validators). That way, you can and coordinate changes with the rest of the network. +When you join the ranks of node operators, it's also important to join the conversation. The best way to do that: get on the #validators channel on the [Stellar Keybase](https://keybase.io/team/stellar.public) and sign up for the [validators google group](https://groups.google.com/forum/#!forum/stellar-validators); You can also join the #validators channel on our [Developer Discord](https://discord.gg/stellardev). That way, you can and coordinate changes with the rest of the network. When you need to make changes to your validator or to your quorum set — say you take a validator down for maintenance or add new validators to your node's quorum set — it's crucial to stage the changes to preserve quorum intersection and general good health of the network: From 684cea46a27323e3a0ec808d2cf32b356f9802a4 Mon Sep 17 00:00:00 2001 From: Silence <35656692+silence48@users.noreply.github.com> Date: Mon, 5 Dec 2022 22:45:02 -0500 Subject: [PATCH 3/6] Add js example to create account using stellar-sdk As this only had a code example for using friendbot, I wanted to add an example for creating an account programmatically using a funded account. --- docs/tutorials/create-account.mdx | 36 ++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/docs/tutorials/create-account.mdx b/docs/tutorials/create-account.mdx index 36119872a..7e8b467f5 100644 --- a/docs/tutorials/create-account.mdx +++ b/docs/tutorials/create-account.mdx @@ -107,7 +107,41 @@ To do that, send Friendbot the public key you created. It’ll create and fund a console.log("SUCCESS! You have a new account :)\n", responseJSON); } catch (e) { console.error("ERROR!", e); - } + }; +// After you've got your test lumens from friendbot, we can also use that account to create a new account on the ledger. + try { + var parentAccount = await server.loadAccount(pair.publicKey()); //make sure the parent account exists on ledger + var childAccount = StellarSdk.Keypair.random(); //generate a random account to create +//create a transacion object. + var createAccountTx = new StellarSdk.TransactionBuilder(parentAccount,{ + fee: StellarSdk.BASE_FEE, + networkPassphrase: StellarSdk.Networks.TESTNET, + }); +//add the create account operation to the createAccountTx transaction. + createAccountTx = await mytransaction.addOperation( + StellarSdk.Operation.createAccount({ + destination: childAccount.publicKey(), + startingBalance: "5", + })) + .setTimeout(180) + .build(); +//sign the transaction with the account that was created from friendbot. + await createAccountTx.sign(pair); +//submit the transaction + let txResponse = await server.submitTransaction(createAccountTx) +// some simple error handling + .catch(function(error){ + console.log('there was an error'); + console.log(error.response); + console.log(error.status); + console.log(error.extras); + return error + }); + console.log(txResponse); + console.log("Created the new account", childAccount.publicKey()); + } catch(e) { + console.error("ERROR!", e); + } })(); ``` From 5c98ded48152a3fe651cad66f3bc93264794c21e Mon Sep 17 00:00:00 2001 From: = <35656692+silence48@users.noreply.github.com> Date: Tue, 6 Dec 2022 09:46:14 -0500 Subject: [PATCH 4/6] fix code examples to pass gh actions --- .../stellar-data-structures/assets.mdx | 2 +- docs/tutorials/create-account.mdx | 63 ++++++++++--------- .../moneygram-access-integration-guide.mdx | 4 +- 3 files changed, 36 insertions(+), 33 deletions(-) diff --git a/docs/fundamentals-and-concepts/stellar-data-structures/assets.mdx b/docs/fundamentals-and-concepts/stellar-data-structures/assets.mdx index 7bad62ecf..22d5fc31a 100644 --- a/docs/fundamentals-and-concepts/stellar-data-structures/assets.mdx +++ b/docs/fundamentals-and-concepts/stellar-data-structures/assets.mdx @@ -13,7 +13,7 @@ Assets on Stellar have two identifying characteristics: the asset code and the i ### Asset code -An asset’s identifying code. There are three different formats: Alphanumeric 4, Alphanumeric 12, and liquidity pool shares. +An asset’s identifying code. There are three different formats: Alphanumeric 4, Alphanumeric 12, and liquidity pool shares. Learn about liquidity pool shares in the [Liquidity Pool Encyclopedia Entry](../../encyclopedia/liquidity-on-stellar-sdex-liquidity-pools). diff --git a/docs/tutorials/create-account.mdx b/docs/tutorials/create-account.mdx index 7e8b467f5..8280537b9 100644 --- a/docs/tutorials/create-account.mdx +++ b/docs/tutorials/create-account.mdx @@ -107,41 +107,44 @@ To do that, send Friendbot the public key you created. It’ll create and fund a console.log("SUCCESS! You have a new account :)\n", responseJSON); } catch (e) { console.error("ERROR!", e); - }; -// After you've got your test lumens from friendbot, we can also use that account to create a new account on the ledger. + } + // After you've got your test lumens from friendbot, we can also use that account to create a new account on the ledger. try { var parentAccount = await server.loadAccount(pair.publicKey()); //make sure the parent account exists on ledger var childAccount = StellarSdk.Keypair.random(); //generate a random account to create -//create a transacion object. - var createAccountTx = new StellarSdk.TransactionBuilder(parentAccount,{ - fee: StellarSdk.BASE_FEE, - networkPassphrase: StellarSdk.Networks.TESTNET, - }); -//add the create account operation to the createAccountTx transaction. - createAccountTx = await mytransaction.addOperation( - StellarSdk.Operation.createAccount({ - destination: childAccount.publicKey(), - startingBalance: "5", - })) - .setTimeout(180) - .build(); -//sign the transaction with the account that was created from friendbot. + //create a transacion object. + var createAccountTx = new StellarSdk.TransactionBuilder(parentAccount, { + fee: StellarSdk.BASE_FEE, + networkPassphrase: StellarSdk.Networks.TESTNET, + }); + //add the create account operation to the createAccountTx transaction. + createAccountTx = await mytransaction + .addOperation( + StellarSdk.Operation.createAccount({ + destination: childAccount.publicKey(), + startingBalance: "5", + }), + ) + .setTimeout(180) + .build(); + //sign the transaction with the account that was created from friendbot. await createAccountTx.sign(pair); -//submit the transaction - let txResponse = await server.submitTransaction(createAccountTx) -// some simple error handling - .catch(function(error){ - console.log('there was an error'); - console.log(error.response); - console.log(error.status); - console.log(error.extras); - return error - }); + //submit the transaction + let txResponse = await server + .submitTransaction(createAccountTx) + // some simple error handling + .catch(function (error) { + console.log("there was an error"); + console.log(error.response); + console.log(error.status); + console.log(error.extras); + return error; + }); console.log(txResponse); - console.log("Created the new account", childAccount.publicKey()); - } catch(e) { - console.error("ERROR!", e); - } + console.log("Created the new account", childAccount.publicKey()); + } catch (e) { + console.error("ERROR!", e); + } })(); ``` diff --git a/docs/tutorials/moneygram-access-integration-guide.mdx b/docs/tutorials/moneygram-access-integration-guide.mdx index e299b24dd..0368f7f01 100644 --- a/docs/tutorials/moneygram-access-integration-guide.mdx +++ b/docs/tutorials/moneygram-access-integration-guide.mdx @@ -175,7 +175,7 @@ This section encompasses steps 3 & 4 of the architecture diagram displayed above For the purpose of this guide, we will go through the withdrawal case. -*Note*: MoneyGram requires the `amount` field in requests for both deposit & withdraw transactions if your application is custodial. +_Note_: MoneyGram requires the `amount` field in requests for both deposit & withdraw transactions if your application is custodial. You will need the following pieces of information: @@ -212,7 +212,7 @@ def initiate_withdraw(token: str, amount: str) -> Tuple[str, str]: -The logic for initiating a deposit transaction looks very similar. See the [SEP-24][sep-24] standard specification for detailed information. +The logic for initiating a deposit transaction looks very similar. See the [SEP-24][sep-24] standard specification for detailed information. The `&callback=postmessage` query parameter added to the returned URL is critical; it informs MoneyGram that the application’s client would like to be notified when the user has completed the MGI experience and has requested to close the window. We’ll cover this in more detail in the subsequent section. From ab76ccebed518b53a75a57a9d2b5be6a5f3e14ba Mon Sep 17 00:00:00 2001 From: = <35656692+silence48@users.noreply.github.com> Date: Tue, 6 Dec 2022 10:13:16 -0500 Subject: [PATCH 5/6] fix create account js example --- docs/tutorials/create-account.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/tutorials/create-account.mdx b/docs/tutorials/create-account.mdx index 8280537b9..40e712c47 100644 --- a/docs/tutorials/create-account.mdx +++ b/docs/tutorials/create-account.mdx @@ -110,6 +110,7 @@ To do that, send Friendbot the public key you created. It’ll create and fund a } // After you've got your test lumens from friendbot, we can also use that account to create a new account on the ledger. try { + const server = new StellarSdk.Server("https://horizon-testnet.stellar.org"); var parentAccount = await server.loadAccount(pair.publicKey()); //make sure the parent account exists on ledger var childAccount = StellarSdk.Keypair.random(); //generate a random account to create //create a transacion object. @@ -118,7 +119,7 @@ To do that, send Friendbot the public key you created. It’ll create and fund a networkPassphrase: StellarSdk.Networks.TESTNET, }); //add the create account operation to the createAccountTx transaction. - createAccountTx = await mytransaction + createAccountTx = await createAccountTx .addOperation( StellarSdk.Operation.createAccount({ destination: childAccount.publicKey(), From df9f921500638a950f0628729e0f1e789671be51 Mon Sep 17 00:00:00 2001 From: Bri <92327786+briwylde08@users.noreply.github.com> Date: Fri, 9 Dec 2022 12:52:30 -0700 Subject: [PATCH 6/6] Changed wording --- docs/run-core-node/configuring.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/run-core-node/configuring.mdx b/docs/run-core-node/configuring.mdx index 015b52ac4..d6cafc9c8 100644 --- a/docs/run-core-node/configuring.mdx +++ b/docs/run-core-node/configuring.mdx @@ -219,7 +219,7 @@ Without those settings, your validator depends on other nodes on the network to ### Updating and Coordinating Your Quorum Set -When you join the ranks of node operators, it's also important to join the conversation. The best way to do that: get on the #validators channel on the [Stellar Keybase](https://keybase.io/team/stellar.public) and sign up for the [validators google group](https://groups.google.com/forum/#!forum/stellar-validators); You can also join the #validators channel on our [Developer Discord](https://discord.gg/stellardev). That way, you can and coordinate changes with the rest of the network. +When you join the ranks of node operators, it's also important to join the conversation. The best way to do that: get on the #validators channel on the [Stellar Keybase](https://keybase.io/team/stellar.public) and sign up for the [Stellar Validators Google Group](https://groups.google.com/forum/#!forum/stellar-validators); You can also join the #validators channel on our [Developer Discord](https://discord.gg/stellardev). That way, you can and coordinate changes with the rest of the network. When you need to make changes to your validator or to your quorum set — say you take a validator down for maintenance or add new validators to your node's quorum set — it's crucial to stage the changes to preserve quorum intersection and general good health of the network: