diff --git a/bigchaindb/client.py b/bigchaindb/client.py index 67ce51a9..fcf1a7f8 100644 --- a/bigchaindb/client.py +++ b/bigchaindb/client.py @@ -1,7 +1,6 @@ import requests import bigchaindb -from bigchaindb import util from bigchaindb import config_utils from bigchaindb import exceptions from bigchaindb import crypto @@ -112,5 +111,5 @@ def temp_client(): """ private_key, public_key = crypto.generate_key_pair() - return Client(private_key=private_key, public_key=public_key, api_endpoint='http://localhost:5000/api/v1') + return Client(private_key=private_key, public_key=public_key, api_endpoint=bigchaindb.config['api_endpoint']) diff --git a/bigchaindb/commands/bigchain_benchmark.py b/bigchaindb/commands/bigchain_benchmark.py index 2bac4c08..120987d6 100644 --- a/bigchaindb/commands/bigchain_benchmark.py +++ b/bigchaindb/commands/bigchain_benchmark.py @@ -7,23 +7,21 @@ import logstats import bigchaindb import bigchaindb.config_utils from bigchaindb.util import ProcessGroup +from bigchaindb.client import temp_client from bigchaindb.commands.utils import base_parser, start logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) -USER_PUBLIC_KEY = 'qZAN9Ngs1v4qP1T5UBYw75M5f2ej7mAJx8gBMF4BBWtZ' - def _run_load(tx_left, stats): logstats.thread.start(stats) - b = bigchaindb.Bigchain() + client = temp_client() + # b = bigchaindb.Bigchain() while True: - tx = b.create_transaction(b.me, USER_PUBLIC_KEY, None, 'CREATE') - tx_signed = b.sign_transaction(tx, b.me_private) - b.write_transaction(tx_signed) + tx = client.create() stats['transactions'] += 1