Skip to content

Commit

Permalink
A couple small updates (#65)
Browse files Browse the repository at this point in the history
* 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.

* 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.

* 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.

* fix code examples to pass gh actions

* fix create account js example

* Changed wording

Co-authored-by: Bri <[email protected]>
  • Loading branch information
2 people authored and kalepail committed Dec 10, 2022
1 parent fb29cac commit 45e031c
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
2 changes: 1 addition & 1 deletion docs/issuing-assets/control-asset-access.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion docs/run-core-node/configuring.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 [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:

Expand Down
38 changes: 38 additions & 0 deletions docs/tutorials/create-account.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,44 @@ To do that, send Friendbot the public key you created. It’ll create and fund a
} 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 {
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.
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 createAccountTx
.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);
}
})();
```

Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/moneygram-access-integration-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -212,7 +212,7 @@ def initiate_withdraw(token: str, amount: str) -> Tuple[str, str]:

</CodeExample>

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.

Expand Down

0 comments on commit 45e031c

Please sign in to comment.