Phoenix Chain SDK Doc
  • Introduction
  • Client
    • Initializing a Client
  • Accounts
    • Querying Balances
  • Blocks and Transactions
    • Querying Blocks
    • Querying Transactions
  • Smart Contracts
    • Installing Dev Tools
    • Generating Go Contracts File
    • Deploying Contracts
    • Querying Contracts
    • Writing to Contracts
  • Event logs
    • Filtering Event logs
    • Subscribing to Event Logs
Powered by GitBook
On this page
  1. Client

Initializing a Client

Before interacting with the blockchain, you need to initialize a client. First import the relevant packages:

// Import the latest version of the package
import (
    phoenixClient "github.com/PhoenixGlobal/Phoenix-Chain-SDK/ethereum/ethclient"
)

Then connect a client:

// Connect to a phoenix node
client, err := phoenixClient.Dial("https://dataseed1.phoenix.global/rpc")
if err != nil {
    log.Fatal(err)
}
PreviousClientNextAccounts

Last updated 2 years ago