You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New application development that needs to run ingestion pipeline will tend to implement(repeat) many similar parsing routines to generate derived 'Offer' models that Horizon ingestion does internally.
Horizon has many routines that are package private, internal to ingestion which parse and derive 'Offer' from stellar tx meta, so, they can't be re-used externally as-is.
A few of these private ingestion parsing routines in Horizon exposed as pure(no side effects) functions and package public so they can be re-used by external apps to derive the same 'Offer' data models quickly in their ingestion pipelines.
The presence of public functions for parsing 'Offer' model can further encourage external adoption of proposed streaming ingestion pipeline of which operators within a stream invoke these functions directly to include offers data in their stream processing.
Create new pure function and model for 'Offer' in the shared ingest package. Horizon internal ingestion should not be changed or refactored, later this may be revisited.
ingest.HasOffer(op xdr.Operation) bool
for all operations that qualified as offer in HasOffer(), pull up the 'details' parsing routines of these operations from transactionOperationWrapper.Details() and fold into -> ingest.DeriveOffer(tx xdr.Transaction, op xdr.Operation) []OfferEvent:
managebuy
managesell
createsell
Offer data is modeled as a derived event representing the life cycle events of an offer, this is initial estimate of event schema, during effort, can change these:
we don't publicize the routines, external apps use horizon code as reference, and will clone from this to their codebase as they choose to re-implement.
The text was updated successfully, but these errors were encountered:
sreuland
changed the title
services/horizon/ingest: express offers parsing routines as public, reusable functions
services/horizon/ingest: express parsing routines for Offers as public, reusable functions
Aug 8, 2024
What problem does your feature solve?
New application development that needs to run ingestion pipeline will tend to implement(repeat) many similar parsing routines to generate derived 'Offer' models that Horizon ingestion does internally.
Horizon has many routines that are package private, internal to ingestion which parse and derive 'Offer' from stellar tx meta, so, they can't be re-used externally as-is.
What would you like to see?
Follows same design proposal for reusable transformer function for a common model
A few of these private ingestion parsing routines in Horizon exposed as pure(no side effects) functions and package public so they can be re-used by external apps to derive the same 'Offer' data models quickly in their ingestion pipelines.
The presence of public functions for parsing 'Offer' model can further encourage external adoption of proposed streaming ingestion pipeline of which operators within a stream invoke these functions directly to include offers data in their stream processing.
Create new pure function and model for 'Offer' in the shared ingest package. Horizon internal ingestion should not be changed or refactored, later this may be revisited.
ingest.HasOffer(op xdr.Operation) bool
for all operations that qualified as offer in
HasOffer()
, pull up the 'details' parsing routines of these operations fromtransactionOperationWrapper.Details()
and fold into ->ingest.DeriveOffer(tx xdr.Transaction, op xdr.Operation) []OfferEvent
:Offer data is modeled as a derived event representing the life cycle events of an offer, this is initial estimate of event schema, during effort, can change these:
ingest
packageVisualization of where this transform function fits in the larger CDP design for data pipeline:
What alternatives are there?
we don't publicize the routines, external apps use horizon code as reference, and will clone from this to their codebase as they choose to re-implement.
The text was updated successfully, but these errors were encountered: