From 67c8bba17b620cfe3b47a9b0f3e8b039bc3936c8 Mon Sep 17 00:00:00 2001 From: Sylvain Bellemare Date: Wed, 15 Nov 2017 16:37:10 +0100 Subject: [PATCH] Parametrize tendermint endpoint based on env vars --- bigchaindb/tendermint/lib.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bigchaindb/tendermint/lib.py b/bigchaindb/tendermint/lib.py index 4f2e2aae..5b0f1bdb 100644 --- a/bigchaindb/tendermint/lib.py +++ b/bigchaindb/tendermint/lib.py @@ -1,7 +1,8 @@ -from copy import deepcopy -from uuid import uuid4 import logging from collections import namedtuple +from copy import deepcopy +from os import getenv +from uuid import uuid4 import requests @@ -14,7 +15,9 @@ from bigchaindb.tendermint.utils import encode_transaction logger = logging.getLogger(__name__) -ENDPOINT = 'http://localhost:46657/' +TENDERMINT_HOST = getenv('TENDERMINT_HOST', 'localhost') +TENDERMINT_PORT = getenv('TENDERMINT_PORT', '46657') +ENDPOINT = 'http://{}:{}/'.format(TENDERMINT_HOST, TENDERMINT_PORT) class BigchainDB(Bigchain):