Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

miguelmota/go-web3-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Web3 Examples

Example of how to use "Web3" in golang.


UPDATE

Check out my little book on Ethereum Development with Go as a better guide.


Synopsis

Shows how to

  • compile a smart contract
  • generate a golang package from the ABI
  • connect to rpc or websocket provider
  • load a contract from it's address
  • load a private key
  • call a contract method
  • subscribe to contract events
  • decode event log

Development

Solidity contract to ABI

solc --abi contracts/Greeter.sol

ABI to Go package

abigen --abi contracts/Greeter.abi --pkg greeter --out greeter.go

Resources

License

MIT