from core_symbol import CORE_SYMBOL def verifyBlockLog(expected_block_num, trimmedBlockLog): firstBlockNum = expected_block_num for block in trimmedBlockLog: assert 'block_num' in block, print( "ERROR: vectrum-blocklog didn't return block output") block_num = block['block_num'] assert block_num == expected_block_num expected_block_num += 1 Print("Block_log contiguous from block number %d to %d" % (firstBlockNum, expected_block_num - 1)) appArgs = AppArgs() args = TestHelper.parse_args({ "--dump-error-details", "--keep-logs", "-v", "--leave-running", "--clean-run" }) Utils.Debug = args.v pnodes = 2 cluster = Cluster(walletd=True) dumpErrorDetails = args.dump_error_details keepLogs = args.keep_logs dontKill = args.leave_running prodCount = 2 killAll = args.clean_run walletPort = TestHelper.DEFAULT_WALLET_PORT totalNodes = pnodes + 1
import json ############################################################### # nodeos_high_transaction_test # # This test sets up <-p> producing node(s) and <-n - -p> # non-producing node(s). The non-producing node will be sent # many transfers. When it is complete it verifies that all # of the transactions made it into blocks. # ############################################################### Print = Utils.Print appArgs = AppArgs() minTotalAccounts = 20 extraArgs = appArgs.add( flag="--transaction-time-delta", type=int, help= "How many seconds seconds behind an earlier sent transaction should be received after a later one", default=5) extraArgs = appArgs.add(flag="--num-transactions", type=int, help="How many total transactions should be sent", default=10000) extraArgs = appArgs.add(flag="--max-transactions-per-second", type=int, help="How many transactions per second should be sent", default=500)
# to the producing node. # 1) After 10 seconds a new node is started. # 2) the node is allowed to catch up to the producing node # 3) that node is killed # 4) restart the node # 5) the node is allowed to catch up to the producing node # 3) Repeat steps 2-5, <--catchup-count - 1> more times # ############################################################### Print=Utils.Print errorExit=Utils.errorExit from core_symbol import CORE_SYMBOL appArgs=AppArgs() extraArgs = appArgs.add(flag="--catchup-count", type=int, help="How many catchup-nodes to launch", default=10) extraArgs = appArgs.add(flag="--txn-gen-nodes", type=int, help="How many transaction generator nodes", default=2) args = TestHelper.parse_args({"--prod-count","--dump-error-details","--keep-logs","-v","--leave-running","--clean-run", "-p","--wallet-port"}, applicationSpecificArgs=appArgs) Utils.Debug=args.v pnodes=args.p if args.p > 0 else 1 startedNonProdNodes = args.txn_gen_nodes if args.txn_gen_nodes >= 2 else 2 cluster=Cluster(walletd=True) dumpErrorDetails=args.dump_error_details keepLogs=args.keep_logs dontKill=args.leave_running prodCount=args.prod_count if args.prod_count > 1 else 2 killAll=args.clean_run walletPort=args.wallet_port catchupCount=args.catchup_count if args.catchup_count > 0 else 1
import sys ############################################################### # ship_test # # This test sets up <-p> producing node(s) and <-n - -p> # non-producing node(s). One of the non-producing nodes # is configured with the state_history_plugin. An instance # of node will be started with a client javascript to exercise # the SHiP API. # ############################################################### Print=Utils.Print appArgs = AppArgs() extraArgs = appArgs.add(flag="--num-requests", type=int, help="How many requests that each ship_client requests", default=1) extraArgs = appArgs.add(flag="--num-clients", type=int, help="How many ship_clients should be started", default=1) args = TestHelper.parse_args({"-p", "-n","--dump-error-details","--keep-logs","-v","--leave-running","--clean-run"}, applicationSpecificArgs=appArgs) Utils.Debug=args.v totalProducerNodes=args.p totalNodes=args.n if totalNodes<=totalProducerNodes: totalNodes=totalProducerNodes+1 totalNonProducerNodes=totalNodes-totalProducerNodes totalProducers=totalProducerNodes cluster=Cluster(walletd=True) dumpErrorDetails=args.dump_error_details keepLogs=args.keep_logs dontKill=args.leave_running