Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): fix example rpcclient.NewHTTPClient returning variables #2352

Merged
merged 3 commits into from
Jun 19, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions docs/how-to-guides/connecting-from-go.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ A few things to note:
You can initialize the RPC Client used to connect to the Gno.land network with
the following line:
```go
rpc := rpcclient.NewHTTPClient("<gno_chain_endpoint>")
rpc, err := rpcclient.NewHTTPClient("<gno.land_remote_endpoint>")
if err != nil {
panic(err)
}
```

A list of Gno.land network endpoints & chain IDs can be found in the [Gno RPC
Expand Down Expand Up @@ -139,7 +142,10 @@ func main() {
}

// Initialize the RPC client
rpc := rpcclient.NewHTTPClient("<gno.land_remote_endpoint>")
rpc, err := rpcclient.NewHTTPClient("<gno.land_remote_endpoint>")
if err != nil {
panic(err)
}

// Initialize the gnoclient
client := gnoclient.Client{
Expand All @@ -158,6 +164,13 @@ To send transactions to the chain, we need to know the account number (ID) and
sequence (nonce). We can get this information by querying the chain with the
`QueryAccount` function:

```go
import (
...
crypto "github.com/gnolang/gno/tm2/pkg/crypto"
thehowl marked this conversation as resolved.
Show resolved Hide resolved
)
```

```go
// Convert Gno address string to `crypto.Address`
addr, err := crypto.AddressFromBech32("g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5") // your Gno address
Expand Down