Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in Blockchain by (12.7k points)

I need to update some field every day. I came up with 2 possible solutions:

  1. Update it via REST API - for example, a program that runs on some server, updates the field via REST API and then sleeps 1 day. Problem: if the program stops it does not update the ledger, thus the network does not work correctly anymore.

  2. Make a smart contract that sleeps 1 day and then updates the fields. Problem: as far as I know how the internals are working, isn't that going to make problems with reaching the consensus?

1 Answer

0 votes
by (29.5k points)
edited by

I think 2 is correct.you likely won't get a deterministic result and the update will fail. its best to manage the update based on a field value from the client side. You need some high availability solution and/or checks for your client-side issue that the update takes place. The ledger is not really the place to rely on applying your operational, schedule-based update.

Want to make a career in Blockchain? Then enroll now in Blockchain Training by Intellipaat to get the perfect guidance.

Browse Categories

...