Пример #1
0
func initIngester(app *App) {
	if !app.config.Ingest {
		return
	}

	if app.networkPassphrase == "" {
		log.Fatal("Cannot start ingestion without network passphrase.  Please confirm connectivity with stellar-core.")
	}

	app.ingester = ingest.New(app.networkPassphrase, app.CoreRepo(nil), app.HorizonRepo(nil))
	app.ingester.Start()
}
Пример #2
0
		hdb, err := db2.Open(config.DatabaseURL)
		if err != nil {
			log.Fatal(err)
		}

		cdb, err := db2.Open(config.StellarCoreDatabaseURL)
		if err != nil {
			log.Fatal(err)
		}

		passphrase := viper.GetString("network-passphrase")
		if passphrase == "" {
			log.Fatal("network-passphrase is blank: reingestion requires manually setting passphrase")
		}

		i := ingest.New(passphrase, cdb, hdb)
		logStatus := func(stage string) {
			count := i.Metrics.IngestLedgerTimer.Count()
			rate := i.Metrics.IngestLedgerTimer.RateMean()
			loadMean := time.Duration(i.Metrics.LoadLedgerTimer.Mean())
			ingestMean := time.Duration(i.Metrics.IngestLedgerTimer.Mean())
			clearMean := time.Duration(i.Metrics.IngestLedgerTimer.Mean())
			hlog.
				WithField("count", count).
				WithField("rate", rate).
				WithField("means", fmt.Sprintf("load: %s clear: %s ingest: %s", loadMean, clearMean, ingestMean)).
				Infof("reingest: %s", stage)
		}

		done := make(chan error, 1)