Running AMM benchmarking tests
Was this helpful?
INFO
The following section aims to help us run benchmarking tests on the Eclipse Network.
Essentially, we want to test the performance of the Eclipse Network by obtaining the transactions per second (TPS) that the network can handle and its latency.
You will have to have nodejs installed on your machine. You can install it from here.
Now, once you have that ready, you will have to clone our benchmarking repository. You can do that by running the following command:
git clone https://github.com/Eclipse-Laboratories-Inc/eclipse-benchmarking/To do this you will also have to ensure that git is installed. You can install it from here.
To run the benchmarking tests, you will first have to navigate to the token_swap folder after cloning the repository.
First we need to install ts-node. To do this, run the following command:
npm i -g ts-nodeWARNING
You might have to give super user or admin permissions to install globally or use the -g flag.
Now we need to install the dependencies. To do this, run the following command:
Make sure to run this command inside the token_swap folder.
Now, the final step is to run the benchmarking tests using the following command:
This runs 10 instances of an AMM performing any specified number of swaps.
To modify the number of swaps, we will have to modify the benchmark.ts file inside the token_swap folder.
The following is the code snippet that we will have to modify:
Here we can change the specified number of swaps. The default is 275.
The above code snippet is located at line 63 in the benchmark.ts file.
If all the steps are followed correctly, you should see an output similar to the following:

Was this helpful?
Was this helpful?
npm its-node spam.ts...
await mintTo(connection, payer, mintA, userAccountA, owner, SWAP_AMOUNT_IN);
console.log("Run test: benchmark swap");
await benchmarkSwap(275);
console.log("Success\n");