Giter VIP home page Giter VIP logo

lincoln's Introduction

Lincoln

A lightweight block explorer. Meant to be an improvement over Abe (hence the name). Design goals:

  • Straightforward to setup with minimal dependencies
  • Reasonable space consumption
  • Clean, well written codebase for hackabilitiy.

Lincoln is still very much under development, so keep in mind that things may be a bit bumpy. Several key features are still missing!

Transaction View Screenshot

Stack

  • Python 3.2+
  • Flask
  • SQLAlchemy
  • python-bitcoinlib
  • Redis
  • Gunicorn (although an WSGI server will work)

Missing Key Features

  • Block reorgs aren't handled properly. A complete reindex is required.
  • Sync status isn't shown, so the site may look oddly out of date if connection is lost or doing initial sync.
  • There are no API endpoints, just a UI
  • The address overview page is lacking a lot of information.

Setup

# Python 3.4 is highly preferred due to decimal support
mkvirtualenv lincoln --python /usr/bin/python3.4
pip install -r requirements.txt
pip install -e .

Now copy example.yml to config.yml and enter your RPC information.

# Initialize the database
python manage.py init_db
# To run the webserver
python manage.py runserver
# To sync the blockchain
python manage.py sync

Production

To setup Lincoln on an Ubuntu box, follow these recommendations:

The chain sync chrontab should look something like this:

*/1 * * * * /usr/bin/flock -n /tmp/litecoin_scan.lockfile /path/to/my/virtualenv/bin/python /path/to/repo/manage.py sync >> /home/block/sync.log

An upstart config for the webserver would look something like this:

start on (filesystem)
stop on runlevel [016]

respawn
console log
setuid block
setgid block
chdir /home/block/lincoln

exec /home/block/lincoln_venv/bin/gunicorn lincoln.wsgi_entry:app -b 127.0.0.1:11000 --timeout 270

lincoln's People

Contributors

icook avatar ericecook avatar

Stargazers

Aleksey Z avatar 9CAT avatar Pierre Rochard avatar Michael Goldstein avatar

Watchers

James Cloos avatar  avatar  avatar

lincoln's Issues

Add peer information display

Useful for helping properly bootstrap new networks, or just find more peers in general. Basic support would simply run getpeerinfo and cache it. Display would dump to a table pretty much.

Store unconfirmed transaction data

Two main end goals:

  1. View when a transaction was seen vs when it was confirmed. Build database of average confirmation vs fee.
  2. See current memory pool.

Allow scanning block files directly

This has the advantage of reducing load on the RPC during initial scan and allowing inclusion of Orphan blocks that the node was online for.

Add sync status

Every time the sync occurs it should store a cached value for display. This way we can find out if the information is up to date.

Create a "seen in" many-many with Transactions and Blocks

For speed sake I think Transaction objects pointing directly to the block they're currently in makes the most sense, but it would be good to allow showing the orphan blocks where the transaction appeared in. The could help make the effects of a network fork much more transparent.

Add coin days

Most explorers have this. Thsi would also allow computing "standard minimum" network fee for a transaction and showing whether they paid more or less.

Handle block reorgs appropriately

This is mostly tough because testing it is somewhat tricky. Either setup complete testing infrastructure and mock everything (time consuming) or do a one off test with testnet in a box and three nodes.

Either way, to be fully featured this is completely necessary. Steps would be approximately:

  1. Check if highest indexed block hash is equal to what the RPC server has for that height.
  2. If not, go backwards and continue comparing until you get a match. Each block that doesn't match needs to:
    1. Be marked as Orphan
    2. Have all linked Transactions remove their block reference.
    3. Add new entry to the "seen in" many to many between blocks and transactions
    4. Update confirmation status of the Transaction (if we start caching this).
  3. Once common ancestor is reached sync as normal.

Doing this after #4 and #1 seems prudent.

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.