index.ts


Overview

This file serves as the Pulumi deployment entrypoint for the **Thorchain v1** coinstack within the ShapeShift Unchained platform. It automates the provisioning of blockchain node services in a Kubernetes environment by:

The file implements the deployment logic tailored specifically for Thorchain’s daemon service, setting environment variables, ports, and health probes necessary for Kubernetes to manage the node’s lifecycle robustly.


Detailed Explanation

Exported Async Function (Default Export)

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

Imported Entities

Import

Source Path

Description

`readFileSync`

`'fs'`

Node.js file system method to read files synchronously.

`deployCoinstack`

`'../../../../pulumi/src/coinstack'`

Shared Pulumi deployment function to provision blockchain services.

`CoinServiceArgs`, `Outputs`, `getConfig`

`'../../../../pulumi/src'`

Types and utilities for deployment configuration and input/output definitions.


Important Implementation Details


Usage Example

This file is not designed to be imported and invoked manually; instead, it is executed by the Pulumi CLI as part of the deployment process:

pulumi up --cwd path/to/thorchain-v1/pulumi

Under the hood, Pulumi loads this file as the deployment program, runs the exported async function, and manages Kubernetes resources accordingly.


Interaction with Other System Components


Mermaid Class Diagram

The file defines a single main function that orchestrates deployment; no classes are declared. Instead, the key data type is `CoinServiceArgs`, which represents the deployment configuration for each service.

Below is a class diagram depicting the relevant type and the exported function structure:

classDiagram
    class CoinServiceArgs {
        +name: string
        +dataDir?: string
        +env?: object
        +ports?: object
        +startupProbe?: Probe
        +readinessProbe?: Probe
        +livenessProbe?: Probe
        +configMapData?: object
        +volumeMounts?: array
    }
    class Probe {
        +periodSeconds: number
        +failureThreshold: number
        +timeoutSeconds: number
    }
    class DeployFunction {
        +(): Promise<Outputs>
    }

    DeployFunction ..> CoinServiceArgs : uses
    CoinServiceArgs o-- Probe : has

Summary

This [index.ts](/projects/291/68798) file is the Pulumi deployment entrypoint for the Thorchain v1 blockchain coinstack. It reads configuration files, extracts and adapts service definitions (currently only the daemon service), sets required environment variables and ports, and delegates to a shared deployment function to provision Thorchain node services on Kubernetes. The file enforces strict service support and applies health probes to ensure resilience. By following a standardized pattern, it integrates seamlessly with the broader ShapeShift Unchained multi-blockchain deployment system, enabling consistent and automated infrastructure management for Thorchain nodes.