Client Management

NewClient(rpcEndpoint string) (*Client, error)

Creates a new GoPredix client connection.

Parameters:

  • rpcEndpoint: HTTP(S) URL of blockchain RPC endpoint

Returns:

  • *Client: Connected client instance

  • error: Connection error if any

Example:

goclient, err := gopredix.NewClient("https://mainnet.infura.io/v3/YOUR-KEY")
if err != nil {
    log.Fatal(err)
}

(c *Client) Close() error

Closes the client connection and releases resources.

Example:

godefer client.Close()

Last updated