Code Monkey home page Code Monkey logo

blockchain-analytics-api's Introduction

Blockchain analytics API

A Scala framework for the development of general-purpose analytics on blockchains, by Livio Pompianu, Stefano Lande, and Stefano Ferru.

Our framework allows to combine data within the blockchain with data from the outside (e.g. exchange rates and tags). The workflow consists in two steps:

  1. construct a view of the blockchain and save it in a database;
  2. analyse the view by using the query language of the database.

The blockchains currently supported are Bitcoin and Ethereum. The DBMS currently supported are MongoDB and MySQL.

The library is dicussed in A general framework for Bitcoin analytics (an updated version is coming soon).

More material is available in the project page.

The Scaladoc (uploaded on this repository in the doc folder) is also available at the following link.

Install prerequisites

Prerequisites depends on the target analyses. Generally speaking the framework needs at least one blockchain client and one DBMS.

  1. Blockchain clients:
  2. DBMS:
    • MongoDB (constructs a NoSQL view of the data)
    • MySQL (constructs a SQL view of of the data)
  3. Either
    • use an IDE for executing a Scala SBT project (we used IntelliJ IDEA) or
    • use the command line in place of an IDE (Install SBT)

Install blockchain analytics API

  1. Execute the blockchain client in order to obtain a local copy of the target blockchain (this process may take several hours)
  2. Enable the client RPC calls.
    • In the Bitcoin Core case
      bitcoind -datadir=path/to/blockchain -server -rpcuser=user -rpcpassword=password 
  3. Run a localhost instance of the DBMS on the default port.
  4. Clone this repository.
  5. From your IDE: select "import project" and provide your local path to the build.sbt file

Running

  1. Execute of one of the available examples. Either
    • open the file from your IDE and select run or
    • use the command line: from the root directory of the project, execute
      sbt "runMain tcs.examples.ClassName"

Our framework will build the selected database. Then you can query it for performing your analysis. For each available Scala script, we provide some default queries along with the resulting csv files.

blockchain-analytics-api's People

Contributors

bitbart avatar ferruvich avatar liviopompianu avatar stefanolande 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.