Closed luketchang closed 3 years ago
Documentation:
Homes
and Replicas
abstractions, which switch over chain-specific contract methods are retained and implement Home
and Replicas.
CachingHomeand
CachingReplicaadditionally provide event data (updates, messages) and thus implement
HomeEventsand
CommonEvents` (chain agnostic since they are just calls to db).
CommonIndexer/HomeIndexer
: Interface by which chain-specific homes/replicas bubble up event data (each chain will have a different implementation/library used retrieve this data which is why we need a trait to provide common interface). Bubbles up data to a ContractSync, which takes that data and stores it in agent's db.ContractSync
: Drives syncing between agent db and on-chain data in loop. Continuously calls out to an indexer to retrieve event data and stores it in agent's db.CachingHome/CachingReplica
: Both contain async
function which spawns a newContractSync
to keep db up-to-date.Closes #870