# 1. Setting Up Environment Constants

Set up environment constants and variables by importing necessary modules and utilizing environment variables to ensure proper configuration.&#x20;

Key components include:

* **TEST\_NETWORK**: Specifies the network used for testing, currently set to Polygon.
* **TEST\_RPC\_URL**: Retrieves the RPC URL from an environment variable to connect to the RAILGUN test blockchain network.
* **TEST\_TOKEN**: Represents the wrapped address of the base token for the test network, derived from the network configuration.
* **TEST\_NFT\_ADDRESS and TEST\_NFT\_SUBID**: Provide identifiers for testing NFT functionality.
* **TEST\_MNEMONIC**: Defines a test mnemonic phrase for RAILGUN operations, using a default if not specified in the environment variables.
* **TEST\_ENCRYPTION\_KEY**: Offers a placeholder encryption key for development and testing, emphasizing its unsuitability for production.

```typescript
import { NETWORK_CONFIG, NetworkName } from "@railgun-community/shared-models";
import dotenv from "dotenv";
dotenv.config();

if (process.env.RAILGUN_TEST_RPC == null) {
  throw new Error("No TEST RPC URL configured.");
}

/**
 * The network used for testing purposes.
 * Currently set to the Polygon network.
 * @constant {NetworkName}
 */
export const TEST_NETWORK = NetworkName.Polygon;

/**
 * The RPC URL for RAILGUN test environment.
 * This constant retrieves the URL from the RAILGUN_TEST_RPC environment variable.
 * Used for connecting to the test blockchain network for RAILGUN operations.
 */
export const TEST_RPC_URL = `${process.env.RAILGUN_TEST_RPC}`;

/**
 * The address of the wrapped base token for the test network.
 * This constant is derived from the network configuration for the test network.
 * @type {string}
 */
export const TEST_TOKEN = NETWORK_CONFIG[TEST_NETWORK].baseToken.wrappedAddress;

/**
 * The Ethereum address of a test NFT (Non-Fungible Token) contract.
 * This constant is used for testing purposes related to NFT functionality.
 * The actual address is abbreviated as "0x....".
 */
export const TEST_NFT_ADDRESS = "0x....";

/**
 * The sub-identifier for the test NFT.
 * This value is used to uniquely identify a specific NFT within a collection for testing purposes.
 * @constant {string}
 */
export const TEST_NFT_SUBID = "1";

/**
 * Test mnemonic phrase for RAILGUN.
 * Uses the environment variable RAILGUN_TEST_MNEMONIC if available,
 * otherwise falls back to a default test mnemonic.
 * @remarks This should only be used for testing purposes.
 */
export const TEST_MNEMONIC =
  process.env.RAILGUN_TEST_MNEMONIC ??
  "test test test test test test test test test test test junk";

/**
 * A constant representing a test encryption key for development purposes.
 * This is a 64-character hexadecimal string (32 bytes) that can be used as a placeholder
 * or default encryption key in test environments.
 *
 * @remarks
 * Do not use this key in production environments as it is a publicly known value.
 */
export const TEST_ENCRYPTION_KEY =
  "0101010101010101010101010101010101010101010101010101010101010101";
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.railgun.org/developer-guide/wallet/getting-started/1.-setting-up-environment-constants.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
