Git Product home page Git Product logo

goreth's Introduction

Go and Ethereum exploration. It starts with https://goethereumbook.org/en/client-setup/

Setup

If running locally, we assume a ganache server is running:

ganache -m "hole symptom crater bring army industry link later fabric hotel asthma pupil"

You will also need to use an infura API key, create a secrets.json file that looks like the following:

{
  "infura": "your API key here",
}

Running the scripts

To run the remote client, simply compile and run: go run .. If you want to run against a local ganache client, run go run . -local.

You can also deploy the contract (if running locally, by passing -deploy). The full usage is below:

Usage of goreth:
  -deploy
    	a flag that, if passed, deploys the Storage contract
  -local
    	a flag that, if passed, runs the script locally

Appendix: compiling solidity contracts

We have solidity contracts in the contracts/ folder. To work with contracts, you'll need to install abigen (a devtool packaged in go-ethereum), and solidity:

brew install ethereum
brew install solidity

Then, you can generate the ABI of a contract, compile it, and generate go bindings with the respective 3 commands:

solc --abi Store.sol
solc --bin Store.sol
abigen --bin=Store_sol_Store.bin --abi=Store_sol_Store.abi --pkg=store --out=Store.go

goreth's People

Contributors

nichochar avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.