4

I've spun up a Stellar horizon server using the Docker image mentioned in the repo below

https://github.com/stellar/docker-stellar-core-horizon

It spins up just fine but I don't get any payment history. ie. this URL returns a 404

https://myserver.com/accounts/GCOSW43SJO3V3M3B7APU6OEVB3CY2L4INUUWTNHDNLGOSNVF3JHRSMLB/payments

while it works fine for

https://horizon.stellar.org/accounts/GCOSW43SJO3V3M3B7APU6OEVB3CY2L4INUUWTNHDNLGOSNVF3JHRSMLB/payments

Removing payments makes it work and I get account info just fine

https://myserver.com/accounts/GCOSW43SJO3V3M3B7APU6OEVB3CY2L4INUUWTNHDNLGOSNVF3JHRSMLB

The only issue i see other having is

Horizon server returning 404 for GET /accounts/{id}/payments

which mentions that INJEST needed to be enabled, but it looks like it already is default true in the docker. Other queries run just fine such as ledgers/ and accounts/

Any advice?

3
  • Are your horizon and core synced? How did you check? Sep 25, 2018 at 0:30
  • I checked by querying horizon for the most recent ledger and the ledger number matches what I see from horizon.stellar.org. Is there a better way?
    – Paul Puey
    Sep 25, 2018 at 1:09
  • The correct answer is below. You need to run horizon db backfill.
    – marcinx
    Dec 16, 2018 at 10:37

2 Answers 2

2

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. 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.

  1. horizon db init initialized db schema
  2. horizon 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.
  3. 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.

0

It's likely that the specific payments that you see in the public horizon instance are older than your oldest ingested ledger. By default, the docker image's stellar-core configuration will only fetch recent history.

You can verify this by fetching horizon's root element and checking the history_elder_ledger field. In https://horizon.stellar.org/ it's 1. In your own horizon this will probably be newer.

Stellar's core sample config contains some useful information: https://github.com/stellar/stellar-core/blob/master/docs/stellar-core_example.cfg#L220

Horizon's admin overview can also help: https://github.com/stellar/go/blob/master/services/horizon/internal/docs/reference/admin.md#correcting-gaps-in-historical-data

7
  • I don't see anything in the config file to ingest the entire ledger. What do I change?
    – Paul Puey
    Sep 26, 2018 at 0:28
  • I tried setting HISTORY_RETENTION_COUNT="10000000" (about 3 years)
    – Paul Puey
    Sep 26, 2018 at 16:48
  • And CATCHUP_COMPLETE=true. Now the server seems to resync over and over. I see this type of line 2018-09-26T16:55:55.573 GCWVK [History INFO] Catching up: applying checkpoint 70318/315168 (22%) 2018-09-26T16:55:55.913 GCWVK [History INFO] Catching up: applying checkpoint 70319/315168 (22%) 2018-09-26T16:55:56.241 GCWVK [History INFO] Catching up: applying checkpoint 70320/315168 (22%) cross my screen all the time and it cycles from 0-100% and back to 0%
    – Paul Puey
    Sep 26, 2018 at 16:56
  • HISTORY_RETENTION_COUNT is a horizon setting that limits retention on the horizon side. You need stellar-core to do a full catchup so that horizon has the entire history to ingest in the first place. CATCHUP_COMPLETE is indeed the setting you're looking for. It takes ~2-7 days, depending on your hardware, to perform a full catchup. If you have specific errors with that I'd recommend opening another question with information and logs Sep 26, 2018 at 17:13
  • Is there an estimate amount of diskspace needed to run a full history server? I had a 160gb machine as I saw posts here that the Core only needed 16GB and that Horizon needed about 30gb. But apparently those were not for full history. What is the expected disk requirements so I can spin up a VPS accordingly?
    – Paul Puey
    Oct 2, 2018 at 22:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.