Sync event rarible clone

sync event don’t work. I cloned github repo, added sync event for rarible clone
https://nft.ability-program.work/
0xdd45ee9770d61bb3d9dd15889f3b9cdf2b67ea22
testnet
ropsten

1 Like

what didn’t work? did you have any error in your server logs?

1 Like

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)

1 Like

what is the server subdomain/url?

1 Like

https://nft.ability-program.work/
its url our marketplace

https://0brmzf1fxe70.usemoralis.com:2053/server
it’s moralis server

1 Like

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”
}

1 Like

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

so I need topic like: “topic”:“itemAdded(id, tokenId, tokenAddress, askingPrice)”

1 Like

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)

1 Like

maybe you can ignore that error for now

it looks like you still don’t have the right topic

I just copied and pasted the topic I can’t understand why it doesn’t work

1 Like

it can not work like that, that is not a valid topic

1 Like

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?

1 Like

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

1 Like

0x06f26bbcbac0bb3f9244ee592ea5bc9f0037f3dcff79472e751984ea1583d671

https://ropsten.etherscan.io/tx/0x06f26bbcbac0bb3f9244ee592ea5bc9f0037f3dcff79472e751984ea1583d671

1 Like

ok, use this for topic: 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925

1 Like

(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.

1 Like

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

1 Like