---
apiVersion: batch/v1
kind: Job
metadata:
  name: {{ .NAME }}-solana-backfiller
  namespace: {{ .NAMESPACE }}
spec:
  template:
    metadata:
      labels:
        app: {{ .NAME }}-solana-backfiller
    spec:
      restartPolicy: Never
      terminationGracePeriodSeconds: 40
      containers:
        - name: {{ .NAME }}-solana-backfiller
          image: {{ .IMAGE_NAME }}
          imagePullPolicy: Always
          env:
            - name: MONGODB_URI
              valueFrom:
                secretKeyRef:
                  name: mongodb
                  key: mongo-uri
            - name: MONGODB_DATABASE
              valueFrom:
                configMapKeyRef:
                  name: config
                  key: mongo-database
            - name: SOLANA_URL
              valueFrom:
                secretKeyRef:
                  name: blockchain
                  key: solana-url
          command: ["/contract-watcher"]
          args:
            - backfiller
            - --mongo-uri
            - "$(MONGODB_URI)"
            - --mongo-database
            - "$(MONGODB_DATABASE)"
            - --network
            - "{{ .P2P_NETWORK }}"
            - --chain-name
            - "solana"
            - --chain-url
            - "$(SOLANA_URL)"
            - --from
            - "183675278"
            - --to
            - "196868281"