{"id":26562946,"url":"https://github.com/aelfproject/aelf-automation-test","last_synced_at":"2025-03-22T15:29:23.876Z","repository":{"id":37997332,"uuid":"144677500","full_name":"AElfProject/aelf-automation-test","owner":"AElfProject","description":"Automation test project for AElf","archived":false,"fork":false,"pushed_at":"2023-05-18T03:42:55.000Z","size":11036,"stargazers_count":6,"open_issues_count":0,"forks_count":9,"subscribers_count":10,"default_branch":"dev","last_synced_at":"2023-05-18T04:41:14.858Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AElfProject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-14T06:22:26.000Z","updated_at":"2022-01-11T02:48:02.000Z","dependencies_parsed_at":"2023-02-05T17:16:40.354Z","dependency_job_id":null,"html_url":"https://github.com/AElfProject/aelf-automation-test","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AElfProject%2Faelf-automation-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AElfProject%2Faelf-automation-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AElfProject%2Faelf-automation-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AElfProject%2Faelf-automation-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AElfProject","download_url":"https://codeload.github.com/AElfProject/aelf-automation-test/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244977835,"owners_count":20541744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-22T15:29:23.373Z","updated_at":"2025-03-22T15:29:23.851Z","avatar_url":"https://github.com/AElfProject.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aelf-automation-test\nAutomation test project for AElf\n\n## Config myget source URL to AElfProject\n```\nnuget sources Add -Name myget.org -Source https://www.myget.org/F/aelf-project-dev/api/v3/index.json\n```\n\n## Clone and build code\n``` \ngit clone https://github.com/AElfProject/aelf-automation-test\ncd ./aelf-automation-test\ndotnet build --configuration Release -o ./build-test-dir\n```\n\n## CLI tool\n- AElfChain.Console\n\n## Test scripts\n- AElf.Automation.Contracts.ScenarioTest\n- AElf.Automation.ContractsTesting\n- AElf.Automation.EconomicSystem.Tests\n- AElf.Automation.RpcPerformance\n- AElf.Automation.ScenariosExecution\n- AElf.Automation.SetTransactionFees\n- AElf.Automation.SideChainVerification\n\n## How to run\n\n### AElfChain.Console\nAElfChain.Console provide lots of convenient commands to help you check node status and transaction execution.\n\n## Feature\n\n 01. [``chain``]-Query block chain api\n 02. [``cross-chain-tx``]-Cross chain transactions\n 03. [``analyze``]-Analyze block chain blocks and transactions\n 04. [``call``]-Call contract view methods\n 05. [``send``]-Execute contract action methods\n 06. [``system-contracts``]-Query all system contracts\n 07. [``token-balance``]-Query token balance info\n 08. [``proposal``]-Query Proposal info by Id\n 09. [``consensus``]-Query current miners information\n 10. [``deploy``]-Deploy contract with authority permission\n 11. [``update``]-Update contract with authority permission\n 12. [``token-transfer``]-Transfer token to tester\n 13. [``resource``]-Resource buy and sell\n 14. [``connector``]-Set token connector\n 15. [``tx-fee``]-Get/Set transaction method fee\n 16. [``tx-limit``]-Get/Set transaction execution limit\n\n### AElf.Automation.RpcPerformance\nPerformance testing, you can run huge transactions to test node stability and transaction execution tps.\nFollowing are details about running step and how to configuration.\n\n1.Prepare test contract MultiToken to default directory\n```\nmkdir -p ~/.local/share/aelf/contracts\ncp AElf.Contracts.MultiToken.dll ~/.local/share/aelf/contracts\n```\n2.Add your nodes configuration setting files in directory ``bin/Debug/netcoreapp3.0/config``. All these information used to contract deployment proposal approve and prepare ELF token for transaction execution.\nSo you need to set node configurations and also you need to copy all nodes accounts into test directory ``bin/Debug/netcore3.0/aelf/keys``.    \n- Running standalone node, you just need to add one node settings in configuration. \n- Running multiple nodes, you need to set all nodes information to configuration. Test cannot execute authority transactions without nodes setting.\n \n```\n{\n  \"RequireAuthority\": true,\n  \"Nodes\": [\n    {\n      \"name\": \"stand-alone-node\",\n      \"endpoint\": \"127.0.0.1:8000\",\n      \"account\": \"G6eX2WYjeUXptQXs24QDSMiRHTMFG23PLKVFhLU1zek6SYjut\",\n      \"password\": \"123\"\n    }\n  ],\n  \"NativeTokenSymbol\" : \"ELF\",\n  \"DefaultPassword\": \"123\"\n}\n```\n \n3.Set ``rpc-performance.json`` to set transaction limit and testing mode.\n```\n{\n    \"GroupCount\": 4,\n    \"TransactionCount\": 30,\n    \"EnableRandomTransaction\": true,\n    \"ServiceUrl\": \"192.168.197.43:8100\",\n    \"SentTxLimit\": 100,\n    \"ExecuteMode\": 4,\n    \"Timeout\": 300,\n    \"RandomSenderTransaction\": true,\n    \"NodeTransactionLimit\": {\n        \"enable_limit\": true,\n        \"max_transactions_select\": 20\n    },\n    \"RequestRandomEndpoint\": {\n        \"enable_random\": true,\n        \"endpoint_list\": [\n            \"192.168.197.43:8100\",\n            \"192.168.197.15:8100\",\n            \"192.168.197.52:8100\"\n        ]\n    }\n}\n\n```\n*Adpot GroupCount and TransactionCount number can control transaction sent number frequency.*      \n*GroupCount*: how many threads to sent transaction.   \n*TransactionCount*: how many transactions sent each time in one thread.\n*EnableRandomTransaction*: set whether sent transaction with random number from arrange (1, TransactionCount).  \n*ServiceUrl*: node web api address and port to start execution.      \n*SentTxLimit*: if transaction hub have more than specified txs, test will wait and not send txs.   \n*RandomSenderTransaction*: sent transaction with sender are random, lot of transaction groups with set this value as true.\n*NodeTransactionLimit*: set node select transaction number in each block execution.\n*RequestRandomEndpoint*: set whether sent request to other endpoints.\n\n#### Usage:\n```\ndotnet AElf.Automation.RpcPerformance.dll //nodes.json is default value and can be ignored\ndotnet AElf.Automation.RpcPerformance.dll -c other-nodes.json\n```\n\n### AElf.Automation.ScenarioExecution\nScenario testing, test covered a lot of scenarios about contracts execution. Detail scenarios included please refer [document](https://github.com/AElfProject/aelf-automation-test/blob/dev/test/AElf.Automation.ScenariosExecution/ReadMe.md) introduction. \n1. Prepare nodes account files and copied to test script execution path ``./aelf/keys``.\n2. Modify scenario-nodes config  \nAccording test requirement, you can modify each test scenario interval and disable those scenarios you didn't want to run.\n3. Run command to start\n```\ndotnet AElf.Automation.ScenarioExecution.dll\ndotnet AElf.Automation.ScenarioExecution.dll -c nodes.json\n```\n#### Note:\nDue to long time running and user balance verification, all scenario test users are specified and would not used for other test. So for this test all testers are prepared and other accounts exclude node accounts and tester accounts, others are deleted automatically when propgram started.\nAnd you also no need to prepare test contracts, they are also prepared.\n\n### AElf.Automation.SetTransactionFees\nSet transaction fees for all system contract. This script will go through all system contract methods and set transaction method fee via authority. Except following methods not set due to design:\n```\n1. InitialAElfConsensusContract\n2. FirstRound\n3. NextRound\n4. AEDPoSContractStub.NextTerm\n5. UpdateValue\n6. UpdateTinyBlockInformation\n7. ClaimTransactionFees\n8. DonateResourceToken\n9. RecordCrossChainData\n10. ChargeTransactionFees\n11. CheckThreshold\n12. CheckResourceToken\n13. ChargeResourceToken\n```\nCommands:\n```\ndotnet AElf.Automation.SetTransactionFees -c nodes.json -e 127.0.0.1:8000 -a 50000000\n-c nodes config info\n-e endpoint connected to\n-a transaction fee amount\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faelfproject%2Faelf-automation-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faelfproject%2Faelf-automation-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faelfproject%2Faelf-automation-test/lists"}