From b8d74dab6a4bf670bd6c0e500402757660300a9b Mon Sep 17 00:00:00 2001 From: Narasimha Sai Date: Thu, 13 May 2021 18:49:17 +0530 Subject: [PATCH] added Tatum --- pending_transactions.py | 1 + provider_benchmark.py | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pending_transactions.py b/pending_transactions.py index d798d0a..5210af6 100644 --- a/pending_transactions.py +++ b/pending_transactions.py @@ -26,6 +26,7 @@ def transactionsTest(web3, company): for i in range(config.ITERATIONS): signed_txn = web3.eth.account.signTransaction({ 'to': recieveAccount.address, + 'chainId': web3.eth.chainId, 'gasPrice':web3.eth.gasPrice, 'nonce': nonce + i, 'gas': 100000, diff --git a/provider_benchmark.py b/provider_benchmark.py index 3111f94..90dba5b 100644 --- a/provider_benchmark.py +++ b/provider_benchmark.py @@ -10,6 +10,7 @@ def parseArgs(): parser = argparse.ArgumentParser() parser.add_argument('-i', action='store', dest='infura_api_key', help='test Infura with your unique API key') + parser.add_argument('-t', action='store', dest='tatum_api_key', help='test Tatum with your unique API key') parser.add_argument('-a', action='store', dest='alchemy_api_key', help="test Alchemy with your unique API key") parser.add_argument('-c', '--cloudflare', action='store_true', help="test Cloudflare") parser.add_argument('-n', action='store', dest='node_http_instance', help="test a specific node with an http instance") @@ -66,12 +67,20 @@ def node(tests, args): web3 = Web3(Web3.HTTPProvider(args.node_http_instance)) runTests(web3, "ETH Node", tests) +def tatum(tests, args): + if args.http: + if args.mainnet: + web3 = Web3(Web3.HTTPProvider("https://api-eu1.tatum.io/v3/ethereum/web3/"+args.tatum_api_key)) + else: + web3 = Web3(Web3.HTTPProvider("https://api-eu1.tatum.io/v3/ethereum/web3/"+args.tatum_api_key)) + runTests(web3, "Tatum", tests) + if __name__ == '__main__': args = parseArgs() config.VERBOSE = args.verbose - if args.infura_api_key is None and args.alchemy_api_key is None and not args.cloudflare and args.node_http_instance is None: + if args.infura_api_key is None and args.alchemy_api_key is None and not args.cloudflare and args.node_http_instance is None and args.tatum_api_key is None: print ("provider_benchmark.py: error: must specify companies to test, use -h for help") sys.exit() @@ -90,9 +99,10 @@ def node(tests, args): threads.append(Process(target=cloudflare, args=(tests, args))) if args.node_http_instance: threads.append(Process(target=node, args=(tests, args))) + if args.tatum_api_key: + threads.append(Process(target=tatum, args=(tests,args))) for t in threads: t.start() for t in threads: t.join() -