From 66666e11670371b439455e5568f459e5aabfe676 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Fri, 14 Feb 2020 12:55:45 -0500 Subject: [PATCH] script to generate blockchain test data --- scripts/generate_blockchain_test_data.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/scripts/generate_blockchain_test_data.py b/scripts/generate_blockchain_test_data.py index 573b28f9b..2fb0fa38a 100644 --- a/scripts/generate_blockchain_test_data.py +++ b/scripts/generate_blockchain_test_data.py @@ -7,18 +7,17 @@ async def main(): print(f'Generating: {chain.data_path}') await chain.ensure() await chain.start() - chain.subscribe() await chain.generate(200) - await chain.on_block.where(lambda e: e['msg'] == 199) - await chain.claim_name(f'foo', 'beef' * 4000, '0.001') - await chain.generate(1) - await chain.stop(False) - - await asyncio.sleep(3) # give lbrycrd time to stop - - await chain.start('-reindex') - await chain.generate(1) - await chain.stop(False) + step = 10 + for block in range(200): + for i in range(0, 200, step): + print(f'claim-{block}-{i}-{i + step}') + await asyncio.gather(*( + chain.claim_name(f'claim-{block}-{i + tx}', 'beef' * 4000, '0.001') + for tx in range(1, step + 1) + )) + await chain.generate(5) + print('done!') asyncio.run(main())