def __init__(self, q_new_transaction): self._q_new_transaction = q_new_transaction self.q_new_transaction = None self.q_tx_to_validate = mp.Queue() self.q_tx_validated = mp.Queue() self.q_tx_delete = mp.Queue() self.q_block = mp.Queue() self.initialized = mp.Event() self.monitor = Monitor()
def __init__(self, q_new_transaction): """ Initialize the class with the needed """ self._q_new_transaction = q_new_transaction self.q_new_transaction = None self.q_tx_to_validate = mp.Queue() self.q_tx_validated = mp.Queue() self.q_tx_delete = mp.Queue() self.q_block = mp.Queue() self.initialized = mp.Event() self.monitor = Monitor()
def __init__(self, q_new_block): """ Initialize the class with the needed queues. Initialize with a queue where new blocks added to the bigchain will be put """ self.monitor = Monitor() self.q_new_block = q_new_block self.q_blocks_to_validate = mp.Queue() self.q_validated_block = mp.Queue() self.q_voted_block = mp.Queue() self.v_previous_block_id = mp.Value(ctypes.c_char_p) self.initialized = mp.Event()
def create_app(settings): """Return an instance of the Flask application. Args: debug (bool): a flag to activate the debug mode for the app (default: False). """ app = Flask(__name__) app.debug = settings.get('debug', False) app.config['bigchain_pool'] = util.pool(Bigchain, size=settings.get('threads', 4)) app.config['monitor'] = Monitor() app.register_blueprint(info_views, url_prefix='/') app.register_blueprint(transaction_views, url_prefix='/api/v1') return app
def create_app(*, debug=False, threads=4): """Return an instance of the Flask application. Args: debug (bool): a flag to activate the debug mode for the app (default: False). threads (int): number of threads to use Return: an instance of the Flask application. """ app = Flask(__name__) app.debug = debug app.config['bigchain_pool'] = util.pool(Bigchain, size=threads) app.config['monitor'] = Monitor() app.register_blueprint(info_views, url_prefix='/') app.register_blueprint(transaction_views, url_prefix='/api/v1') return app
def create_app(*, debug=False, threads=4): """Return an instance of the Flask application. Args: debug (bool): a flag to activate the debug mode for the app (default: False). threads (int): number of threads to use Return: an instance of the Flask application. """ app = Flask(__name__) app.debug = debug app.config['bigchain_pool'] = utils.pool(Bigchain, size=threads) app.config['monitor'] = Monitor() add_routes(app) return app
def create_app(settings): """Return an instance of the Flask application. Args: debug (bool): a flag to activate the debug mode for the app (default: False). """ app = Flask(__name__) app.debug = settings.get('debug', False) app.config['bigchain_pool'] = util.pool(Bigchain, size=settings.get('threads', 4)) app.config['monitor'] = Monitor() #welcome view app.register_blueprint(info_views, url_prefix='/') #transaction operate view app.register_blueprint(transaction_views, url_prefix='/uniledger/v1/transaction') #block operate view app.register_blueprint(block_views, url_prefix='/uniledger/v1/block') #vote operate view app.register_blueprint(vote_views, url_prefix='/uniledger/v1/vote') #timestat operate view app.register_blueprint(timestat_views, url_prefix='/uniledger/v1/timestat') app.register_blueprint(condition_views, url_prefix='/uniledger/v1/condition') app.register_blueprint(contract_views, url_prefix='/uniledger/v1/contract') app.register_blueprint(bordertrade_views, url_prefix='/uniledger/v1/bordertrade') app.register_blueprint(acount_views, url_prefix='/uniledger/v1/account') return app
import logging import multiprocessing as mp import queue import rethinkdb as r import bigchaindb from bigchaindb import Bigchain from bigchaindb.monitor import Monitor logger = logging.getLogger(__name__) monitor = Monitor() class Block(object): def __init__(self, q_new_transaction): """ Initialize the class with the needed """ self._q_new_transaction = q_new_transaction self.q_new_transaction = None self.q_tx_to_validate = mp.Queue() self.q_tx_validated = mp.Queue() self.q_tx_delete = mp.Queue() self.q_block = mp.Queue() self.initialized = mp.Event() def filter_by_assignee(self): """ Handle transactions that are assigned to me