[Unit]
Description=Autonomi Uploader {{ count }}
After=network.target

[Service]
Environment="SECRET_KEY={{ secret_key }}"
{% if evm_network_type == "evm-custom" %}
Environment="RPC_URL={{ evm_rpc_url }}"
Environment="PAYMENT_TOKEN_ADDRESS={{ evm_payment_token_address }}"
Environment="DATA_PAYMENTS_ADDRESS={{ evm_data_payments_address }}"
{% elif evm_network_type == "evm-arbitrum-sepolia" %}
Environment="EVM_NETWORK=arbitrum-sepolia"
{% elif evm_network_type == "evm-arbitrum-one" %}
Environment="EVM_NETWORK=arbitrum-one"
{% endif %}
User=ant{{ count }}
{% if testnet_name.startswith('PROD-') %}
ExecStart=/home/ant{{ count }}/upload-random-data.sh
{% else %}
ExecStart=/home/ant{{ count }}/upload-random-data.sh {{ genesis_multiaddr }} {{network_contacts_url}}{% if network_id is defined %} {{network_id}}{% endif %}

{% endif %}
Restart=always
WorkingDirectory=/home/ant{{ count }}

[Install]
WantedBy=multi-user.target
