> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tenderly.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Go-Ethereum (geth) - Node RPC 集成

> 使用 go-ethereum (geth) ethclient 通过网关端点将 Go 应用连接到 Tenderly Node RPC，以读取和写入链上数据。

[Go-Ethereum](https://goethereumbook.org/en/) 是 Ethereum 官方的 Go 实现，用于与区块链交互。Go-Ethereum，简称 *geth*，是最流行的 Ethereum 客户端。在使用 Golang 开发应用时，它提供了读取和写入区块链所需的一切。使用网关端点将其连接到 [Node RPC](/node-rpc/overview)，并参见 [JSON-RPC 参考](/node-rpc/rpc-reference) 以了解受支持的方法。

```go title="client.go" showLineNumbers theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
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
}
```
