chromaway/ngcccbase

a library for retrieval of Bitcoin data

Opened this issue · 0 comments

Currently we have coloredcoinlib/blockchain.py and ngcccbase.services.electrum.*

This is less than ideal because:

  1. code is scattered
  2. it is synchronous, which sucks
  3. we'd like to do more things, like fetch blocks using Bitcoin protocol directly, use obelisk and so on

I'd like to move all this stuff into a library and make nice sync/async front-end.

E.g. it can be implemented through queues: main thread sends a command into queue, separate thread pool executes command, sends results into result queue. Main thread retrieves results and proceeds.

Later we can make use of asynchronous processing (i.e. process results when they arrive), but code which implements complex logic can continue using synchronous API.

I think we shouldn't use twisted in the main thread, queues would be enough.

However, library code which runs in separate thread can use twisted reactor.

This is a huge task, so I'd like to get opinions first.