mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-04 11:55:50 +00:00
Apply suggestions from code review
Co-authored-by: Maria Shodunke <maria-robobug@users.noreply.github.com> Co-authored-by: oeggert <117319296+oeggert@users.noreply.github.com>
This commit is contained in:
@@ -8,4 +8,4 @@ For more context, see the Get Started tutorial for your preferred language:
|
||||
- [Java](https://xrpl.org/get-started-using-java.html)
|
||||
- [JavaScript](https://xrpl.org/get-started-using-javascript.html)
|
||||
- [PHP](https://xrpl.org/get-started-using-php.html)
|
||||
- [GoLang](https://xrpl.org/get-started-using-golang.html)
|
||||
- [Go](https://xrpl.org/get-started-using-go.html)
|
||||
|
||||
@@ -7,7 +7,10 @@ import (
|
||||
|
||||
func main() {
|
||||
// Define the network client configuration
|
||||
cfg, err := rpc.NewClientConfig("https://s.altnet.rippletest.net:51234/")
|
||||
cfg, err := rpc.NewClientConfig(
|
||||
"https://s.altnet.rippletest.net:51234/",
|
||||
rpc.WithFaucetProvider(faucet.NewTestnetFaucetProvider()),
|
||||
)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@@ -9,8 +9,10 @@ import (
|
||||
func main() {
|
||||
|
||||
// Define the network client
|
||||
client := websocket.NewClient(websocket.NewClientConfig().
|
||||
WithHost("wss://s.altnet.rippletest.net:51233"))
|
||||
client := websocket.NewClient(websocket.NewClientConfig().
|
||||
WithHost("wss://s.altnet.rippletest.net:51233").
|
||||
WithFaucetProvider(faucet.NewTestnetFaucetProvider()),
|
||||
)
|
||||
|
||||
// Disconnect the client when done. (Defer executes at the end of the function)
|
||||
defer client.Disconnect()
|
||||
|
||||
@@ -337,17 +337,7 @@ export default function Docs() {
|
||||
<div className="col langs">
|
||||
<Link to="/docs/tutorials/go/">
|
||||
<img
|
||||
alt="GoLang Logo"
|
||||
src={require("../static/img/logos/golang.svg")}
|
||||
className="circled-logo"
|
||||
/>
|
||||
<h5 className="btn-arrow">{translate("GoLang")}</h5>
|
||||
</Link>
|
||||
</div>
|
||||
<div className="col langs">
|
||||
<Link to="/docs/tutorials/go/">
|
||||
<img
|
||||
alt="GoLang Logo"
|
||||
alt="Go Logo"
|
||||
src={require("../static/img/logos/golang.svg")}
|
||||
className="circled-logo"
|
||||
/>
|
||||
|
||||
@@ -14,7 +14,7 @@ These client libraries simplify some of the common work of accessing and process
|
||||
| Language | Library Name | Get Started | API Reference | Source Code |
|
||||
|---------------------------------|---------------------------|-------------|--------------|-------------|
|
||||
| **Python** | `xrpl-py` | [Get Started Using Python](../tutorials/python/build-apps/get-started.md) | [API Reference](https://xrpl-py.readthedocs.io/) | [Repo](https://github.com/XRPLF/xrpl-py) |
|
||||
| **GoLang** | `xrpl-go` | [Get Started Using Go](../tutorials/go/build-apps/get-started.md) | [API Reference](https://pkg.go.dev/github.com/Peersyst/xrpl-go) | [Repo](https://github.com/Peersyst/xrpl-go) |
|
||||
| **Go** | `xrpl-go` | [Get Started Using Go](../tutorials/go/build-apps/get-started.md) | [API Reference](https://pkg.go.dev/github.com/Peersyst/xrpl-go) | [Repo](https://github.com/Peersyst/xrpl-go) |
|
||||
| **JavaScript** / **TypeScript** | `xrpl.js` | [Get Started](../tutorials/javascript/build-apps/get-started.md) | [API Reference](https://js.xrpl.org/) | [Repo](https://github.com/XRPLF/xrpl.js) |
|
||||
| **JavaScript** / **TypeScript** | `xrpl-client` | [Get Started](https://jsfiddle.net/WietseWind/35az6p1b/) | [NPM Reference](https://www.npmjs.com/package/xrpl-client) | [Repo](https://github.com/XRPL-Labs/xrpl-client) |
|
||||
| **JavaScript** / **TypeScript** | `xrpl-accountlib` | [Get Started](https://jsfiddle.net/WietseWind/gkefpnu0/) | [NPM Reference](https://www.npmjs.com/package/xrpl-accountlib) | [Repo](https://github.com/WietseWind/xrpl-accountlib) |
|
||||
|
||||
@@ -16,7 +16,7 @@ Use these libraries to access the XRP Ledger from your programming language of c
|
||||
|
||||
{% xrpl-card title="Python" body="xrpl.py - a pure Python library" href="https://xrpl-py.readthedocs.io/" image="/img/logos/python.svg" imageAlt="Python logo" /%}
|
||||
|
||||
{% xrpl-card title="GoLang" body="xrpl.go - a pure GoLang library" href="https://pkg.go.dev/github.com/Peersyst/xrpl-go" image="/img/logos/golang.svg" imageAlt="GoLang logo" /%}
|
||||
{% xrpl-card title="Go" body="xrpl.go - a pure Go library" href="https://pkg.go.dev/github.com/Peersyst/xrpl-go" image="/img/logos/golang.svg" imageAlt="Go logo" /%}
|
||||
|
||||
{% xrpl-card title="Java" body="xrpl4j - a pure Java library" href="https://javadoc.io/doc/org.xrpl/" image="/img/logos/java.svg" imageAlt="Java logo" /%}
|
||||
|
||||
|
||||
@@ -1,21 +1,13 @@
|
||||
---
|
||||
html: get-started-using-golang-library.html
|
||||
parent: golang.html
|
||||
funnel: Build
|
||||
doc_type: Tutorials
|
||||
category: Get Started
|
||||
seo:
|
||||
description: Build a GoLang application that interacts with the XRP Ledger.
|
||||
top_nav_name: GoLang
|
||||
top_nav_grouping: Get Started
|
||||
description: Build a Go application that interacts with the XRP Ledger.
|
||||
labels:
|
||||
- Development
|
||||
showcase_icon: assets/img/logos/golang.svg
|
||||
---
|
||||
|
||||
# Get Started Using GoLang Library
|
||||
# Get Started Using Go Library
|
||||
|
||||
This tutorial walks you through the basics of building an XRP Ledger-connected application using [`xrpl-go`](https://github.com/Peersyst/xrpl-go), a pure GoLang library built to interact with the XRP Ledger.
|
||||
This tutorial walks you through the basics of building an XRP Ledger-connected application using [`xrpl-go`](https://github.com/Peersyst/xrpl-go), a pure Go library built to interact with the XRP Ledger.
|
||||
|
||||
This tutorial is intended for beginners and should take no longer than 30 minutes to complete.
|
||||
|
||||
@@ -30,8 +22,8 @@ In this tutorial, you'll learn:
|
||||
|
||||
## Requirements
|
||||
|
||||
Requiring Go version `1.22.0` and later.
|
||||
[Download latest Go version](https://go.dev/dl/)
|
||||
To follow this tutorial, you should have Go version `1.22.0` or later installed.
|
||||
[Download latest Go version](https://go.dev/dl/).
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -53,15 +45,15 @@ When you're working with the XRP Ledger, there are a few things you'll need to m
|
||||
|
||||
Here are the basic steps you'll need to cover for almost any XRP Ledger project:
|
||||
|
||||
1. [Connect to the XRP Ledger.](#1-connect-to-the-xrp-ledger)
|
||||
1. [Get an account.](#2-get-account)
|
||||
1. [Query the XRP Ledger.](#3-query-the-xrp-ledger)
|
||||
1. [Connect to the XRP Ledger.](#1.-connect-to-the-xrp-ledger)
|
||||
2. [Get an account.](#2.-get-account)
|
||||
3. [Query the XRP Ledger.](#3.-query-the-xrp-ledger)
|
||||
|
||||
### 1. Connect to the XRP Ledger
|
||||
|
||||
To make queries and submit transactions, you need to connect to the XRP Ledger. To do this with `xrpl-go`, you have two main options:
|
||||
|
||||
1. Via `websocket`:
|
||||
1. Via WebSocket:
|
||||
```go
|
||||
// Define the network client
|
||||
client := websocket.NewClient(websocket.NewClientConfig().
|
||||
@@ -76,16 +68,9 @@ To make queries and submit transactions, you need to connect to the XRP Ledger.
|
||||
return
|
||||
}
|
||||
```
|
||||
2. Via `RPC`:
|
||||
```go
|
||||
cfg, err := rpc.NewClientConfig("https://s.altnet.rippletest.net:51234/")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
2. Via RPC:
|
||||
|
||||
// Initiate the network client
|
||||
client := rpc.NewClient(cfg)
|
||||
```
|
||||
{% code-snippet file="/_code-samples/get-started/go/base/rpc/main.go" from="func main()" language="go" /%}
|
||||
|
||||
|
||||
#### Connect to the production XRP Ledger
|
||||
@@ -95,40 +80,38 @@ The sample code in the previous section shows you how to connect to the Testnet,
|
||||
- By [installing the core server](../../../infrastructure/installation/index.md) (`rippled`) and running a node yourself. The core server connects to the Mainnet by default, but you can [change the configuration to use Testnet or Devnet](../../../infrastructure/configuration/connect-your-rippled-to-the-xrp-test-net.md). [There are good reasons to run your own core server](../../../concepts/networks-and-servers/index.md#reasons-to-run-your-own-server). If you run your own server, you can connect to it like so:
|
||||
|
||||
```go
|
||||
import "github.com/Peersyst/xrpl-go/xrpl/websocket"
|
||||
const MyServer := "ws://localhost:6006/"
|
||||
client := websocket.NewClient(websocket.NewClientConfig().WithHost(MyServer))
|
||||
```
|
||||
import "github.com/Peersyst/xrpl-go/xrpl/websocket"
|
||||
|
||||
const MY_SERVER = "ws://localhost:6006/"
|
||||
|
||||
func main() {
|
||||
client := websocket.NewClient(websocket.NewClientConfig().WithHost(MY_SERVER))
|
||||
|
||||
// ... custom code goes here
|
||||
}
|
||||
|
||||
See the example [core server config file](https://github.com/XRPLF/rippled/blob/c0a0b79d2d483b318ce1d82e526bd53df83a4a2c/cfg/rippled-example.cfg#L1562) for more information about default values.
|
||||
|
||||
- By using one of the available [public servers][]:
|
||||
|
||||
```go
|
||||
import "github.com/Peersyst/xrpl-go/xrpl/websocket"
|
||||
const PublicServer = "wss://xrplcluster.com/"
|
||||
client := websocket.NewClient(websocket.NewClientConfig().WithHost(PublicServer))
|
||||
```
|
||||
import "github.com/Peersyst/xrpl-go/xrpl/websocket"
|
||||
|
||||
const PUBLIC_SERVER = "wss://xrplcluster.com/"
|
||||
|
||||
func main() {
|
||||
client := websocket.NewClient(websocket.NewClientConfig().WithHost(PUBLIC_SERVER))
|
||||
|
||||
// ... custom code goes here
|
||||
}
|
||||
|
||||
### 2. Get account
|
||||
|
||||
In `xrpl-go`, account creation and key management live in the wallet package, and on Testnet you can use the built-in faucet provider on your WebSocket (or RPC) client to fund a brand-new account immediately.
|
||||
In `xrpl-go`, account creation and key management live in the `wallet` package, and on Testnet you can use the built-in faucet provider on your WebSocket (or RPC) client to fund a brand-new account immediately.
|
||||
|
||||
Here we spin up a Testnet‐connected WebSocket client, generate a fresh ED25519 wallet, then fund it automatically via the public faucet.
|
||||
On Testnet, you can fund a new ED25519 account like this:
|
||||
|
||||
```go
|
||||
client := websocket.NewClient(
|
||||
websocket.NewClientConfig().
|
||||
WithHost("wss://s.altnet.rippletest.net:51233").
|
||||
WithFaucetProvider(faucet.NewTestnetFaucetProvider()),
|
||||
)
|
||||
|
||||
defer client.Disconnect()
|
||||
if err := client.Connect(); err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
w, err := wallet.New(crypto.ED25519())
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
@@ -161,16 +144,18 @@ If you already have a seed encoded in [base58][], you can make a `Wallet` instan
|
||||
|
||||
You can query the XRP Ledger to get information about [a specific account](../../../references/http-websocket-apis/public-api-methods/account-methods/index.md), [a specific transaction](../../../references/http-websocket-apis/public-api-methods/transaction-methods/tx.md), the state of a [current or a historical ledger](../../../references/http-websocket-apis/public-api-methods/ledger-methods/index.md), and [the XRP Ledger's decentralized exchange](../../../references/http-websocket-apis/public-api-methods/path-and-order-book-methods/index.md). You need to make these queries, among other reasons, to look up account info to follow best practices for [reliable transaction submission](../../../concepts/transactions/reliable-transaction-submission.md).
|
||||
|
||||
You can use either the Client's `request()` method to access the XRP Ledger's [WebSocket API](../../../references/http-websocket-apis/api-conventions/request-formatting.md). For example:
|
||||
Use the Client's `Request()` method to access the XRP Ledger's [WebSocket API](../../../references/http-websocket-apis/api-conventions/request-formatting.md). For example:
|
||||
|
||||
{% code-snippet file="/_code-samples/get-tx/go/main.go" from="// Get the latest validated ledger" language="go" /%}
|
||||
|
||||
Or use the [`websocket` or `rpc` packages](https://pkg.go.dev/github.com/Peersyst/xrpl-go@v0.1.12/xrpl/websocket#Client.GetAccountChannels) getter methods:
|
||||
Or, use the getter methods from the [`websocket`](https://pkg.go.dev/github.com/Peersyst/xrpl-go@v0.1.12/xrpl/websocket) or [`rpc`](https://pkg.go.dev/github.com/Peersyst/xrpl-go@v0.1.12/xrpl/rpc) packages:
|
||||
|
||||
{% code-snippet file="/_code-samples/get-started/go/get-acc-info/ws/main.go" from="// Get info from" before="// Get info about" language="go" /%}
|
||||
|
||||
## Keep on Building
|
||||
|
||||
Now that you know how to use `xrpl.js` to connect to the XRP Ledger, get an account, and look up information about it, you can also:
|
||||
Now that you know how to use `xrpl-go` to connect to the XRP Ledger, get an account, and look up information about it, you can also:
|
||||
|
||||
- [Send XRP](../../how-tos/send-xrp.md).
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
---
|
||||
html: build-apps-in-golang.html
|
||||
parent: golang.html
|
||||
top_nav_grouping: Article Types
|
||||
metadata:
|
||||
indexPage: true
|
||||
---
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
---
|
||||
html: golang.html
|
||||
parent: tutorials.html
|
||||
top_nav_grouping: Article Types
|
||||
metadata:
|
||||
indexPage: true
|
||||
---
|
||||
|
||||
# GoLang
|
||||
# Go
|
||||
|
||||
You can create your own interface to try out the capabilities and support your specific business needs. These tutorials build a test harness interface to try out features of the XRP Ledger.
|
||||
|
||||
@@ -17,7 +14,7 @@ Typically, the example functions involve four steps.
|
||||
- Get the state of accounts and tokens on the XRP Ledger using requests.
|
||||
- Disconnect from the XRP Ledger.
|
||||
|
||||
Once familiar with the library functions, you can build sample applications in GoLang. We anticipate that the applications you build greatly improve upon these examples. Your feedback and contributions are most welcome.
|
||||
Once familiar with the library functions, you can build sample applications in Go. We anticipate that the applications you build greatly improve upon these examples. Your feedback and contributions are most welcome.
|
||||
|
||||
## Tutorial Modules
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ To interact with the XRP Ledger, you need to set up a dev environment with the n
|
||||
- **Python** with the [`xrpl-py` library](https://xrpl-py.readthedocs.io/). See [Get Started using Python](../python/build-apps/get-started.md) for setup steps.
|
||||
- **Java** with the [xrpl4j library](https://github.com/XRPLF/xrpl4j). See [Get Started Using Java](../java/build-apps/get-started.md) for setup steps.
|
||||
- **PHP** with the [XRPL_PHP library](https://github.com/AlexanderBuzz/xrpl-php). See [Get Started Using PHP](../php/build-apps/get-started.md) for setup steps.
|
||||
- **GoLang** with the [xrpl-go library](https://github.com/Peersyst/xrpl-go). See [Get Started Using GoLang](../go/build-apps/get-started.md) for setup steps.
|
||||
- **Go** with the [xrpl-go library](https://github.com/Peersyst/xrpl-go). See [Get Started Using Go](../go/build-apps/get-started.md) for setup steps.
|
||||
|
||||
## Send a Payment on the Test Net
|
||||
|
||||
@@ -54,7 +54,7 @@ To transact on the XRP Ledger, you need an address and secret key, and some XRP.
|
||||
{% code-snippet file="/_code-samples/send-xrp/php/send-xrp.php" from="// Example credentials" before="// Create" language="php" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="GoLang" %}
|
||||
{% tab label="Go" %}
|
||||
{% code-snippet file="/_code-samples/send-xrp/go/ws/main.go" from="// Example credentials" before="// Funding" language="go" /%}
|
||||
{% /tab %}
|
||||
|
||||
@@ -91,7 +91,7 @@ The following code connects to a public Testnet servers:
|
||||
{% code-snippet file="/_code-samples/send-xrp/php/send-xrp.php" from="// Create a client" before="// Transaction definition" language="php" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="GoLang" %}
|
||||
{% tab label="Go" %}
|
||||
{% code-snippet file="/_code-samples/send-xrp/go/ws/main.go" from="func main()" before="if !client.IsConnected() " language="go" /%}
|
||||
{% /tab %}
|
||||
|
||||
@@ -150,7 +150,7 @@ Here's an example of preparing the above payment:
|
||||
{% code-snippet file="/_code-samples/send-xrp/php/send-xrp.php" from="// Transaction definition" before="// Sign" language="php" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="GoLang" %}
|
||||
{% tab label="Go" %}
|
||||
{% code-snippet file="/_code-samples/send-xrp/go/ws/main.go" from="// Prepare " before="// Sign" language="go" /%}
|
||||
{% /tab %}
|
||||
|
||||
@@ -184,7 +184,7 @@ Signing a transaction uses your credentials to authorize the transaction on your
|
||||
- **Python:** Use the [`xrpl.transaction.safe_sign_transaction()` method](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.transaction.html#xrpl.transaction.safe_sign_transaction) with a model and `Wallet` object.
|
||||
- **Java:** Use a [`SignatureService`](https://javadoc.io/doc/org.xrpl/xrpl4j-crypto-core/latest/org/xrpl/xrpl4j/crypto/signing/SignatureService.html) instance to sign the transaction. For this tutorial, use the [`SingleKeySignatureService`](https://javadoc.io/doc/org.xrpl/xrpl4j-crypto-bouncycastle/latest/org/xrpl/xrpl4j/crypto/signing/SingleKeySignatureService.html).
|
||||
- **PHP:** Use a [`sign()` method of a `Wallet` instance](https://alexanderbuzz.github.io/xrpl-php-docs/wallet.html#signing-a-transaction) instance to sign the transaction. The input to this step is a completed array of transaction instructions.
|
||||
- **GoLang:** Use the [`Sign()` method of the `Wallet` package](https://pkg.go.dev/github.com/Peersyst/xrpl-go@v0.1.12/xrpl/wallet) to sign the transaction.
|
||||
- **Go:** Use the [`Sign()` method of the `Wallet` package](https://pkg.go.dev/github.com/Peersyst/xrpl-go@v0.1.12/xrpl/wallet) to sign the transaction.
|
||||
|
||||
{% tabs %}
|
||||
|
||||
@@ -204,7 +204,7 @@ Signing a transaction uses your credentials to authorize the transaction on your
|
||||
{% code-snippet file="/_code-samples/send-xrp/php/send-xrp.php" from="// Sign" before="// Submit" language="php" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="GoLang" %}
|
||||
{% tab label="Go" %}
|
||||
{% code-snippet file="/_code-samples/send-xrp/go/ws/main.go" from="// Sign" before="// Submit" language="go" /%}
|
||||
{% /tab %}
|
||||
|
||||
@@ -235,7 +235,7 @@ Now that you have a signed transaction, you can submit it to an XRP Ledger serve
|
||||
- **Python:** Use the [`xrpl.transaction.submit_and_wait()` method](https://xrpl-py.readthedocs.io/en/stable/source/xrpl.transaction.html#xrpl.transaction.submit_and_wait) to submit a transaction to the network and wait for a response.
|
||||
- **Java:** Use the [`XrplClient.submit(SignedTransaction)` method](https://javadoc.io/doc/org.xrpl/xrpl4j-client/latest/org/xrpl/xrpl4j/client/XrplClient.html#submit(org.xrpl.xrpl4j.crypto.signing.SignedTransaction)) to submit a transaction to the network. Use the [`XrplClient.ledger()`](https://javadoc.io/doc/org.xrpl/xrpl4j-client/latest/org/xrpl/xrpl4j/client/XrplClient.html#ledger(org.xrpl.xrpl4j.model.client.ledger.LedgerRequestParams)) method to get the latest validated ledger index.
|
||||
- **PHP:** Use the [`submitAndWait()` method of the Client](https://alexanderbuzz.github.io/xrpl-php-docs/client.html) to submit a transaction to the network and wait for the response.
|
||||
- **GoLang:** Use [`SubmitTxAndWait()` or `SubmitTxBlobAndWait()` methods os the Client](https://pkg.go.dev/github.com/Peersyst/xrpl-go@v0.1.12/xrpl/websocket#Client.SubmitTxAndWait) to submit a transaction to the network and wait for the response.
|
||||
- **Go:** Use [`SubmitTxAndWait()` or `SubmitTxBlobAndWait()` methods os the Client](https://pkg.go.dev/github.com/Peersyst/xrpl-go@v0.1.12/xrpl/websocket#Client.SubmitTxAndWait) to submit a transaction to the network and wait for the response.
|
||||
|
||||
{% tabs %}
|
||||
|
||||
@@ -255,7 +255,7 @@ Now that you have a signed transaction, you can submit it to an XRP Ledger serve
|
||||
{% code-snippet file="/_code-samples/send-xrp/php/send-xrp.php" from="// Submit" before="// Wait" language="php" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="GoLang" %}
|
||||
{% tab label="Go" %}
|
||||
{% code-snippet file="/_code-samples/send-xrp/go/ws/main.go" from="// Submit" before="// Wait" language="go" /%}
|
||||
{% /tab %}
|
||||
|
||||
@@ -296,7 +296,7 @@ Most transactions are accepted into the next ledger version after they're submit
|
||||
|
||||
- **PHP:** If you used the [`.submitAndWait()` method](https://alexanderbuzz.github.io/xrpl-php-docs/client.html), you can wait until the returned Promise resolves. Other, more asynchronous approaches are also possible.
|
||||
|
||||
- **GoLang:** If you used the `SubmitTxAndWait()` or `SubmitTxBlobAndWait()` methods, the client will handle submission and wait until the transaction is confirmed in a ledger. Internally, these methods use a polling mechanism, querying the transaction status with the client's `Request()` method and a `TxRequest`.
|
||||
- **Go:** If you used the `SubmitTxAndWait()` or `SubmitTxBlobAndWait()` methods, the client will handle submission and wait until the transaction is confirmed in a ledger. Internally, these methods use a polling mechanism, querying the transaction status with the client's `Request()` method and a `TxRequest`.
|
||||
|
||||
{% tabs %}
|
||||
|
||||
@@ -316,7 +316,7 @@ Most transactions are accepted into the next ledger version after they're submit
|
||||
{% code-snippet file="/_code-samples/send-xrp/php/send-xrp.php" from="// Wait" before="// Check" language="php" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="GoLang" %}
|
||||
{% tab label="Go" %}
|
||||
{% code-snippet file="/_code-samples/send-xrp/go/ws/main.go" from="// Wait" before="// Check" language="go" /%}
|
||||
{% /tab %}
|
||||
|
||||
@@ -339,7 +339,7 @@ To know for sure what a transaction did, you must look up the outcome of the tra
|
||||
|
||||
- **PHP:** Use the response from `submitAndWait()` or call the `tx method` using [`$client->syncRequest()`](https://alexanderbuzz.github.io/xrpl-php-docs/client.html).
|
||||
|
||||
- **GoLang:** Use the response from `SubmitTxAndWait()` or `SubmitTxBlobAndWait()`, or manually query the transaction status using a `TxRequest` with the client's `Request()` method.
|
||||
- **Go:** Use the response from `SubmitTxAndWait()` or `SubmitTxBlobAndWait()`, or manually query the transaction status using a `TxRequest` with the client's `Request()` method.
|
||||
|
||||
{% tabs %}
|
||||
|
||||
@@ -359,7 +359,7 @@ To know for sure what a transaction did, you must look up the outcome of the tra
|
||||
{% code-snippet file="/_code-samples/send-xrp/php/send-xrp.php" from="// Check" language="php" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="GoLang" %}
|
||||
{% tab label="Go" %}
|
||||
{% code-snippet file="/_code-samples/send-xrp/go/ws/main.go" from="// Check" language="go" /%}
|
||||
{% /tab %}
|
||||
|
||||
@@ -426,12 +426,12 @@ print_r("Seed: " . $wallet->getSeed()); // Example: sp6JS7f14BuwFY8Mw6bTtLKWauoU
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="GoLang" %}
|
||||
{% tab label="Go" %}
|
||||
|
||||
```go
|
||||
wallet, err := wallet.New(crypto.ED25519())
|
||||
fmt.Println("🌐 Classic Address:", wallet.ClassicAddress) // Example: r9ESeQQswbTxV8neiDTLTHXbXfUwiihyJk
|
||||
fmt.Println("🌐 Seed:", wallet.Seed) // Example: sEd7XGFGSWteam777HQHvw7vHypEWy2
|
||||
fmt.Println("Classic Address:", wallet.ClassicAddress) // Example: r9ESeQQswbTxV8neiDTLTHXbXfUwiihyJk
|
||||
fmt.Println("Seed:", wallet.Seed) // Example: sEd7XGFGSWteam777HQHvw7vHypEWy2
|
||||
|
||||
```
|
||||
{% /tab %}
|
||||
@@ -478,7 +478,7 @@ $client = new JsonRpcClient("https://xrplcluster.com");
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="GoLang" %}
|
||||
{% tab label="Go" %}
|
||||
|
||||
```go
|
||||
client := websocket.NewClient(
|
||||
@@ -528,7 +528,7 @@ $client = new JsonRpcClient("http://localhost:5005");
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="GoLang" %}
|
||||
{% tab label="Go" %}
|
||||
|
||||
```go
|
||||
client := websocket.NewClient(
|
||||
|
||||
@@ -16,7 +16,7 @@ These tutorials walk you through the basics of building a very simple XRP Ledger
|
||||
|
||||
{% xrpl-card title="Python" body="Using xrpl.py, a pure Python library." href="/docs/tutorials/python/" image="/img/logos/python.svg" imageAlt="Python logo" /%}
|
||||
|
||||
{% xrpl-card title="GoLang" body="Using xrpl-go, a pure GoLang library." href="/docs/tutorials/go/" image="/img/logos/golang.svg" imageAlt="GoLang logo" /%}
|
||||
{% xrpl-card title="Go" body="Using xrpl-go, a pure Go library." href="/docs/tutorials/go/" image="/img/logos/golang.svg" imageAlt="Go logo" /%}
|
||||
|
||||
{% xrpl-card title="Java" body="Using xrpl4j, a pure Java library." href="/docs/tutorials/java/" image="/img/logos/java.svg" imageAlt="Java logo" /%}
|
||||
|
||||
|
||||
@@ -480,7 +480,7 @@
|
||||
- label: Ruby Client Library
|
||||
href: https://www.rubydoc.info/gems/xrbp
|
||||
external: true
|
||||
- label: GoLang Client Library
|
||||
- label: Go Client Library
|
||||
href: https://pkg.go.dev/github.com/Peersyst/xrpl-go
|
||||
external: true
|
||||
- page: docs/references/http-websocket-apis/index.md
|
||||
|
||||
Reference in New Issue
Block a user