代码中看到描述如下
// NetworkID returns the network ID (also known as the chain ID) for this chain.
func (ec *Client) NetworkID(ctx context.Context) (*big.Int, error) {
version := new(big.Int)
var ver string
if err := ec.c.CallContext(ctx, &ver, "net_version"); err != nil {
return nil, err
}
if _, ok := version.SetString(ver, 10); !ok {
return nil, fmt.Errorf("invalid net_version result %q", ver)
}
return version, nil
}
但实际上client.NetworkID
和client.ChainID
拿到的返回值不一样,有没有大佬解释一下?
包版本v1.10.18
https://learnblockchain.cn/article/1791 这篇文章基本解释了chainID和networkID的区别