sample.env


Overview

The `sample.env` file is a configuration environment file designed to store key endpoint URLs required for connecting to Thorchain's development network services. This file provides a centralized place to define URLs for the LCD (Light Client Daemon) API, RPC (Remote Procedure Call) API, and WebSocket RPC endpoint used by client applications or services interacting with Thorchain nodes in a development environment.

By externalizing these URLs into an environment file, the system ensures that the connection endpoints can be easily modified or replaced without changing the application code, thus supporting flexible deployment and testing.


File Content Explanation

The file contains the following environment variables:

Variable

Description

Example Value

`LCD_URL`

The HTTPS endpoint for the Thorchain Light Client Daemon (LCD) REST API

https://dev-daemon.thorchain-v1.shapeshift.com/lcd

`RPC_URL`

The HTTPS endpoint for the Thorchain RPC API

https://dev-daemon.thorchain-v1.shapeshift.com/rpc

`WS_URL`

The WebSocket Secure (wss) endpoint for the Thorchain RPC API supporting real-time events

wss://dev-daemon.thorchain.shapeshift.com/rpc

Environment Variable Details


Usage

Applications or services that integrate with Thorchain's development environment can source or load this file to configure their connection endpoints dynamically.

Example (Node.js)

require('dotenv').config({ path: 'sample.env' });

const lcdUrl = process.env.LCD_URL;
const rpcUrl = process.env.RPC_URL;
const wsUrl = process.env.WS_URL;

console.log('Connecting to Thorchain LCD:', lcdUrl);
console.log('Connecting to Thorchain RPC:', rpcUrl);
console.log('Connecting to Thorchain WebSocket RPC:', wsUrl);

Implementation Details


Interaction with the System


Visual Diagram

Below is a flowchart representing how this environment file's variables are consumed by different components in the system:

flowchart TD
    A[sample.env] --> B[Application Startup]
    B --> C[Load Environment Variables]
    C --> D[Blockchain Client Module]
    D --> E[LCD API Client]
    D --> F[RPC API Client]
    D --> G[WebSocket Client]

    subgraph Thorchain Network Endpoints
        E --> H[LCD_URL]
        F --> I[RPC_URL]
        G --> J[WS_URL]
    end

Summary