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.
This has been built and tested on python 3.6. Please ensure you have the latest version.
It his highly recommended that you use a virtual environment to ensure that anything installed doesn't conflict with your standard environment.
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.
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.
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 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
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
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.
Bitcoin and other chain support is planned as future work.
If you've found a bug, or want to contribute, please feel free to create an issue or PR.