Interaction with the 'Ethereum' Blockchain

Interacts with the open-source, public 'Ethereum' < https://www.ethereum.org/> blockchain. It provides a distributed computing platform via smart contracts. This package provides functions which interrogate blocks and transactions in the 'Ethereum' blockchain.


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

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

News

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("ether")

0.1.5 by Andrew Collier, 6 months ago


Browse source code at https://github.com/cran/ether


Authors: Andrew Collier [aut, cre]


Documentation:   PDF Manual  


GPL-2 license


Imports dplyr, httr, jsonlite, Rmpfr

Suggests testthat


See at CRAN