I have some set of data which I am trying to push to my smart contract in loop. I use conseiljs to send data to smart contract.
Here is the code depicting what I am trying to do.
async function sendDataToContract(feedData,nodeAddress,publicKey,privateKey,keyHash,contractAddress)
{
const keystore = {
publicKey: publicKey,
privateKey: privateKey,
publicKeyHash: keyHash,
seed: '',
storeType: conseiljs.StoreType.Fundraiser
};
for(let i=0;i<feedData.length;i++)
{
try
{
const result = await conseiljs.TezosNodeWriter.sendContractInvocationOperation(nodeAddress, keystore, contractAddress, 0, 100000, '', 1000, 750000, undefined, `(Pair "${feedData[i].firstname} ${feedData[i].income}")`, conseiljs.TezosParameterFormat.Michelson);
console.log(result.operationGroupID);
}
catch(e)
{
console.log(" Catch Error : ",e.stack);
}
}
}
function sendData()
{
sendDataToContract(feedData,nodeAddress,publicKey,privateKey,keyHash,contractAddress);
}
Catch Error:
Catch Error : Error: (temporary: failure)
at parseRPCError (F:\oro-latest\weather-oracle\node_modules\conseiljs\dist\chain\tezos\TezosNodeWriter.js:398:19)
at F:\oro-latest\weather-oracle\node_modules\conseiljs\dist\chain\tezos\TezosNodeWriter.js:150:13
at Generator.next (<anonymous>)
at fulfilled (F:\oro-latest\weather-oracle\node_modules\conseiljs\dist\chain\tezos\TezosNodeWriter.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:93:5)