Giter Club home page Giter Club logo

explorer's Introduction

NOTE: While open-source, some features of this block explorer are not easily compatible with running your own version locally, and this is no longer recommended (except for expert users).

--

Setup Instructions

Install

OSX

  • Follow the instructions here to install Homebrew and then (re)install python.
  • If for some reason the step above does not install pip and virtualenv, follow the instructions here to get pip and then install virtualenv using pip install virtualenv.
  • Install the foreman gem for accessing environmental variables: $ gem install foreman
  • Optional (for webhooks): install ngrok with brew install ngrok (thanks Homebrew!)
  • Optional (advanced features): Install the latest stable version of postgres 9. (http://postgresapp.com/)[Postgresapp for Mac] is quite easy to install.

Ubuntu

  • $ sudo apt-get install postgresql libpq-dev ngrok-client ngrok-server

Configure

  • $ cd into your projects/workspaces directory and run $ git clone https://github.com/blockcypher/explorer.git. The result of $ git remote -v should look like this:
origin	[email protected]:blockcypher/explorer.git (fetch)
origin	[email protected]:blockcypher/explorer.git (push)
  • $ cd explorer/ to get to the project root direction, create a python3 virtual environment ($ virtualenv -p python3 venv) and then activate it ($ source venv/bin/activate)
  • Install requirements: $ pip3 install -r requirements.txt (this will take a few mins)
  • Create a .env file in the project root directory with the following:
DEBUG=True
TEMPLATE_DEBUG=True
DJ_DEFAULT_URL=postgres://postgres:YOURLOCALPASSWORDHERE@localhost:5432/explorer_local
SECRET_KEY=RANDOMLY_GENERATED_50CHAR_STRING
SITE_DOMAIN=pick_this_yourself.ngrok.com
BLOCKCYPHER_API_KEY=PUT_YOURS_HERE

(these are for your local machine, production is a little different as settings.py is smartly designed to default to production settings)

  • Create a database on your local machine with whatever name you like. I recommend explorer_local so it's clear you're working on a local copy. You'll be using this above in DJ_DEFAULT_URL. I've assumed your user is postgres, but you could have a different user.
  • Create DB tables from code (replace foreman with heroku for running on production, which should basically never happen again):
# Create tables and run migrations:
$ foreman run python3 manage.py migrate

Run the Site Locally

Run the webserver locally:

$ foreman run python3 manage.py runserver

Now visit: http://127.0.0.1:8000/

To receive webhooks locally, you need to also run ngrok in the terminal (use the same SITE_DOMAIN from your .env file above):

$ ngrok -subdomain=pick_this_yourself 8000

Now visit http://pick_this_yourself.ngrok.com to confirm it's working (you could even do this on your phone)

Check Out the Admin Section

  • Create a superuser admin for yourself, by entering the following into $ foreman run python3 manage.py shell:
from users.models import AuthUser
AuthUser.objects.create_superuser(email='YOURCHOICE', password='PASSWORDGOESHERE')

Now visit http://127.0.0.1:8000/admin

Submit Your First Pull Request

First, pull the latest version of the code from github:

$ git pull origin master

Make a new branch:

$ git checkout -b my_branch

Make some trivial change and commit it:

$ git commit -am 'my changes'

Push it up to github:

$ git push origin my_branch

You can submit your pull request here: https://github.com/blockcypher/explorer

Congrats, you're all setup!

Post Setup Instructions

Build Awesome Features

You're on your own for that.

Git Foo

Compare your local version of site to what's on github:

$ git log origin/master..HEAD --oneline

explorer's People

Contributors

acityinohio avatar alex-werner avatar bitcoinbrisbane avatar dependabot[bot] avatar matthieu avatar pastapastapasta avatar quentinlesceller avatar snogcel 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.