Giter Site home page Giter Site logo

ether's Introduction

ether

Travis-CI Build Status

The ether package provides functions for interacting with the Ethereum network.

The details of the RPC interface along with curl examples of interacting with it are documented in the JSON RPC page on the Ethereum Wiki.

Installation

Install from GitHub using

# install.packages("devtools")
devtools::install_github("DataWookie/ether")

Alternatively there is a stable version listed on CRAN.

Example

Load the package.

library(ether)

You'll need to connect to an Ethereum node exposing a RPC interface. By default the package will attempt to connect to a node on localhost using port 8545. However, you can also make use of the public RPC nodes hosted by infura.io. Assuming that you have created an infura.io API key and stored it in the INFURA_MAINNET_KEY environment variable.

set_rpc_address("https://mainnet.infura.io/", key = Sys.getenv("INFURA_MAINNET_KEY"))

Once you've configured the connection to RPC you are ready to interact with the Ethereum blockchain.

eth_blockNumber()
#> [1] 4867006
eth_gasPrice()
#> 1 'mpfr' number of precision  40   bits 
#> [1] 100000000000
eth_getBalance("0xD34DA389374CAAD1A048FBDC4569AAE33fD5a375")
#> 1 'mpfr' number of precision  60   bits 
#> [1] 194274248530503149
eth_getTransactionCount("0xD34DA389374CAAD1A048FBDC4569AAE33fD5a375")
#> [1] 1150417

ether's People

Watchers

James Cloos avatar Hélder Mendes 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.