make it compile (even if not working yet *WIP*)

* replica support still needs to be reviewed after the last changes to the public (and private) API *