From 2d0e83657ef12882432c6a5cde6fc4672d8d713f Mon Sep 17 00:00:00 2001 From: Sylvain Bellemare Date: Fri, 12 Jan 2018 16:33:08 +0100 Subject: [PATCH] Parametrize host and port used by event stream closes #1994 --- bigchaindb/tendermint/event_stream.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bigchaindb/tendermint/event_stream.py b/bigchaindb/tendermint/event_stream.py index 7398e86f..765fb190 100644 --- a/bigchaindb/tendermint/event_stream.py +++ b/bigchaindb/tendermint/event_stream.py @@ -2,6 +2,7 @@ import asyncio import json import logging import time +from os import getenv import aiohttp @@ -10,8 +11,8 @@ from bigchaindb.events import EventTypes, Event from bigchaindb.tendermint.utils import decode_transaction_base64 -HOST = 'localhost' -PORT = 46657 +HOST = getenv('TENDERMINT_HOST', 'localhost') +PORT = int(getenv('TENDERMINT_PORT', 46657)) URL = f'ws://{HOST}:{PORT}/websocket' logger = logging.getLogger(__name__)