mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00

* add timestamp to transaction assignment * add reassignment delay to configuration * refactor to multipipes * # This is a combination of 7 commits. # The first commit's message is: stale transaction monitor and tests # The 2nd commit message will be skipped: # simplify logic # The 3rd commit message will be skipped: # node will assign to self # The 4th commit message will be skipped: # block listens for insert and update # The 5th commit message will be skipped: # more test coverage # The 6th commit message will be skipped: # test coverage # The 7th commit message will be skipped: # test coverage * stale transaction monitor and tests * update operation only returns new value
47 lines
1.5 KiB
Python
47 lines
1.5 KiB
Python
import logging
|
|
import multiprocessing as mp
|
|
|
|
import bigchaindb
|
|
from bigchaindb.pipelines import vote, block, election, stale
|
|
from bigchaindb.web import server
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
BANNER = """
|
|
****************************************************************************
|
|
* *
|
|
* Initialization complete. BigchainDB is ready and waiting for events. *
|
|
* You can send events through the API documented at: *
|
|
* - http://docs.bigchaindb.apiary.io/ *
|
|
* *
|
|
* Listening to client connections on: {:<15} *
|
|
* *
|
|
****************************************************************************
|
|
"""
|
|
|
|
|
|
def start():
|
|
logger.info('Initializing BigchainDB...')
|
|
|
|
# start the processes
|
|
logger.info('Starting block')
|
|
block.start()
|
|
|
|
logger.info('Starting voter')
|
|
vote.start()
|
|
|
|
logger.info('Starting stale transaction monitor')
|
|
stale.start()
|
|
|
|
logger.info('Starting election')
|
|
election.start()
|
|
|
|
# start the web api
|
|
app_server = server.create_server(bigchaindb.config['server'])
|
|
p_webapi = mp.Process(name='webapi', target=app_server.run)
|
|
p_webapi.start()
|
|
|
|
# start message
|
|
logger.info(BANNER.format(bigchaindb.config['server']['bind']))
|