gnolang / gno

Gno: An interpreted, stack-based Go virtual machine to build succinct and composable apps + Gno.land: a blockchain for timeless code and fair open-source.
https://gno.land/
Other
878 stars 362 forks source link

Portal Loop: monitoring agent/oracle #1443

Open moul opened 9 months ago

moul commented 9 months ago

With the testing of the new portal loop (#1108), it would be beneficial to develop an automated system for interacting with our chain. This system would serve two purposes: 1. to observe regular changes and 2. to provide advanced monitoring. One approach is to create a simple agent that conducts a transaction every few minutes, such as updating a counter. If the transaction fails or if the counter becomes outdated or reset, this agent can trigger a monitoring alert.

cc @gnolang/devrels @gnolang/devops


Suggested approach:

  1. Develop a monitoring smart contract with counters and "last update" date fields. Add helper functions to increment the counter and update the last date.
  2. Create a client (daemon) that accepts parameters like --every 60s and --remote rpc.test3.gno.land. This client will regularly perform checks and call a hook/script when a failure occurs.

Alternative approach:

  1. Follow the step 1. mentioned above.
  2. Write a script that performs a single verification, exits with a status code of 0 or 1, and logs the details.
  3. Consider using GitHub Actions to run it.
moul commented 8 months ago

Could be a nice one to test the new gnoclient, once merged (https://github.com/gnolang/gno/pull/1047#issuecomment-1898059756).

moul commented 2 months ago

Reopening this issue with new context.

The PR #2329 provides a better counter and watchdog system, introducing the gno.land/r/gnoland/monit realm.

We now need to rewrite the agent part that will replace misc/autocounterd. This agent should not only verify that a transaction can be made, but also check if the counter was incremented by keeping a local counter for comparison.

Ideally, this agent should check that the realm (and chain) is operational and that the repository is still compatible. To achieve this, I suggest a small change: instead of running the misc/monit-agent binary, I propose a misc/monit-agent/run.sh script that will git pull the master branch, then go run . --remote={gno.land,test4,...}. This will verify that the production is up and running and that the master branch is still compatible with the production deployment (transaction format, encoding, etc.).

cc @gnolang/devops

DIGIX666 commented 2 months ago

Hi 👋🏼 Are there any people working on this project ?

cc @moul @zivkovicmilos

moul commented 2 months ago

@sw360cab, have you already started working on it? If not, could @DIGIX666 try to assist?

moul commented 1 month ago

@aeddi, can you check with @sw360cab and @DIGIX666 if you can maybe help them; i think it's a good onboarding challenge for you