Skip to main content
Go-Ethereum is the official Ethereum implementation in Go, to interact with the blockchain. Go-Ethereum, also known as geth for short, is the most popular Ethereum client. It provides everything we’ll ever need for reading and writing to the blockchain when developing applications using Golang. Connect it to Node RPC using the gateway endpoint, and see the JSON-RPC reference for supported methods.
client.go
package main

import (
    "fmt"
    "log"
    "github.com/ethereum/go-ethereum/ethclient"
)

func main() {
    client, err := ethclient.Dial("https://mainnet.gateway.tenderly.co/<TENDERLY_NODE_ACCESS_KEY_MAINNET>")
    if err != nil {
        log.Fatal(err)
    }

    fmt.Println("we have a connection")
    _ = client // we'll use this in the upcoming sections
}