Closed bumi closed 5 years ago
what do you think? merge it?
Don't know what it does. Could you link to the documentation for that healthcheck function?
It checks if IPFS is available and if the contracts are found. https://github.com/67P/kredits-contracts/blob/master/lib/utils/healthcheck.js#L6
If not it logs an error. this is helpful as it might happen in dev mode some times (as it did) and then only causes strange error messages that are not clear and not directly obvious.
Hmm, I expected something very different, more like if we have a live connection to the Ethereum node or something. How about we rename it in some way that is more expressive about the setup being correct? Like e.g. "checkRequirements" or something. Naming is hard, of course. Can't think of anything ideal just now.
connection is checked... as it loads the code of the address through the ethereum node. I don't care that much about the naming, just wanted to have something general as it contains a few checks and can be extended.
How about "preflight" or "preflightChecks"?
This is what the process is called in an aircraft, when the pilot checks that everything is ok, before taking off. It's also what they call the CORS OPTIONS requests that ensure one can e.g. POST a thing across JS origins.
@skddc renamed the function call. what do you think?
@bumi Is this one still relevant?
yes, preflightChecks
tests if and IPFS connection is available and if all the contracts are found. The later is probably not so important anymore because if we have an address of a contract the contract is probably also deployed.
But I think it is still good to check as one of the main issue has always been the many moving parts that could break.
so tl;dr: yes, I'd still merge it.
Ok, want to resolve the merge conflicts in this case?
closing this and opening a new one.
This uses console.error to log the healthcheck error.