Had the same problem but it seems I figured it out. If you want the full history available on your horizon you need to do the following.
Run your stellar-core with CATCHUP_COMPLETE=true
. Some people also say that you should set AUTOMATIC_MAINTENANCE_PERIOD=0
because stellar-core will periodically wipe unneeded ledgers otherwise. Not sure if the latter is necessary. Maybe someone more experienced can chime in.
On your horizon side you need to manually tell it to ingest historical ledgers. Just starting horizon with --ingest=true
is not enough as it will only ingest ledgers that stellar-core currently processes. The steps to manually ingest history are as follows.
horizon db init
initialized db schemahorizon db backfill NUM_LEDGERS
set this slightly higher than the current ledger on stellar-core. This way it should back fill all the way to the beginning of history.horizon --ingest=true
Start your horizon with ingest=true to keep it up to date. Horizon can run while you are doing the db backfill in the background.
Maybe there is easier/better ways to do it but this is what worked for me. The docs all just mention --ingest=true but you really also need to do the db backfill for full/more complete history.