Introduction
Mafoc is next generation chain indexer for Cardano.
Achitecture boils down to fold over blocks in IO:
type Indexer = (Block -> State -> IO (State, Event)) -> IO State -> IO Block -> IO State
-- ^ step
-- ^ init
-- ^ get next
IO, well because we need to get blocks from the outside world and also we need to store the processed data to the outside world.
For any indexer, the operation of this is implemented in the Indexer
type class where state, init and step have indexer-specific
implementations.
Library
The purpose of Mafoc is to be used as a library to implement new indexers. The two things which need implemented are:
- what data to pick from the block
- how to store it
Rest is provided by the library. Corollary: if library improves, so does the user's indexer.
Predefined indexers
There are plenty of predefined indexers which can be run out-of-the-box:
docker run --rm -it markus77/mafoc <indexer> <indexer options>