Skip to content

Commit 5d7660e

Browse files
authored
Merge pull request #19 from meleksabit/docs/readme-file
docs: add Mainnet and Network Options to README
2 parents ae27cb2 + 43f9131 commit 5d7660e

File tree

1 file changed

+43
-3
lines changed

1 file changed

+43
-3
lines changed

README.md

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,47 @@ This section outlines the repository’s directory structure to help you navigat
375375
```
376376
- For more details, see the AWS Secrets Manager documentation: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html.
377377

378-
3. **IAM Role (`TerraformCloudRole`)**:
378+
3. **Configure Blockchain Network**:
379+
Set the blockchain network for the `blockchain-monitor` and `ai-agent` services using the `NETWORK` environment variable. Supported networks are:
380+
381+
- **mainnet**: Ethereum mainnet (production, requires Infura API key with mainnet access).
382+
- **sepolia**: Sepolia testnet (default, recommended for testing).
383+
- **holesky**: Holesky testnet (alternative testnet for validator and staking tests).
384+
- **hoodi**: Hoodi testnet (new testnet for Pectra upgrade testing).
385+
- **local**: Local Ethereum node (e.g., Hardhat, Ganache) for development.
386+
387+
<table>
388+
<tr>
389+
<th>⚠️ⓘ❗ <b>NOTE</b></th>
390+
</tr>
391+
<tr>
392+
<td width="33%"">
393+
Obtain an Infura API key by creating an account at <b><i>[infura.io](https://infura.io) (MetaMask wallet login supported)</b></i>. Avoid using MetaMask’s default Infura key due to rate limits, as it is shared and heavily restricted. Using mainnet incurs <b><i>higher Infura API costs</b></i> and interacts with <b><i>real</b></i> Ethereum transactions. Ensure your Infura API key supports mainnet and testnet access and use <b><i>cautiously</b></i> in production environments.
394+
</td>
395+
</tr>
396+
</table>
397+
398+
### To configure the network:
399+
400+
1. **Set the NETWORK environment variable**:
401+
- For local testing:
402+
```bash
403+
export NETWORK=<mainnet|sepolia|holesky|hoodi|local>
404+
```
405+
- For EKS deployment, update Helm values:
406+
```bash
407+
helm upgrade --install blockchain-monitor ./helm/go-microservices/blockchain-monitor --set env.NETWORK=<mainnet|sepolia|holesky|hoodi|local>
408+
helm upgrade --install ai-agent ./helm/ai-agent --set env.NETWORK=<mainnet|sepolia|holesky|hoodi|local>
409+
```
410+
2. **Verify network configuration**:
411+
- Check the `/health` endpoint for each service:
412+
```bash
413+
curl http://<blockchain-monitor-load-balancer>:8081/health
414+
curl http://<ai-agent-load-balancer>:8000/health
415+
```
416+
- Ensure the `network` field matches the configured value.
417+
418+
4. **IAM Role (`TerraformCloudRole`)**:
379419
- Ensure trust policy allows Terraform Cloud user:
380420
```json
381421
{
@@ -391,7 +431,7 @@ This section outlines the repository’s directory structure to help you navigat
391431
```
392432
- Permissions: EKS, EC2, ELB, ECR, IAM, S3, RDS.
393433

394-
4. **Optimize Uploads**:
434+
5. **Optimize Uploads**:
395435
- To optimize uploads in Terraform Cloud, it’s recommended to create a `.terraformignore` file in the project root to exclude unnecessary files, reducing upload size and speeding up Terraform runs. Create the file with the following content:
396436
```hcl
397437
# .terraformignore
@@ -573,7 +613,7 @@ Infrastructure is managed in the `terraform/` folder:
573613
- Check security group allows EKS access (port 3306 for MySQL, 5432 for PostgreSQL).
574614

575615
> [!IMPORTANT]
576-
> - **Ethereum Testnet**: Uses Infura for blockchain data.
616+
> - **Ethereum Networks**: Supports `mainnet`, `Sepolia` (default), `Holesky`, `Hoodi`, and `local` networks. Set `NETWORK` environment variable to configure (see **Setup > Configure Blockchain Network**).
577617
> - **CI/CD**: Jenkins pipeline builds/pushes images to ECR and deploys to EKS.
578618
> - **Health Checks**: Ensure probes are configured per service.
579619
> - **Region**: `eu-central-1` (Frankfurt) is the default region for all AWS resources (EKS, RDS, S3, Secrets Manager). To use a different region, update AWS_DEFAULT_REGION in Terraform Cloud variables or terraform/backend.tf. Ensure consistency across resources to avoid cross-region latency or costs.

0 commit comments

Comments
 (0)