# Polkadot Solochain Environment Configuration
# Generated by provisioning system

POLKADOT_VERSION={{ polkadot_solochain.version }}
POLKADOT_RUN_USER={{ polkadot_solochain.run_user.name }}
POLKADOT_RUN_GROUP={{ polkadot_solochain.run_user.group }}
POLKADOT_RUN_USER_HOME={{ polkadot_solochain.run_user.home }}
POLKADOT_WORK_PATH={{ polkadot_solochain.work_path }}
POLKADOT_CONFIG_PATH={{ polkadot_solochain.config_path }}
POLKADOT_BIN_PATH={{ polkadot_solochain.bin_path }}
POLKADOT_NODE_BINARY={{ polkadot_solochain.node_binary }}

# Data and Storage Paths
POLKADOT_BASE_PATH={{ polkadot_solochain.base_path }}
POLKADOT_KEYSTORE_PATH={{ polkadot_solochain.keystore_path }}

# Network Configuration
POLKADOT_CHAIN={{ polkadot_solochain.network.chain_id }}
POLKADOT_NETWORK_NAME={{ polkadot_solochain.network.name }}
POLKADOT_LISTEN_ADDR="{{ polkadot_solochain.network.listen_addr }}"
{% if polkadot_solochain.network.public_addr is defined %}
POLKADOT_PUBLIC_ADDR="{{ polkadot_solochain.network.public_addr }}"
{% endif %}
{% if polkadot_solochain.network.node_key is defined %}
POLKADOT_NODE_KEY="{{ polkadot_solochain.network.node_key }}"
{% endif %}
POLKADOT_MAX_PEERS={{ polkadot_solochain.network.max_peers }}
POLKADOT_RESERVED_ONLY={{ polkadot_solochain.network.reserved_only | lower }}

# Bootnodes and Reserved Nodes
{% if polkadot_solochain.network.bootnodes %}
POLKADOT_BOOTNODES="{{ polkadot_solochain.network.bootnodes | join(',') }}"
{% endif %}
{% if polkadot_solochain.network.reserved_nodes %}
POLKADOT_RESERVED_NODES="{{ polkadot_solochain.network.reserved_nodes | join(',') }}"
{% endif %}

# RPC Configuration
POLKADOT_RPC_ENABLED={{ polkadot_solochain.rpc.enabled | lower }}
POLKADOT_RPC_BIND_ADDR={{ polkadot_solochain.rpc.bind_addr }}
POLKADOT_RPC_PORT={{ polkadot_solochain.rpc.port }}
POLKADOT_WS_PORT={{ polkadot_solochain.rpc.ws_port }}
POLKADOT_HTTP_PORT={{ polkadot_solochain.rpc.http_port }}
POLKADOT_RPC_MAX_CONNECTIONS={{ polkadot_solochain.rpc.max_connections }}
POLKADOT_RPC_CORS="{{ polkadot_solochain.rpc.cors | join(',') }}"
POLKADOT_RPC_METHODS="{{ polkadot_solochain.rpc.methods | join(',') }}"

# Consensus Configuration
POLKADOT_CONSENSUS_ALGORITHM={{ polkadot_solochain.consensus.algorithm }}
POLKADOT_FINALITY={{ polkadot_solochain.consensus.finality }}
POLKADOT_BLOCK_TIME={{ polkadot_solochain.consensus.block_time }}
POLKADOT_EPOCH_DURATION={{ polkadot_solochain.consensus.epoch_duration }}

# Runtime Configuration
POLKADOT_RUNTIME_NAME={{ polkadot_solochain.runtime.name }}
POLKADOT_RUNTIME_VERSION={{ polkadot_solochain.runtime.version }}
POLKADOT_PVM_ENABLED={{ polkadot_solochain.runtime.pvm_enabled | lower }}
POLKADOT_WASM_EXECUTION={{ polkadot_solochain.runtime.wasm_execution }}
POLKADOT_HEAP_PAGES={{ polkadot_solochain.runtime.heap_pages }}
POLKADOT_MAX_BLOCK_WEIGHT={{ polkadot_solochain.runtime.max_block_weight }}
POLKADOT_MAX_BLOCK_LENGTH={{ polkadot_solochain.runtime.max_block_length }}

# Execution and Performance
POLKADOT_EXECUTION_STRATEGY={{ polkadot_solochain.execution_strategy }}
{% if polkadot_solochain.wasm_runtime_overrides is defined %}
POLKADOT_WASM_RUNTIME_OVERRIDES={{ polkadot_solochain.wasm_runtime_overrides }}
{% endif %}
POLKADOT_PRUNING={{ polkadot_solochain.pruning }}
POLKADOT_STATE_CACHE_SIZE={{ polkadot_solochain.state_cache_size }}

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

# Development and Validator Configuration
POLKADOT_DEV_MODE={{ polkadot_solochain.dev_mode | lower }}
POLKADOT_ALICE_VALIDATOR={{ polkadot_solochain.alice_validator | lower }}

# Validator Configuration
POLKADOT_VALIDATOR_ENABLED={{ polkadot_solochain.validator.enabled | lower }}
POLKADOT_KEY_TYPE={{ polkadot_solochain.validator.key_type }}
{% if polkadot_solochain.validator.session_keys is defined %}
POLKADOT_SESSION_KEYS="{{ polkadot_solochain.validator.session_keys }}"
{% endif %}
{% if polkadot_solochain.validator.validator_id is defined %}
POLKADOT_VALIDATOR_ID="{{ polkadot_solochain.validator.validator_id }}"
{% endif %}

# Telemetry Configuration
POLKADOT_TELEMETRY_ENABLED={{ polkadot_solochain.telemetry.enabled | lower }}
{% if polkadot_solochain.telemetry.url is defined %}
POLKADOT_TELEMETRY_URL="{{ polkadot_solochain.telemetry.url }}"
{% endif %}
POLKADOT_TELEMETRY_VERBOSITY={{ polkadot_solochain.telemetry.verbosity }}