Exemplo n.º 1
0
from db import startup
from router import app
import logging.config

#Start DB
startup()

#Start Logger
logging.config.fileConfig('logging.conf')

#Init flask app
print("Starting flask")
if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000)


Exemplo n.º 2
0
def run_blockchain():
    sync.sync_overall()


if __name__ == '__main__':
    sync.sync_overall()

    from apscheduler.schedulers.background import BackgroundScheduler
    sched = BackgroundScheduler(standalone=True)

    mine.sched = sched
    sched.add_job(mine.mine_for_block,
                  kwargs={
                      'rounds': STANDARD_ROUNDS,
                      'start_nonce': 0
                  },
                  id='mining')  # add the block again
    sched.add_listener(mine.mine_for_block_listener,
                       apscheduler.events.EVENT_JOB_EXECUTED)  # , args=sched)
    sched.start()

    parser = ArgumentParser()
    parser.add_argument('-p',
                        '--port',
                        default=5000,
                        type=int,
                        help='port to listen on')
    args = parser.parse_args()
    port = args.port
    app.run(host='127.0.0.1', port=port)
Exemplo n.º 3
0
from router import app

if __name__ == "__main__":
    app.run()
Exemplo n.º 4
0
from router import app


if __name__ == '__main__':
    app.run(debug=True, threaded=False)
Exemplo n.º 5
0
from router import app

if __name__ == '__main__':
    app.run(port=8080)
Exemplo n.º 6
0
from router import app as application

if __name__ == "__main__":
    application.run()
Exemplo n.º 7
0
# -*- coding: utf-8 -*-
from router import app



if __name__ == "__main__":
    app.run()
Exemplo n.º 8
0
from router import app

app.run(port="5000")
Exemplo n.º 9
0
from router import app

if __name__ == "__main__":
    app.run(debug=True)
Exemplo n.º 10
0
if __name__ == '__main__':
    from argparse import ArgumentParser
    from router import app

    parser = ArgumentParser()
    parser.add_argument('-p',
                        '--port',
                        default=5000,
                        type=int,
                        help='port to listen on')
    args = parser.parse_args()
    port = args.port

    app.run(host='127.0.0.1', port=port, debug=True)