0

Can I add a trigger to smart contract to insert/update data to my traditional DB. E.g. Let's say I have students private blockchain where each student has to update their info. Once they insert/update it, I am maintaining a database with all the current information as I do not want to change my legacy app that is built on traditional DB. I understand that every time the students update their info, it will cost the ether and I am ready for that. In other words, can I have callbacks once a method gets executed on smart contract so I can continue performing actions from my server.

1

A smart contract directly cannot perform action which have a scope outside of the EVM. If this wasn't the case, the contract will be prone to nondeterministic gas usage.

A possible solution is to create a server to watch changes on the chain and perform the corresponding action on the database to keep it in sync.

This might help you: How can an Ethereum contract get data from a website?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.