0

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?

And I found goAPI demo like:

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

and go-jsonRPC demo like:

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?

I'm a new blockchain programmer please gime me some guide.

rihekopo
  • 3,241
  • 4
  • 34
  • 63
Frank
  • 1
  • There are many very broad question and they are not clear. Please narrow it so people can help you :) – Seymour Mar 15 '20 at 11:54

2 Answers2

0

Code on Ethereum is written in Solidity. You can, however, interact with Ethereum with go.

0

You can not write Ethereum smart contracts in Go. Ethereum apps are smart contracts and you can write them only in Solidity or 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.

rihekopo
  • 3,241
  • 4
  • 34
  • 63