# Polkadot Bootnode Environment Configuration
# Generated by provisioning system

POLKADOT_VERSION={{ polkadot_bootnode.version }}
POLKADOT_RUN_USER={{ polkadot_bootnode.run_user.name }}
POLKADOT_RUN_GROUP={{ polkadot_bootnode.run_user.group }}
POLKADOT_RUN_USER_HOME={{ polkadot_bootnode.run_user.home }}
POLKADOT_WORK_PATH={{ polkadot_bootnode.work_path }}
POLKADOT_CONFIG_PATH={{ polkadot_bootnode.config_path }}
POLKADOT_BIN_PATH={{ polkadot_bootnode.bin_path }}
POLKADOT_BASE_PATH={{ polkadot_bootnode.base_path }}

# Bootnode Configuration
POLKADOT_BOOTNODE_NAME={{ polkadot_bootnode.name }}
{% if polkadot_bootnode.node_key_file is defined %}
POLKADOT_NODE_KEY_FILE={{ polkadot_bootnode.node_key_file }}
{% endif %}

# Network Configuration
POLKADOT_CHAIN={{ polkadot_bootnode.network.chain }}
POLKADOT_LISTEN_ADDRS="{{ polkadot_bootnode.network.listen_addrs | join(',') }}"
{% if polkadot_bootnode.network.public_addr is defined %}
POLKADOT_PUBLIC_ADDR="{{ polkadot_bootnode.network.public_addr }}"
{% endif %}
POLKADOT_MAX_PEERS={{ polkadot_bootnode.network.max_peers }}

# Port Configuration
POLKADOT_P2P_PORT={{ polkadot_bootnode.network.ports.p2p_port }}
POLKADOT_WS_PORT={{ polkadot_bootnode.network.ports.ws_port }}
POLKADOT_WSS_PORT={{ polkadot_bootnode.network.ports.wss_port }}

# External Addresses
{% if polkadot_bootnode.network.external_addresses %}
POLKADOT_EXTERNAL_ADDRESSES="{{ polkadot_bootnode.network.external_addresses | join(',') }}"
{% endif %}

# Execution and Performance
POLKADOT_EXECUTION={{ polkadot_bootnode.execution }}
POLKADOT_STATE_CACHE_SIZE={{ polkadot_bootnode.state_cache_size }}

# Logging Configuration
POLKADOT_LOG_LEVEL={{ polkadot_bootnode.log_level }}
{% if polkadot_bootnode.log_targets %}
POLKADOT_LOG_TARGETS="{{ polkadot_bootnode.log_targets | join(',') }}"
{% endif %}

# Telemetry Configuration
POLKADOT_TELEMETRY_ENABLED={{ polkadot_bootnode.telemetry.enabled | lower }}
POLKADOT_TELEMETRY_URL="{{ polkadot_bootnode.telemetry.url }}"
POLKADOT_TELEMETRY_VERBOSITY={{ polkadot_bootnode.telemetry.verbosity }}

# WSS Configuration
POLKADOT_WSS_ENABLED={{ polkadot_bootnode.wss.enabled | lower }}
{% if polkadot_bootnode.wss.enabled %}
POLKADOT_WSS_DOMAIN="{{ polkadot_bootnode.wss.domain }}"
POLKADOT_WSS_PROXY_TYPE={{ polkadot_bootnode.wss.proxy_type }}
POLKADOT_WSS_RATE_LIMIT={{ polkadot_bootnode.wss.rate_limit }}

# SSL Configuration for WSS
POLKADOT_SSL_ENABLED={{ polkadot_bootnode.wss.ssl.enabled | lower }}
{% if polkadot_bootnode.wss.ssl.enabled %}
POLKADOT_SSL_CERT_FILE="{{ polkadot_bootnode.wss.ssl.cert_file }}"
POLKADOT_SSL_KEY_FILE="{{ polkadot_bootnode.wss.ssl.key_file }}"
{% if polkadot_bootnode.wss.ssl.ca_file is defined %}
POLKADOT_SSL_CA_FILE="{{ polkadot_bootnode.wss.ssl.ca_file }}"
{% endif %}
{% endif %}
{% endif %}