mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-25 14:15:50 +00:00
chore(samples): replace tab for 4 spaces
This commit is contained in:
@@ -1,26 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/Peersyst/xrpl-go/xrpl/queries/utility"
|
||||
"github.com/Peersyst/xrpl-go/xrpl/rpc"
|
||||
"github.com/Peersyst/xrpl-go/xrpl/queries/utility"
|
||||
"github.com/Peersyst/xrpl-go/xrpl/rpc"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Define the network client configuration
|
||||
cfg, err := rpc.NewClientConfig("https://s.altnet.rippletest.net:51234/")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
// Define the network client configuration
|
||||
cfg, err := rpc.NewClientConfig("https://s.altnet.rippletest.net:51234/")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Initiate the network client
|
||||
client := rpc.NewClient(cfg)
|
||||
// Initiate the network client
|
||||
client := rpc.NewClient(cfg)
|
||||
|
||||
// Ping the network (used to avoid Go unused variable error, but useful to check connectivity)
|
||||
_, err = client.Ping(&utility.PingRequest{})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
// Ping the network (used to avoid Go unused variable error, but useful to check connectivity)
|
||||
_, err = client.Ping(&utility.PingRequest{})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// ... custom code goes here
|
||||
// ... custom code goes here
|
||||
|
||||
}
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"fmt"
|
||||
|
||||
"github.com/Peersyst/xrpl-go/xrpl/websocket"
|
||||
"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"))
|
||||
// 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()
|
||||
// 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
|
||||
}
|
||||
// Connect to the network
|
||||
if err := client.Connect(); err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
// ... custom code goes here
|
||||
// ... custom code goes here
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user