How to automatically invoke contract function from backend on nodeJS

concordium github has InvokeContract on github nodejs package

how to sign a transaction for invoke contract function? and how to get private key from concordium client?

this is the demo given on website but where is private key?

$ concordium-client config show

Base configuration:

  • Verbose: no
  • Account config dir: /var/lib/concordium/config/accounts
  • Account name map:
    default → 3urFJGp9AaU62fQ3DEfCczqJwVt9V3F1gjE5PPBaYgqBD6rqPB

Account keys:

  • ‘3urFJGp9AaU62fQ3DEfCczqJwVt9V3F1gjE5PPBaYgqBD6rqPB’
    {
    “0”: {
    “0”: {
    “encryptedSignKey”: {
    “metadata”: {
    “encryptionMethod”: “AES-256”,
    “iterations”: 100000,
    “salt”: “tRiBas12Z1Y7dydTTdsHbw==”,
    “initializationVector”: “5hPahE0+YXzNs+pRJjkzgg==”,
    “keyDerivationMethod”: “PBKDF2WithHmacSHA256”
    },
    “cipherText”: “h8AXOHt9jHINQp/GWWQrWPiXP5k9swBHQBJmcsSNFcBsie8PjuG7XPjrOQbKzZOUm7+ad1jvsMRLR58hqxKPbRUCcM8+j3O1pWtbycSItE8=”
    },
    “verifyKey”: “7c50c09a5e5537b84e83964a5522a99731e4f7f45c6527ea753970f415e6671b”,
    “schemeId”: “Ed25519”
    },
    “1”: {
    “encryptedSignKey”: {
    “metadata”: {
    “encryptionMethod”: “AES-256”,
    “iterations”: 100000,
    “salt”: “Q8lU7AHxDrZ6mvKbS4lFmw==”,
    “initializationVector”: “qR7n0N1FiIlNbzsmYWLYHg==”,
    “keyDerivationMethod”: “PBKDF2WithHmacSHA256”
    },
    “cipherText”: “5IVYAOAFWv6sCSQVXVE1/UfKKqC+Ati8DyV9MtFG1KqYQ6KG8/T9E5ZO05ORrm+ltsXZ6b273yDUnHCWtoErNzmKlqGRS7cIO/rwtDEg3nQ=”
    },
    “verifyKey”: “50ec0b507164f586e7410c09c20dac0666536136396766de06d29b07b6b61fa3”,
    “schemeId”: “Ed25519”
    },

    },

    }
    Encryption secret keys:
  • ‘3urFJGp9AaU62fQ3DEfCczqJwVt9V3F1gjE5PPBaYgqBD6rqPB’: {
    “metadata”: {
    “encryptionMethod”: “AES-256”,
    “iterations”: 100000,
    “salt”: “w7pmsDi1K4bWf+zkLCuzVw==”,
    “initializationVector”: “EXhd7ctFeqKvaA0P/oB8wA==”,
    “keyDerivationMethod”: “PBKDF2WithHmacSHA256”
    },
    “cipherText”: “pYvIywCAMLhvag1EJmGVuVezGsNvYn24zBnB6TCTkwEwOH50AOrx8NAZnVuQteZMQ7k7Kd7a1RorSxIQI1H/WX+Usi8f3VLnzdZFJmbk4Cme+dcgAbI+wWr0hisgrCDl”
    }

how to sign and send a invoke contract transaction from nodejs automatically.

InvokeContract is not a transaction and does not change the state of the chain.

InvokeContract is the node API where you can dry-run a transaction to, e.g., test it, or to get data from a contract using a view function.

So no secret keys are needed to use this API.