Skip to content

This is a simple project where I deploy, read and write to eth contract on Rinkeby using golang

Notifications You must be signed in to change notification settings

jelias2/go-eth-hello-world

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

  • This is a simple project where I deploy, read and write to eth contract on Rinkeby using golang

Notes

To access solidity contract from golang
  1. Get the contract source code in solidity
  2. Generate the ABI ( application binary interface) using abigen solc --abi Store.sol -o build
  3. Convert the abi into an importable go file abigen --abi=./build/Store.abi --pkg=store --out=Store.go
To Deploy solidity from golang
  1. In order to deploy a smart contract from Go, we also need to compile the solidity smart contract to EVM bytecode. The EVM bytecode is what will be sent in the data field of the transaction. The bin file is required for generating the deploy methods on the Go contract file. solc --bin Store.sol -o build
  2. Now we compile the Go contract file which will include the deploy methods because we includes the bin file. abigen --bin=./build/Store.bin --abi=./build/Store.abi --pkg=store --out=Store.go

About

This is a simple project where I deploy, read and write to eth contract on Rinkeby using golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published