Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map out asset input and output data structures for CLI #42

Closed
Isaiah-Turner opened this issue Jul 7, 2020 · 1 comment
Closed

Map out asset input and output data structures for CLI #42

Isaiah-Turner opened this issue Jul 7, 2020 · 1 comment
Assignees

Comments

@Isaiah-Turner
Copy link
Contributor

What

We need to map out what information we get about assets from the new ingestion system. We also need to know what the output to BigQuery should look like. Part of #19.

Why

This issue helps us know what asset information is easily accessible from the ingestion system and what information may have to be reconstructed or omitted.

@Isaiah-Turner
Copy link
Contributor Author

According to the documents on issuing assets, an asset is issued when an account makes a payment operation using that asset. We can use a LedgerTransactionReader and look for operations of OperationTypePayment. When we find an operation of that type, we can save it to be exported. We should only export assets that we haven't seen before. We can use the following code to get asset info:

assetType, code, issuer := new(string), new(string), new(string)
err := op.Body.PaymentOp.Asset.Extract(assetType, code, issuer)

In order to reconstruct the asset table in BigQuery we need the following fields:

type: string - get from assetType
issuer: string - get from code
code: string - get from issuer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant