Giter Site home page Giter Site logo

web3go's Introduction

Ethereum Go Client

This is a Ethereum compatible Go Client which implements the Eth JSON RPC Module. Similar to Web3js.

Web3go Installation

setup $GOPATH

export GOPATH=/Users/[user]/go

go get

go get -u github.com/fraymond/web3go

Ethereum Configuration

Install Ethereum

cd ~/git
git clone https://github.com/ethereum/go-ethereum.git
cd go-ethereum
make geth
export PATH=$PATH:~/git/go-ethereum/build/bin/

Run Ethereum

mkdir ~/geth-test
cd ~/geth-test
mkdir privatebc

create genesis.json file

vi genesis.json

put the following in genesis.json file and save.

{
    "config": {  
        "chainId": 4321, 
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },
    "difficulty": "0x400",
    "gasLimit": "0x8000000",
    "alloc": {}
}

Start geth and open a web3js console. You can use port 30305, which is default for web3go testing.

geth --datadir ./privatebc init ./genesis.json
geth --datadir ./privatebc --networkid 4321 --port 30305 --rpc --rpcapi eth,net,web3,personal console

Create new accounts and send transactions

eth.coinbase
eth.accounts
personal.newAccount()
passphrase:
repeat passphrase:

miner.start()
--wait a few seconds
miner.stop()

personal.unlockAccount("0x18833df6ba69b4d50acc744e8294d128ed8db1f1")
eth.sendTransaction({from: '0x18833df6ba69b4d50acc744e8294d128ed8db1f1', to: '0x2a022eb956d1962d867dcebd8fed6ae71ee4385a', value: web3.toWei(12, "ether")}) 

Web3go Execution

go run web3main.go

Requirements

  • go ^1.8.3

Go installation instructions.

web3go's People

Watchers

teelet 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.