hyperledger / indy-node

The server portion of a distributed ledger purpose-built for decentralized identity.
https://wiki.hyperledger.org/display/indy
Apache License 2.0
680 stars 652 forks source link

Indy Node Performance Script Check Genesis Error #1845

Closed SuryaSHalwasia closed 3 months ago

SuryaSHalwasia commented 4 months ago

Here's the error Traceback (most recent call last): File "perf_processes.py", line 454, in check_genesis loop.run_until_complete(pool.create_pool_ledger_config(pool_name, pool_cfg)) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/home/ubuntu/.local/lib/python3.8/site-packages/indy/pool.py", line 36, in create_pool_ledger_config res = await do_call('indy_create_pool_ledger_config', indy.error.CommonInvalidStructure

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "perf_processes.py", line 505, in check_genesis(dict_args["genesis_path"]) File "perf_processes.py", line 457, in check_genesis raise argparse.ArgumentTypeError(ex) argparse.ArgumentTypeError

Its caused by this line def check_genesis(gen_path): loop = asyncio.get_event_loop() pool_cfg = json.dumps({"genesis_txn": gen_path}) poolname = "pool{}".format(random_string(24)) loop.run_until_complete(pool.set_protocol_version(2)) try: loop.run_until_complete(pool.create_pool_ledger_config(pool_name, pool_cfg)) pool_handle = loop.run_until_complete(pool.open_pool_ledger(pool_name, None)) except Exception as ex: raise argparse.ArgumentTypeError(ex)

I have provided the pool_transaction_genesis of my hosted von-network. Why exactly is this error coming and how should i fix it? Thanks

WadeBarnes commented 4 months ago

Can you please provide the steps you are following that lead up to the reported error message. Thanks.

SuryaSHalwasia commented 3 months ago

Extremely sorry for my late response. Earlier I had provided the genesis file for my von-network. Now, basically I started a indy-node using the indy-node script. In the scripts/performance/perf-load Im running the perf-processes with the genesis transaction path in the sandbox. I have fixed some json parsing errors and now am getting

Traceback (most recent call last): File "perf_processes.py", line 451, in check_genesis loop.run_until_complete(pool.create_pool_ledger_config(pool_name, pool_cfg)) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/usr/local/lib/python3.8/dist-packages/indy/pool.py", line 36, in create_pool_ledger_config res = await do_call('indy_create_pool_ledger_config', indy.error.CommonInvalidStructure

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "perf_processes.py", line 500, in check_genesis(dict_args["genesis_path"]) File "perf_processes.py", line 454, in check_genesis raise argparse.ArgumentTypeError(ex) argparse.ArgumentTypeError

I have not made any change to the program or any other file. Thanks for your help and sorry again for my late response.

WadeBarnes commented 3 months ago

Please provide the steps you are following that lead up to the reported error messages; "Step to Reproduce". Thanks.

SuryaSHalwasia commented 3 months ago
  1. So I started an indy-node using generate_indy_pool_transactions. I create a single node for testing.
  2. I'm in the scripts/performance/perf_load. I started the python3 perf_processes.py -n 1000 -k nym.
  3. In the perf_processes I changed ~/.indy-cli/networks/sandbox/pool_transactions_genesis to ~/../var/lib/indy/sandbox/pool_transactions_genesis where my genesis file is stored. So, these were my steps.
WadeBarnes commented 3 months ago
  1. So I started an indy-node using generate_indy_pool_transactions. I create a single node for testing.

Single node? Or, single pool (network)? You need at least 4 nodes to form a functional pool (network).

SuryaSHalwasia commented 3 months ago

I also tried with a hosted von-network with 4 nodes and go the same error. Earlier I created a folder ~/.indy-cli/networks/sandbox/ and put the transaction genesis file of my hosted von-network but got the error

Traceback (most recent call last): File "perf_processes.py", line 454, in check_genesis loop.run_until_complete(pool.create_pool_ledger_config(pool_name, pool_cfg)) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/home/ubuntu/.local/lib/python3.8/site-packages/indy/pool.py", line 36, in create_pool_ledger_config res = await do_call('indy_create_pool_ledger_config', indy.error.CommonInvalidStructure

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "perf_processes.py", line 505, in check_genesis(dict_args["genesis_path"]) File "perf_processes.py", line 457, in check_genesis raise argparse.ArgumentTypeError(ex) argparse.ArgumentTypeError

Its caused by this line def check_genesis(gen_path): loop = asyncio.get_event_loop() pool_cfg = json.dumps({"genesis_txn": gen_path}) poolname = "pool{}".format(random_string(24)) loop.run_until_complete(pool.set_protocol_version(2)) try: loop.run_until_complete(pool.create_pool_ledger_config(pool_name, pool_cfg)) pool_handle = loop.run_until_complete(pool.open_pool_ledger(pool_name, None)) except Exception as ex: raise argparse.ArgumentTypeError(ex)

Thanks

WadeBarnes commented 3 months ago

The format of a genesis file can throw things off very easily. The most common issue is CrLf line endings. The code is very particular and will only accept Lf line endings in the genesis file. Also watch for line breaks. Each pool transaction (4 in the case of von-network) should be on it's own line and not be broken up by any line breaks, or contain any whitespace.

SuryaSHalwasia commented 3 months ago

Okay I'll try again. Thanks.

SuryaSHalwasia commented 3 months ago

So I got the genesis file right. But now there is no error but the script just runs without any success or failure. I'm sure the ledger is running cause earlier I had gotten pool connection timeout errors. The script just runs until i forcefully quit with 0 success 0 failure. Version 1.2.0 Number of client 4 Path to genesis txns file /root/../var/lib/indy/sandbox/pool_transactions_genesis Seed ['000000000000000000000000Trustee1'] Batch size 1000 Request kind nym Refresh rate, sec 10 Pregenerated reqs cnt 30 Output directory ./load_test_20240315_161322 Value Separator | Wallet Key key Started At 2024-03-15 16:13:22.478013 Mode processes Sync mode freeflow Pool config None Load rate batches per sec 10.0 Ext settings None Save short statistics False 2944.08 Clients 0/4 Sent: 0 Succ: 0 Failed: 0 Nacked: 0 Rejected: 0

Thanks

WadeBarnes commented 3 months ago

You'll have to play around with the input parameters a little bit. Try reducing the number of transactions to start.

I find you typically have to specify:

SuryaSHalwasia commented 3 months ago

Thanks the program is working. However I'm only able to make it for locally running von-networks. Is there a port I should open for the client so I can connect it to von-network running on cloud? Thanks

WadeBarnes commented 3 months ago

You would need to use the genesis file for the network you'd like to test. For ports, Indy uses anything in the range of 9700 to 9799. The exact ports depend on the network and the nodes on that network. Please DO NOT run performance tests against any of the BCovrin Ledgers such as BCovrin Text (http://test.bcovrin.vonx.io/). The performance tests can add 10s to 100s of thousands of transactions to a Ledger bloating it unnecessarily.

SuryaSHalwasia commented 3 months ago

Okay thanks for your help.