mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-17 02:05: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/rpc/main.go
Normal file
24
_code-samples/get-started/go/base/rpc/main.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"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)
|
||||
}
|
||||
|
||||
// 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)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user