Giter Club home page Giter Club logo

eth-client's Introduction

eth-client

Travis License: LGPL v3 Go Report Card

A Golang client library to communicate with Ethereum RPC server.

  • Implements most of JSON-RPC methods and several client-specific methods.
  • Provides a high-level interface to propose/get validators on Istanbul blockchain.
  • Provides a high-level interface to create private contracts on Quorum blockchain.

Usage

package main

import (
	"context"
	"fmt"

	"github.com/getamis/eth-client/client"
)

func main() {
	url := "http://127.0.0.1:8545"
	client, err := client.Dial(url)
	if err != nil {
		fmt.Println("Failed to dial, url: ", url, ", err: ", err)
		return
	}

	err = client.StartMining(context.Background())
	if err != nil {
		fmt.Println("Failed to start mining, err: ", err)
		return
	}
	fmt.Println("start mining")
}

Implemented JSON-RPC methods

  • admin_addPeer
  • admin_adminPeers
  • admin_nodeInfo
  • eth_blockNumber
  • eth_sendRawTransaction
  • eth_getBlockByHash
  • eth_getBlockByNumber
  • eth_getBlockByHash
  • eth_getBlockByNumber
  • eth_getTransactionByHash
  • eth_getBlockTransactionCountByHash
  • eth_getTransactionByBlockHashAndIndex
  • eth_getTransactionReceipt
  • eth_syncing
  • eth_getBalance
  • eth_getStorageAt
  • eth_getCode
  • eth_getBlockTransactionCountByNumber
  • eth_call
  • eth_gasPrice
  • eth_estimateGas
  • eth_sendRawTransaction
  • miner_startMining
  • miner_stopMining
  • net_version
  • logs
  • newHeads
  • eth_getLogs

Istanbul-only JSON-RPC methods

To use these methods, make sure that

Methods:

  • istanbul_getValidators
  • istanbul_propose

Quorum-only JSON-RPC methods

To use these methods, make sure that

Methods:

  • quorum_privateContract
  • quorum_contract

Contributing

Feel free to contribute to this repository.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

Reference

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.