I've got a server that I'm relaying every action that I want to do with a smart contract, but let's say the server can't connect to the smart contract (the connection is down). How would I cache such actions and execute them once the connection is up.
Interaction with smart contract (SC) has 2 types:
In order to do the write data, we need:
So we can organize into a JS object
{
'address': 0x..,
'method': 'transfer',
'dataOption': {
'from': '0x...',
'value': 100 (wei)
},
'params': ['param1', 'param2', ...]
}
Then you can determine where should we use it depends on the use cases: