-
Notifications
You must be signed in to change notification settings - Fork 4
feat: index bulks #57
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
base: main
Are you sure you want to change the base?
Conversation
…d off-chain handlers
type DatasetOrder @entity { | ||
id: ID! | ||
dataset: Dataset! | ||
dataset: Dataset # nullable: off-chain bulk datasetorder could reference non-existing dataset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to modify the nullability on this field because file handlers can't access on-chain handlers entities.
When indexing a datasetorder from a bulk (file handler), we cannot verify that the dataset exists on-chain or exists as an entity.
if (dataset != Address.zero().toHex()) { | ||
let datasetorder = fetchDatasetorder(event.params.datasetHash.toHex()); | ||
if (dataset) datasetorder.dataset = dataset; | ||
datasetorder.datasetprice = deal.datasetPrice; | ||
datasetorder.save(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoids indexing null datasetorder, not directly linked to bulk, but fixes the existing issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
many changes due to formatted file (NB: prettier ignore should be updated to format src)
let datasets = bulkSlice.datasets; | ||
datasets.push(datasetAddress); | ||
bulkSlice.datasets = datasets; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we warn here in case the dataset order is invalid ?
const hash = dataSource.stringParam(); | ||
const context = dataSource.context(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how this infos are loaded when a handleBulk occure ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the diff with the content is like having metadata plug to the actual content of the IPFS file ? and this metadata is set up in the matchOrders handler function ?
bulk indexation from IPFS
Features:
bulk_cid
Deal
bulk content accessible viabulk
fieldTask
bulk slice content accessible viabulkSlice
fieldDataset
usages in bulk accessible viabulkUsages
fieldTesting:
Once the test stack is running
npm run start-test-stack
, create-bulks can be used to test bulk indexation behaviours.Deployed instance (Arbitrum Sepolia): https://api.studio.thegraph.com/query/11362/poco-bulk/version/latest
Limitations:
thegraph supports indexing IPFS files (via file handlers) with some limitations: