[Feature] Create CI Job Which Runs Devnet.sh
Introduction
In this feature, we will create a Continuous Integration (CI) job that runs the devnet.sh
script. This job will be added to the .circleci/config.yml
file and will be used to test the functionality of our application. The job will be designed to run on a large machine with 4 validators, 2 clients, and a maximum runtime of 15 minutes. We will also configure the job to check whether the network has advanced at least X blocks on all 6 nodes.
Why is this Feature Important?
This feature is important because it will help us catch issues with our application early on. By running the devnet.sh
script as part of our CI pipeline, we can ensure that our application is functioning correctly and that any issues are identified and fixed before they make it to production.
Adding the CI Job to .circleci/config.yml
To add the CI job to the .circleci/config.yml
file, we will need to add a new job to the file. The job will be called devnet
and will be configured to run on a large machine with 4 validators, 2 clients, and a maximum runtime of 15 minutes.
version: 2.1
jobs:
devnet:
docker:
- image: circleci/node:14
steps:
- checkout
- run: |
./devnet.sh
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8545
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8546
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8547
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8548
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8549
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8550
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8551
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8552
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8553
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8554
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8555
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8556
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8557
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8558
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8559
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8560
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8561
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8562
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8563
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8564
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8565
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8566
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8567
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8568
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8569
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8570
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8571
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8572
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8573
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8574
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8575
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8576
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8577
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8578
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8579
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8580
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8581
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8582
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8583
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8584
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8585
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8586
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8587
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8588
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8589
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8590
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8591
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8592
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8593
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8594
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8595
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8596
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8597
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8598
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8599
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8600
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8601
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8602
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8603
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8604
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8605
- run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost<br/>
**Q&A: Creating a CI Job to Run devnet.sh**
=============================================
**Q: What is the purpose of creating a CI job to run devnet.sh?**
---------------------------------------------------------
A: The purpose of creating a CI job to run devnet.sh is to ensure that our application is functioning correctly and that any issues are identified and fixed before they make it to production. By running the devnet.sh script as part of our CI pipeline, we can catch issues early on and prevent them from causing problems later on.
**Q: What are the parameters for the CI job?**
--------------------------------------------
A: The parameters for the CI job are:
* Large machine
* 4 validators
* 2 clients
* Maximum runtime of 15 minutes
* Mainnet
* Check whether the network has advanced at least X blocks on all 6 nodes
**Q: Why do we need to check whether the network has advanced at least X blocks on all 6 nodes?**
-----------------------------------------------------------------------------------------
A: We need to check whether the network has advanced at least X blocks on all 6 nodes because it will help us determine whether the network is functioning correctly. If the network has not advanced at least X blocks on all 6 nodes, it may indicate a problem with the network.
**Q: How do we determine what is highly likely to be reached in this timeframe on this machine to avoid false negatives?**
----------------------------------------------------------------------------------------------------------------
A: We can determine what is highly likely to be reached in this timeframe on this machine by analyzing the performance of the machine and the network. We can also use tools such as load testing and stress testing to simulate a large number of users and determine how the network will perform under heavy load.
**Q: What happens if the network does not advance after 15 minutes?**
----------------------------------------------------------------
A: If the network does not advance after 15 minutes, the CI job will timeout and the build will fail. We can also configure the CI job to wait for a longer period of time or to force a timeout in the curl script.
**Q: How do we configure the CI job to wait for a longer period of time or to force a timeout in the curl script?**
----------------------------------------------------------------------------------------------------------------
A: We can configure the CI job to wait for a longer period of time by adding a `wait` command to the script. We can also configure the CI job to force a timeout in the curl script by adding a `timeout` command to the script.
**Q: What are the benefits of creating a CI job to run devnet.sh?**
---------------------------------------------------------
A: The benefits of creating a CI job to run devnet.sh are:
* Early detection of issues
* Prevention of problems later on
* Improved reliability and stability of the network
* Reduced downtime and increased productivity
**Q: How do we implement the CI job to run devnet.sh?**
---------------------------------------------------
A: We can implement the CI job to run devnet.sh by adding a new job to the `.circleci/config.yml` file. We can then configure the job to run on a large machine with 4 validators, 2 clients, and a maximum runtime of 15 minutes. We can also configure the job to check whether the network has advanced at least X blocks on all 6 nodes.
**Q: What are the next steps after implementing the CI job to run devnet.sh?**
-------------------------------------------------------------------------
A: After implementing the CI job to run devnet.sh, we can monitor the performance of the network and make adjustments as needed. We can also use the CI job to identify and fix issues early on, which will help to improve the reliability and stability of the network.