algorand / conduit

Algorand's data pipeline framework.
MIT License
37 stars 26 forks source link

plugin: Creator account filter. #132

Open winder opened 1 year ago

winder commented 1 year ago

Problem

It is common to have a set of creators who create many assets and/or applications, which are then delegated to other accounts. In this scenario the creator is only relevant at create time. After they have been delegated there are no longer references to the creator accounts.

Suppose a creator has made 10,000 ASAs and you want to track the usage of each of them, the current filter plugin would not allow it because the list of ASAs would vary over time as the creator continues to add new ones.

Solution

A new plugin with the following properties:

name: creator_filter
config:
    creators:
      - ADDR1
      - ADDR2
      - ADDR3
    # either algod or indexer can be provided to lookup IDs for assets and applications
    # associated with the addresses.
    algod:
        addr:
        token:
    indexer:
        addr:
        token:

During startup an in-memory list of IDs can be resolved from Indexer or algod. While processing blocks the list of IDs would grow or shrink as the creator creates or deletes things. Transactions associated with any of the IDs (or creators) are selected and all others are removed.

Note: instead of providing algod or indexer, the list of IDs can be stored in the data directory.