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

NFT & ISCN table #27

Merged
merged 71 commits into from
Jul 28, 2022
Merged

NFT & ISCN table #27

merged 71 commits into from
Jul 28, 2022

Conversation

lancatlin
Copy link
Contributor

@lancatlin lancatlin commented Jul 8, 2022

ISCN

  • a new iscn table extracted from txs
  • a new meta table to record synced height of iscn
  • a new extractor run along with poller
  • update owner when a transfer tx happens
  • re-implement iscn api using the new table, solve performance problem
  • add new cosmos sdk style pagination: key, limit, reverse
  • add last record id in api response for pagination
  • re-implement iscn api response type, remove dependencies to external package

other changes:

  • decrease poller.batchMaxHeightDiff for faster batch flushing

NFT

Add begin, end to do pagination
+ using handlers models
+ process every message in an tx
move Extractor function to db
+ move createNftClass sql to db
+ add sql/reset.sql for easily reset db
Copy link
Contributor

@nnkken nnkken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some concern on the performance on the ranking query, since it needs joining 4 tables (nft, nft_class, nft_events, iscn) and we need something like COUNT(nft_events) for ranking by NFT trade counts.
Not sure whether we can accomplish this by simply using this schema, or by another extractor for this query.

importdb/tx.go Outdated Show resolved Hide resolved
db/db.go Outdated Show resolved Hide resolved
db/db_test.go Show resolved Hide resolved
db/db_test.go Outdated Show resolved Hide resolved
db/extract.go Outdated Show resolved Hide resolved
db/extract.go Show resolved Hide resolved
sql/nft_by_iscn.sh Outdated Show resolved Hide resolved
examples/nft_tx.json Outdated Show resolved Hide resolved
poller/poller.go Outdated Show resolved Hide resolved
extractor/nft.go Outdated Show resolved Hide resolved
rest/nft.go Outdated Show resolved Hide resolved
db/types.go Outdated Show resolved Hide resolved
db/extract.go Outdated Show resolved Hide resolved
db/types.go Outdated Show resolved Hide resolved
"/likechain.iscn.MsgChangeIscnRecordOwnership": transferISCN,
"new_class": createNftClass,
"mint_nft": mintNft,
"/cosmos.nft.v1beta1.MsgSend": sendNft,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if we query account based nft class?

extractor/nft.go Outdated Show resolved Hide resolved
@williamchong williamchong merged commit 8e5c2f6 into likecoin:master Jul 28, 2022
@lancatlin lancatlin deleted the feat/nft branch July 29, 2022 03:44
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

Successfully merging this pull request may close these issues.

3 participants