def start(cdxjFilePath=INDEX_FILE, proxy=None):
hostPort = ipwbConfig.getIPWBReplayConfig()
app.proxy = proxy
if not hostPort:
ipwbConfig.setIPWBReplayConfig(IPWBREPLAY_IP, IPWBREPLAY_PORT)
hostPort = ipwbConfig.getIPWBReplayConfig()
if ipwbConfig.isDaemonAlive():
if cdxjFilePath == INDEX_FILE:
ipwbConfig.firstRun()
ipwbConfig.setIPWBReplayIndexPath(cdxjFilePath)
app.cdxjFilePath = cdxjFilePath
else:
print('Sample data not pulled from IPFS.')
print('Check that the IPFS daemon is running.')
try:
print('IPWB replay started on http://{0}:{1}'.format(
IPWBREPLAY_IP, IPWBREPLAY_PORT
))
app.run(host='0.0.0.0', port=IPWBREPLAY_PORT)
except gaierror:
print('Detected no active Internet connection.')
print('Overriding to use default IP and port configuration.')
app.run()
except socketerror:
print('Address {0}:{1} already in use!'.format(
IPWBREPLAY_IP, IPWBREPLAY_PORT))
sys.exit()
评论列表
文章目录