I was trying to find a way to get raw block/transaction data and came across this question. The answer was that there is no way to do that currently but db-sync somehow does that. How does it do that? More specifically I was looking for some sort of documentation on how to do that myself (an API reference with the protocol specified).
The answer to that other question is only partly correct ie the
node does make this data available, but not in an easy to digest manner.
node does expose a local chain sync protocol. However this local chain sync protocol is written in Haskell and uses CBOR encoded data. It is theoretically possible to write code in another language that connects to this local chain sync protocol (I think there is Rust code somewhere to do this).
The local chain sync protocol only supports on-chain data. Data that is part of ledger state like epoch rewards and epoch stake distribution are not included.