mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-14 08:45:50 +00:00
feat(_code-samples): WiP add go tx examples implementation and get-started section
This commit is contained in:
24
_code-samples/get-started/go/base/ws/main.go
Normal file
24
_code-samples/get-started/go/base/ws/main.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/Peersyst/xrpl-go/xrpl/websocket"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
// Define the network client
|
||||
client := websocket.NewClient(websocket.NewClientConfig().WithHost("wss://s.altnet.rippletest.net:51233"))
|
||||
|
||||
// Disconnect the client when done. (Defer executes at the end of the function)
|
||||
defer client.Disconnect()
|
||||
|
||||
// Connect to the network
|
||||
if err := client.Connect(); err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
// ... custom code goes here
|
||||
}
|
||||
Reference in New Issue
Block a user