Open jeapostrophe opened 5 years ago
This is a necessity for any JS client worth its salt. My manual demo does it—modulo the fact that it trusts the browser's LocalStorage
, which unhappily is not trustworthy and should be replaced by a better library at some point.
Options for persistence notably include none, local storage, remote storage on private servers, remote storage on the blockchain itself (encrypted).
That's the kind of infrastructure I was working on for many years at ITA (then, to a point, Google).
A simple way to do this is to change
ctc.send( ...., () => ctc.recv( .... , (res) => ....); );
intoctc.sendrecv( ...., (res) => ....);
where the contract object will look and see if the message has already been sent and if so, not try to send it. This means that "starting" part-way really means starting from the beginning again and seeing that the things you meant to do have already happened.This way all of the complexity of this is in the standard library. The
interact
function would need to track the previous results and re-play them.