GithubHelp home page GithubHelp logo

nunoedgarhubsoftphotoflow / blockapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from blockchain-unica/blockapi

0.0 1.0 0.0 14.79 MB

A general framework for blockchain analytics

Home Page: http://blockchain.unica.it/projects/blockchain-analytics/

Scala 88.96% Java 10.80% JavaScript 0.12% TSQL 0.12%

blockapi's Introduction

BlockAPI: Blockchain analytics API

A Scala framework for the development of general-purpose analytics on blockchains, maintained by Livio Pompianu and Stefano Lande of the Blockchain@Unica Lab at the University of Cagliari.

The 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, Litecoin, and Ethereum. The DBMS currently supported are MongoDB, MySQL, PostgreSQL, and Fuseki.

The library is dicussed in A general framework for blockchain analytics, in proceeding of the SERIAL workshop 2017.

More material is available in the project page.

The Scaladoc is uploaded on this repository in the doc folder.

Install prerequisites

General 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:
  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)

Required libraries

This step is required to sucessfully compile the project. Before building the project, execute the following commands:

Bitcoinj
git clone https://github.com/bitbart/bitcoinj.git
cd bitcoinj
git checkout segwit
mvn install -DskipTests
cd core
mvn install -DskipTests
Litecoinj
git clone https://github.com/litecoinj-unica/litecoinj.git
cd litecoinj
mvn install -DskipTests
cd core
mvn install -DskipTests

Analysis dependent prerequisites

ICO Analytics

This instructions are needed only for performing analyses on ICO on Ethereum.

In order to use the ICO class (created to retrieve ICOs data) you must require the respective API keys:

  1. EtherScan
    • It is sufficient to sign up and then go here
  2. ICOBench
  3. Ethplorer
    • There is a default, free key: freekey. If you need more data or highload of service, you can to get personal API key.

After doing these steps, do the following:

  1. Copy EtherScan key into EtherScanAPI.apiKey attribute
  2. Copy ICOBench private key and public key into ICOBenchAPI.privateKey and ICOBenchAPI.publicKey attributes respectively
  3. Copy Ethplorer key into EthplorerAPI.apiKey attribute

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 -rpcserialversion=0
  3. Run a localhost instance of the DBMS on the default port.
  4. Clone this repository.
  5. From your IntelliJ welcome screen: select "Import Project" and open the build.sbt file from your repository directory.

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.

Acknowledgments

The authors thank the following developers of the Department of Mathematics and Computer Science of the University of Cagliari for their valuable contributions.

Members of Blockchain@Unica lab:

Interns at Blockchain@Unica lab:

Students of the Cybersecurity course:

blockapi's People

Contributors

liviopompianu avatar ferruvich avatar stefanolande avatar giuliamorgen avatar alessiomanai avatar khadijazine avatar davidecurcio avatar pow39 avatar stefanochessa avatar sirbardo avatar chelo47951 avatar giancarlolelli avatar murruflavia avatar carlocabras21 avatar h1cham avatar cedoor avatar bellisanogiu avatar francescopisu avatar toniomeepo avatar albertomusa avatar bitbart avatar riccardomulas avatar skambuilds avatar marcoguria avatar mallocifrancesca avatar giovanniusai avatar fabseulo avatar f-fanni avatar asostrife avatar carlocuccu avatar

Watchers

 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.