Configuration

This section explains how to configure and customize Twilight Nodes (Validator and Relayer) after installation. Configuration ensures your node runs efficiently, remains connected to the testnet, and stores data correctly across restarts.

Overview

Both the Validator and Relayer nodes rely on environment variables and configuration files defined in their respective Docker directories. Each setup includes a .env.example file that contains the basic parameters needed to connect, identify, and run your node.

All configuration values can be customized before deployment or updated later by modifying the environment files or Docker Compose parameters.

Environment Variables (.env)

Each node type includes an example environment file that you can copy and edit.

1

Copy and edit the environment file

cp .env.example .env
nano .env
2

Example Configuration

MONIKER="your-node-name"
CHAIN_ID="twilight-zkpass"
KEY_NAME="your-key-name"
PEERS="peer-id@ip:26656"

Descriptions:

Variable
Description

MONIKER

A unique human-readable name for your node instance.

CHAIN_ID

Identifier for the testnet chain. Always use the correct value (twilight-zkpass for testnet).

KEY_NAME

Local key or wallet name used for validator identification.

PEERS

List of peer nodes your validator should connect to.

RPC_PORT / P2P_PORT

Networking ports for node RPC and peer communication.

Ensure your node’s ports are open to allow incoming and outgoing connections.

sudo ufw allow 26656,26657/tcp
sudo ufw enable

Processor Architecture Selection

The validator Docker setup supports multiple architectures. You must ensure the correct binary is extracted during build time.

In the nyks/Dockerfile, adjust line 47 according to your hardware:

Environment
Command

Linux (Apple M-series)

RUN tar -xf nyks_linux_arm64.tar.gz

Linux (Intel/AMD)

RUN tar -xf nyks_linux_amd64.tar.gz

macOS (Apple M-series)

RUN tar -xf nyks_darwin_arm64.tar.gz

Incorrect architecture selection will cause build errors or unexpected behavior.

Storage and Data Persistence

Docker uses mounted volumes to persist blockchain and database data between container restarts. This ensures that chain history, account balances, and state information are retained.

Persistent directories:

To completely reset your node and remove old state data:

circle-exclamation

Accessing Containers via SSH

You may need to inspect or modify configurations directly inside the Docker containers.

List running containers:

Access a specific container:

Inside the container, key configuration files are located at:

You can use nano or vi to edit these files. Restart the node after any configuration changes:

Configuration Sync and Updates

Use the following sequence to update the node with the latest configurations or Docker images without losing data:

1

Fetch latest code

2

Rebuild and restart

This fetches the latest codebase and rebuilds images while preserving your existing blockchain data and configurations.

Troubleshooting Configuration Issues

chevron-rightCommon causes if your node fails to start or connect to peershashtag
  • Verify .env syntax (no missing quotes or equal signs).

  • Ensure ports 26656 and 26657 are open.

  • Confirm the correct architecture in the Dockerfile.

  • Rebuild the containers using docker-compose build.

  • Validator Setup

  • Relayer Setup

  • Monitoring & Maintenance

Tip: For advanced operators, consider exporting Prometheus metrics and Grafana dashboards — covered in the Monitoring & Maintenance section.