---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: transactioncron
spec:
  schedule: "*/60 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: "Never"
          volumes:
          - name: testvolume
            persistentVolumeClaim:
              claimName: pvc
          containers:
            - name: transactioncron
              image: hyperledger/fabric-tools:x86_64-1.1.0
              imagePullPolicy: Always
              command: ["sh", "-c", "peer chaincode invoke -C ${CHANNEL_NAME} -n ${CHAINCODE_NAME} -c '{\"Args\":[\"addTransactionCron\",\"accounts200k.json\"]}'"]
              env:
              - name: CHANNEL_NAME
                value: channel1
              - name: CHAINCODE_NAME
                value: "cc"
              - name: CHAINCODE_VERSION
                value: "1.19"
              - name: FABRIC_CFG_PATH
                value: /etc/hyperledger/fabric
              - name: CORE_PEER_MSPCONFIGPATH
                value: /public/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
              - name: CORE_PEER_LOCALMSPID
                value: Org1MSP
              - name: CORE_PEER_ADDRESS
                value: blockchain-org1peer1:30110
              - name: GODEBUG
                value: "netdns=go"
              volumeMounts:
              - mountPath: /public
                name: testvolume
