简体   繁体   English

我可以使用 golang 在以太坊上开发吗?

[英]Can I use golang to develop on Ethereum?

I am a newbee in ethereum and I get a little confused after reading some tutorails.我是以太坊的新手,在阅读了一些教程后我有点困惑。 My question is How Can I use golang to develop on Ethereum?我的问题是如何使用 golang 在以太坊上开发?

And I found goAPI demo like:我发现 goAPI 演示如下:

client, err := ethclient.Dial("http://192.168.1.14:8545")
err = client.SendTransaction(context.Background(), tx)

and go-jsonRPC demo like:和 go-jsonRPC 演示,如:

client, err := rpc.Dial("http://192.168.1.14:8545")
err = client.Call(&result, "eth_getBalance", account[0], "latest")

What's the different between them?他们之间有什么不同? Which one should I use?我应该使用哪一个? I found web3js is convenient but can I use that with Golang because I don't use javascript?我发现 web3js 很方便,但我可以将它与 Golang 一起使用,因为我不使用 javascript?

I'm a new blockchain programmer please gime me some guide.我是一个新的区块链程序员,请给我一些指导。

Code on Ethereum is written in Solidity.以太坊上的代码是用 Solidity 编写的。 You can, however, interact with Ethereum with go.但是,您可以使用 go 与以太坊进行交互。

You can not write Ethereum smart contracts in Go.你不能在 Go 中编写以太坊智能合约。 Ethereum apps are smart contracts and you can write them only in Solidity or Vyper.以太坊应用程序是智能合约,你只能用 Solidity 或 Vyper 编写它们。 What you can do with Go is to communicate (read and write) with the deployed contracts through a client which can be in Go, Python or JS.您可以使用 Go 执行的操作是通过客户端与已部署的合约进行通信(读取和写入),该客户端可以位于 Go、Python 或 JS 中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何为 Kibana 开发插件? - How can I develop a plugin for Kibana? 如何比较 golang 中的两个文件? - How can I compare two files in golang? 我可以用未知类型的golang中的标签复制接口指针的值吗 - Can I copy the value of pointer of interface with tags in golang with unknown type 我可以在 Windows 和 WSL 上共享相同的 golang 环境吗? - Can I share the same golang environment on Windows and WSL? 如何使用 golang 获取特定网站上的卖家名称? - How can I get the name of a seller on a specific website using golang? 我如何选择 stract 类型的数组大小(golang) - how can i choose array size in stract type (golang) 使用不同的数据进行生产并开发 firebase 个站点 - Use different data for production and develop firebase sites golang:尝试使用`any`来匹配不同的功能 - golang: trying to use `any` to match different functions 如何在golang中使用docker cli创建子网 - How to use docker cli in golang to create subnet 如何在从 Golang(gin-gonic 包)提供的 html 模板文件上使用节点模块(即:Sentry) - How to use node modules (i.e: Sentry) on html template files served from Golang (gin-gonic package)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM