index.ts


Overview

The `index.ts` file serves as the Pulumi deployment entrypoint script for the **Arbitrum Nova** coinstack within the Unchained multi-blockchain infrastructure. Its primary responsibility is to orchestrate the deployment of blockchain node services — specifically the **daemon node** and **indexer service** — into a Kubernetes cluster using Pulumi infrastructure-as-code.

This script dynamically reads service configurations from environment and JSON files, adapts service-specific deployment parameters (such as ports, environment variables, probes, and volume mounts), and invokes a shared deployment utility (`deployCoinstack`) which manages the actual provisioning of Kubernetes resources.


Detailed Explanation

Exported Function (default async export)

export = async (): Promise<Outputs> => { ... }

Important Types and Imports


Usage Example

This file is intended to be executed by Pulumi CLI as the deployment entrypoint for the Arbitrum Nova coinstack:

pulumi up --cwd path/to/arbitrum-nova/pulumi

Pulumi will run this script, which:


Implementation Details and Algorithms


Interaction with Other System Components


Mermaid Diagram: Flowchart of index.ts Deployment Workflow

flowchart TD
  A[Start Deployment Function] --> B[Read sample.env File]
  B --> C[Call getConfig() to Retrieve kubeconfig, config, namespace]
  C --> D{For Each Service in config.statefulService.services}
  D -->|daemon| E[Configure daemon Service Args]
  D -->|indexer| F[Configure indexer Service Args]
  D -->|other| G[Throw Unsupported Service Error]
  E --> H[Assemble coinServiceArgs Array]
  F --> H
  G --> I[Abort Deployment]
  H --> J[Call deployCoinstack() with Parameters]
  J --> K[Deploy Kubernetes Resources]
  K --> L[Return Deployment Outputs]

Summary

This `index.ts` file is a crucial automation script for deploying the Arbitrum Nova blockchain node and its indexer into Kubernetes via Pulumi. It reads configuration files and environment variables, maps services to detailed deployment parameters including ports, environment variables, probes, and ConfigMaps, and delegates the actual Kubernetes resource creation to a shared deployment function. The design follows a modular, extensible pattern consistent with other coinstacks in the multi-blockchain Unchained platform, ensuring scalable and maintainable infrastructure management.


End of Documentation for index.ts