This repository contains reproduceable examples from the Go Contract Bindings (v2) page on the go-ethereum documentation website.
Compile the example contract to ABI definition with deployer bytecode:
> solc --combined-json abi,bin Storage.sol > Storage.json
Compile the ABI definition and deployer bytecode to Go contract bindings:
~/projects/go-ethereum/build/bin/abigen --v2 --combined-json Storage.json --pkg main > Storage.go
Copy Storage.go
into example_1
, example_2
, example_bc_simulate
.
Build Go executables in the examples' directories.
Start a dev-mode Geth instance:
ensure the geth
executable is on the path and run run_geth.sh
Run the examples from the top-level directory. e.g. ./example_1/example_1
.