GithubHelp home page GithubHelp logo

scorelab / etherbeat Goto Github PK

View Code? Open in Web Editor NEW
59.0 27.0 78.0 196 KB

With the growing popularity of BitCoin in the last couple of years, other blockchains have been in development for solving various problems that need distributed consensus. Ethereum blockchain is one example, that gives users to develop "smart contracts" that runs in the blockchain. This gives the ability to develop decentralized applications (or dApps). Users do not need to 'trust' anything or anybody. In addition to that, dApps are always available and will be guaranteed to be available in the future as well. Also, it is resistant to traditional attacks such as DDoS. This framework has given many developers to write a decentralized application without much effort, without needing distributed systems or cryptography knowledge. Many startups are actively developing applications for Ethereum such as Ethereum Name Service (ENS), Etheria or WeiFund. Unfortunately, because the technology being used is bleeding edge it is inevitable that attacks or hacks will target these apps for monetary reasons. Last year DAO suffered a severe attack because of its security flaws. Due to that attack, 3.6m ether was stolen from DAO's smart contract. Also, once you publish a smart contract in Ethereum it is not possible to modify or update it as a regular web application. Thus, even developers identify a critical bug in the contract it is not possible to push a bugfix in a straightforward way. Thus, in order to fill the gap of not having a proper 'smart contract' compatible monitoring service, we propose to build a web application that can monitor other smart contracts in Ethereum and give the capability to safeguard it's critical functions (Ether send and receive) and interact and visualize with smart contract functions in a much simpler way. Also depending smart contracts can using our base smart contracts to gain the advantage of having 'circuit-breaker' which will pause the activity if things go wrong in an unexpected way.

License: Apache License 2.0

TypeScript 10.96% Shell 1.91% Python 3.91% CMake 1.63% Dockerfile 0.53% C++ 80.04% C 1.02%

etherbeat's Introduction

EtherBeat

Logo

With the growing popularity of BitCoin in the last couple of years, other blockchains have been in development for solving various problems that need distributed consensus. Ethereum blockchain is one such example, that gives users a platform to develop "smart contracts" using their Turing complete language Solidity. This gives the ability to develop decentralized applications (or dApps). Users do not need to 'trust' anything or anybody. In addition to that, dApps are imutable and will remain available and unchanged in future. Also, it is resistant to traditional attacks such as DDoS.

This framework has enabled developers to write decentralized applications without much effort, without needing distributed systems or cryptography knowledge. Many startups are actively developing applications for Ethereum such as Ethereum Name Service (ENS), Etheria, WeiFund and Consensys. Unfortunately, because the technology being used is bleeding edge it is inevitable that attacks or hacks will target these apps for monetary reasons. Last year DAO suffered a severe attack because of its security flaws. Due to that attack, 3.6m ether was stolen from DAO's smart contract. Also, once you publish a smart contract in Ethereum it is not possible to modify or update it as a regular web application. Thus, even when developers identify a critical bug in the contract it is not possible to push a bugfix in a straightforward way.

Thus, in order to fill the gap of not having a proper 'smart contract' compatible monitoring service, we propose to build a web application that can monitor other smart contracts in Ethereum and give the capability to safeguard it's critical functions (sending and receiving Ether) and interact with and visualize the smart contract functions in a much simpler way. Also depending smart contracts can use our base smart contracts to gain the advantage of having 'circuit-breaker' which will pause the activity if things go wrong in an unexpected way.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Make sure you have installed,

EtherBeat depends on a Web3 compatible JSON-RPC server like Parity or Geth Ethereum node to query information. Enhanced querying capability is provided by TinkerPop server that will store the blockchain in a graph database.

Please follow instructions at here to setup your TinkerPop instance. Initial syncing process of Ethereum mainnet network with TinkerPop will take a considerable amount of time, therefore we recommend you to work with a test network to get started. Using Ethereum extractor provided in extractor.py, user can sync the graph database instance.

After Parity/Geth and TinkerPop server is running, you can start the node.js application. If there are any changes in default configuration, please make sure to edit them in config/web3conn.js file.

git clone [email protected]:scorelab/EtherBeat.git # or clone your own fork
cd EtherBeat
npm install

After running the node.js app, you can browse the grahql query instance at http://localhost:3000/graphql.

Examples

Getting account balance

{
  account (accountHash: "0xf7d93bcb8e4372f46383ecee82f9adf1aa397ba9") {
    balance
  }
}

Getting creator address (for smart contract)

