Coder Social home page Coder Social logo

blockme's Introduction

Blockme

NOTE: While not a direct fork, this was inspired by and derived from Alex Miller's ethereum blockchain parser. If you enjoy this, or find it useful, please go ahead and give him a star as well.

Installation

Prerequisites

Python

This has been built and tested on python 3.6. Please ensure you have the latest version.

Virtual Env

It his highly recommended that you use a virtual environment to ensure that anything installed doesn't conflict with your standard environment.

Postgres

We use PostgreSQL as our relational database of choice. blockme uses SQL Alchemy so if you prefer to use another database, ensure it's compatabily with sqlalchemy and enter the credentials (and modify the url in the settings file) as needed. You can install postgres using your preferred package manager (brew, apt, etc.) or from source here.

Geth

Ensure you have geth installed. blockme makes use of the JSON-RPC endpoint to parse the ethereum blockchain. You can read more about the JSON-RPC endpoint here.

WARNING if you run this on a geth client containing an account that has ether in it, make sure you put a firewall 8545 or whatever port you run geth RPC on.

Setup

Clone this repo and install the requirements using your preferred package manager (ideally you're using a virtualenv):

git clone https://github.com/Marto32/blockme.git
cd blockme
pip install -r requirements.txt

Launch

Launch postgresql.

Launch geth using the following command:

geth --rpc

More geth CLI options may be found here.

Set environment variables (or use defaults for local development):

export PG_USERNAME='your_database_username'        # Defaults to $USER env var
export PG_PASSWORD='your_database_user_password'   # Defaults to ''
export PG_HOST='database_host'                     # Defaults to localhost
export PG_PORT=5432                                # Defaults to the 5432
export PG_DATABASE_NAME='blockme_db'               # Defaults to 'devdb'

Additional configuration options can be found in the settings.py file. Alternatively you can just hardcode the values into that file.

Run blockme

python runner.py

Troubleshooting

If you are getting blockme import errors, you may have to update your PATH when you launch the script. To do so, update your launch command to the following:

PATH=$PATH:/path/to/blockme python runner.py

Analysis

The data will now be available for querying in the database. To get an idea of the schema, take a look at the objects in the blockme/models directory.

Moving forward

Bitcoin and other chain support is planned as future work.

Contributing

If you've found a bug, or want to contribute, please feel free to create an issue or PR.

blockme's People

Contributors

marto32 avatar

Watchers

 avatar  avatar

blockme's Issues

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.