trueblocks-core icon indicating copy to clipboard operation
trueblocks-core copied to clipboard

Enhancement to the Monitor code

Open tjayrush opened this issue 3 years ago • 6 comments

Currently, in the command.fil, we accept only export commands, but we could easily accept other commands. For example,

scrape run-once

which could be stored at the top of the file and would scrape once every time the monitor runs, but it only goes through one pass to catch up to the front of the chain.

Another command could be

init

or

init -all

which would freshen the local index without requiring the end user to be running the scraper.

@dawid -- thought you might find this interesting. Seems like it would be easy, and it would work.

tjayrush avatar Jun 27 '22 17:06 tjayrush

Seriously Thomas, I thought we are over it already. For years now, you are trying to convince me to get into this project, and I still really don't care. I prefer watching The Office for the third time...

Dawid avatar Jun 27 '22 18:06 Dawid

Sorry -- wrong Dawid. I meant @dszlachta. Go back to your TV :-).

tjayrush avatar Jun 27 '22 19:06 tjayrush

Haha 🤣 @tjayrush you can check if you're tagging me by trying to pronounce the username. If you cannot, it's me.

Could this file be YAML? As a new "--file arg user" (I started using it few weeks ago to test Docker) I already find it confusing and if we add special meaning to the top of the file, it would make it even more confusing (also for us as developers, because we would have to guess if the top is scrape's or export's argument). Instead, we could have:

scrape:
  - run-once
  - whatever-future-argument and-its-value
export:
  - appearances
  - logs
  - group: # I think the current file supports "grouping" the commands
    - articulate
    - neighbors

dszlachta avatar Jun 28 '22 07:06 dszlachta

I'm totally open to YAML. Sounds like a much better idea. Like the github action. (We can even steal ideas from there.)

tjayrush avatar Jun 28 '22 12:06 tjayrush

Is this implemented? If you make a PR, I can merge it.

tjayrush avatar Aug 05 '22 15:08 tjayrush

This was only a discussion, I think. Let's put on our roadmap.

dszlachta avatar Aug 08 '22 08:08 dszlachta

I suggest we steal heavily from GitHub actions (but eliminate a lot of what's available there). For example:

name: Export
every: 15 seconds
jobs:
  Export Logs:
    steps:
      - name: Freshen
        run: |
          chifra list ${{address}}
          chifra export --logs ${{address}} 
  Publish:
    needs: Freshen
    on: freshen
    steps:
      - name: Summarize
        with:
          Generate totals
      - name: Update database
        with:
          Commands to update databaseså
      - name: Send notifications
        with:
          subject: New transaction ${{ TX_LINK }}
          recipient: ${{ EMAIL }}
          script: |
            email whatever

Of course, the above is very bogus and will evolve with time.

tjayrush avatar Nov 21 '22 15:11 tjayrush

Another idea would be to steal from The Graph which describes similar behaviour in the subgraph files.

A third idea would be to steal both.

tjayrush avatar Nov 21 '22 15:11 tjayrush