{
  account (accountHash: "0xf7d93bcb8e4372f46383ecee82f9adf1aa397ba9") {
    creator
  }
}

Getting latest 10 transactions

{
  account (accountHash: "0xf7d93bcb8e4372f46383ecee82f9adf1aa397ba9") {
    transactions {
      value
    }
  }
}

Getting transactions with pagination

{
  account(accountHash: "0xf7d93bcb8e4372f46383ecee82f9adf1aa397ba9") {
    transactions(page: 2, size: 100) {
      value
    }
  }
}

Nested queries

Since from and to fields are Ethereum addresses it is possible treat them as accounts in EtherBeat, which gives the ability to do nested queries.

{
  account(accountHash: "0xf7d93bcb8e4372f46383ecee82f9adf1aa397ba9") {
    transactions {
      from {
        address
        balance
      }
      to {
        address
        balance
      }
    }
  }
}

Reading smart contract values

{
  account(accountHash: "0xf7d93bcb8e4372f46383ecee82f9adf1aa397ba9") {
    parameters (jsonAbi: "provide JSON abi interface here")
  }
}

Result are returned as a list of (function name, variable type, result)

{
  "data": {
    "account": {
      "parameters": "[{\"function\":\"newVersionReleased\",\"type\":[{\"name\":\"\",\"type\":\"bool\"}],\"result\":false},{\"function\":\"creationBlockNumber\",\"type\":[{\"name\":\"\",\"type\":\"uint256\"}],\"result\":\"639374\"},{\"function\":\"extraBalance\",\"type\":[{\"name\":\"\",\"type\":\"uint256\"}],\"result\":\"5.1707074912426014124443e+22\"},{\"function\":\"version\",\"type\":[{\"name\":\"\",\"type\":\"string\"}],\"result\":\"0.1.0\"},{\"function\":\"subsidyFactor\",\"type\":[{\"name\":\"\",\"type\":\"uint256\"}],\"result\":\"2\"}]"
    }
  }
}

etherbeat's People

Contributors

agentmilindu avatar amany9000 avatar charithccmc avatar prabushitha avatar tharidu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

etherbeat's Issues

Start with Gsoc

Since I am super interested in this project and In gsoc the goal in to design an analyzer framework over it.
How can I get started with it, since no previous repository is present now?

Unable to start

screen shot 2018-03-17 at 4 51 10 pm

Hi Team EtherBeat!
Can anyone please help me figure out a solution for this error. It creeps up after npm run start (as seen in the first line of the screenshot)

Same Installation Error as the one in issue "Unable to start"

Hi there,

As shown in the commit history, the parser branch has been merged into this branch. However,
the documentation seems to be still the same. I tried following the steps and face the same error as shown in Issue "Unable to start" with npm run start. Also, there seem to be docker files that install the dependencies used in parser branch. Is it possible for you to update the documentation? Also when I manually try to install the secp256k1 from the same source as mentioned in docker file, it is not successful. I would appreciate if you can help me with this?

Access account balance through EtherExtractor

Currently EtherExtractor tool doesn't have a mechanism to access the account balance from state trie. A new functionality to get the account balance for a given address from geth synced leveldb blockchain could be useful for analysis.

Repo should follow Gitflow Workflow

This repos should follow Gitflow workflow and follow are the items you have to check. 
- [ ] There is a `master` branch and a `develop` branch.
- [ ] `master` branch is locked for direct commits and, 
  - [ ] Require pull request reviews before merging is active
  - [ ] Require status checks to pass before merging is active
    - [ ] Require branches to be up to date before merging
    - [ ] Appropriate Status checks are required
  - [ ] Enforce all configured restrictions for administrators is active
  - [ ] Restrict only maintainers group can push to the master branch
- [ ] `develop` branch is locked for direct commits and,
  - [ ] Require pull request reviews before merging
    - [ ] Dismiss stale pull request approvals when new commits are pushed is active
  - [ ] Require pull request reviews before merging is active
  - [ ] Require status checks to pass before merging is active
    - [ ] Require branches to be up to date before merging
    - [ ] Appropriate Status checks are required
  - [ ] Enforce all configured restrictions for administrators is active
  - [ ] Restrict only maintainers group can push to the master branch

Google Code-In 2017: Getting Started Issue

THIS IS A NOT A REAL ISSUE BUT A PLACEHOLDER.

All the practising PRs for Google Code-In 2017 should refer this issue. PRs referring this issue will be closed without merging. Do not refer this issue if you are NOT submitting a practice PR and need your work merged.

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.