1

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?

SenchoPens
  • 17
  • 1
  • 7

1 Answers1

2

correct on 2 - you likely won't get a deterministic result (whatever you're updating it with but sounds like its date-based and not sure whether its a calendar or elapsed day etc etc) and the update will fail. You're 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.

Paul O'Mahony
  • 6,740
  • 1
  • 10
  • 15