electrumx/electrumx_server.py
Lex Berezhny 29289004e7 electrumx package (#511)
* moved wallet, server, lib into electrumx main module

* fixed imports and other path references affected by electrumx main package

* fixing formatting to pass the pycodetest on travis
2018-07-10 07:28:04 +08:00

36 lines
892 B
Python
Executable File

#!/usr/bin/env python3
#
# Copyright (c) 2016, Neil Booth
#
# All rights reserved.
#
# See the file "LICENCE" for information about the copyright
# and warranty status of this software.
'''Script to kick off the server.'''
import logging
import traceback
from electrumx.server.env import Env
from electrumx.server.controller import Controller
def main():
'''Set up logging and run the server.'''
log_fmt = Env.default('LOG_FORMAT', '%(levelname)s:%(name)s:%(message)s')
logging.basicConfig(level=logging.INFO, format=log_fmt)
logging.info('ElectrumX server starting')
try:
controller = Controller(Env())
controller.run()
except Exception:
traceback.print_exc()
logging.critical('ElectrumX server terminated abnormally')
else:
logging.info('ElectrumX server terminated normally')
if __name__ == '__main__':
main()