sync event don’t work. I cloned github repo, added sync event for rarible clone
https://nft.ability-program.work/
0xdd45ee9770d61bb3d9dd15889f3b9cdf2b67ea22
testnet
ropsten
what didn’t work? did you have any error in your server logs?
2021-12-29T17:38:39.818Z - Error: A duplicate value for a field with unique values was provided
at /moralis-server/lib/Adapters/Storage/Mongo/MongoStorageAdapter.js:506:15
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
2021-12-29T17:38:34.442Z - Error: A duplicate value for a field with unique values was provided
at /moralis-server/lib/Adapters/Storage/Mongo/MongoStorageAdapter.js:506:15
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
what is the server subdomain/url?
https://nft.ability-program.work/
its url our marketplace
https://0brmzf1fxe70.usemoralis.com:2053/server
it’s moralis server
it looks like the topic is not the right one:
"topic":"itemSold(id, buyer, askingPrice)"
the topic should have variable type and not variable name and it should also not have spaces
I have topic: itemAdded(id, tokenId, tokenAddress, askingPrice)
{
“anonymous”: false,
“inputs”: [
{
“indexed”: false,
“internalType”: “uint256”,
“name”: “id”,
“type”: “uint256”
},
{
“indexed”: false,
“internalType”: “uint256”,
“name”: “tokenId”,
“type”: “uint256”
},
{
“indexed”: false,
“internalType”: “address”,
“name”: “tokenAddress”,
“type”: “address”
},
{
“indexed”: false,
“internalType”: “uint256”,
“name”: “askingPrice”,
“type”: “uint256”
}
],
“name”: “itemAdded”,
“type”: “event”
}
that is not a correct topic, it will not work with that topic
you can also write the hex version, you can look at an event for a transaction to get the topic0 value for that event
you need a well formed topic
okey now I have this error:
Error: Invalid function: “coreservices_unregisterEvent”
at handleCloudFunction (/moralis-server/lib/Routers/FunctionsRouter.js:119:13)
at /moralis-server/lib/PromiseRouter.js:85:20
at processTicksAndRejections (node:internal/process/task_queues:96:5)
maybe you can ignore that error for now
it looks like you still don’t have the right topic
it can not work like that, that is not a valid topic
What do you mean by: “the topic should have variable type and not variable name and it should also not have spaces”
Also it’s is the same as in the YouTube tutorial, can you please explain what should be changed in the topic?
can you point me to a transaction on chain that has that event?
I tried to explain twice what it should include that topic, there are also two options
0x06f26bbcbac0bb3f9244ee592ea5bc9f0037f3dcff79472e751984ea1583d671
https://ropsten.etherscan.io/tx/0x06f26bbcbac0bb3f9244ee592ea5bc9f0037f3dcff79472e751984ea1583d671
ok, use this for topic: 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925
(SOLVED)
Okay, I fixed it, it’s supposed to be:
itemAdded(uint256, uint256, address, uint256)
I get sync events, but I still don’t see marketplace items rendering. Users item is rendering fine, but the marketplace after synced events doesn’t show up.
Therefore, I think that the GitHub repo has a bug with the marketplace items rendering function.
(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)