Git Product home page Git Product logo

ethrpc's Introduction

  • 赞助 BTC: 1Cbd6oGAUUyBi7X7MaR4np4nTmQZXVgkCW
  • 赞助 ETH: 0x623A3C3a72186A6336C79b18Ac1eD36e1c71A8a6
  • Go语言付费QQ群: 1055927514

以太坊山寨RPC客户端

官方以太坊客户端太重,其中更是间接依赖了CGO特性。因此山寨一个轻量版以太坊RPC客户端。

例子

package main

import (
	"fmt"

	"github.com/chai2010/ethrpc"
)

func main() {
	// Geth/v1.9.7-omnibus-cc8122b7-20191122/linux-amd64/go1.13.4 <nil>
	version, err := ethrpc.Web3ClientVersion("https://ropsten.infura.io")
	fmt.Println(version, err)
	version, err = ethrpc.NewWeb3API("https://ropsten.infura.io").ClientVersion()
	fmt.Println(version, err)

	// 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 <nil>
	hash, err := ethrpc.Web3Sha3("https://ropsten.infura.io", []byte(""))
	fmt.Println(hash, err)
	hash, err = ethrpc.NewWeb3API("https://ropsten.infura.io").Sha3([]byte(""))
	fmt.Println(hash, err)
}

版权

版权 @2019 柴树杉

ethrpc's People

Contributors

chai2010 avatar

Stargazers

yuamera avatar 伊欧 avatar  avatar

Watchers

James Cloos avatar  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.