mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Use the client to do the loadtest
This commit is contained in:
parent
891289ed66
commit
d5af7a641d
@ -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'])
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user