Closed devlaseth closed 2 years ago
Just to add here: Here's some logs from cloud
2022-07-11T07:27:02.614Z - Ran cloud function watchContractEvent for user undefined with: Input: {"chainId":"1337","address":"3","topic":"ItemCanceled(address,address,uint256)","sync_historical":true,"abi":{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ItemCanceled","type":"event"},"tableName":"ItemCanceled"} Result: {"success":false,"error":"tableName should be unique"} 2022-07-11T07:27:02.164Z - Ran cloud function watchContractEvent for user undefined with: Input: {"chainId":"1337","address":"3","sync_historical":true,"topic":"ItemBought(address,address,uint256,uint256)","abi":{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"ItemBought","type":"event"},"tableName":"ItemBought"} Result: {"success":false,"error":"tableName should be unique"} 2022-07-11T07:27:01.586Z - Ran cloud function watchContractEvent for user undefined with: Input: {"chainId":"1337","sync_historical":true,"topic":"ItemListed(address,address,uint256,uint256)","address":"3","abi":{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"ItemListed","type":"event"},"tableName":"ItemListed"} Result: {"success":false,"error":"tableName should be unique"}
What I didn't figure out as well was that why it gives me undefined for the user.
Hmm... Maybe the moralis forum is a better place to ask this. This would take me a while to debug your specific issue.
Glad the course is helpful!
Hey Patrick! I love the tutorial you have provided. Thank you very much for it! It's been a pleasure studying it.
I'm having an issue with uploading any data to "ItemListed"
This is what I receive from the console when running the "node addEvents.js" command in the console:
Working with contrat address 3 Something went wrong...
I can see that the following tables have been uploaded to the database correctly: [_EventSyncStatus] _Role _Session _User ItemBought ItemCanceled ItemListed
When I run yarn hardhat run scripts/mint-and-list.js --network localhost I receive this: Minting NFT... Approving NFT... Listing NFT... NFT Listed! Moving blocks... Sleeping for 1000 Moved 1 blocks
And when I go to look to the database I don't see the listed item there.
I tried resetting the local chain and have been trying to find a solution for this for the past 3 days. I feel like I have tried everything there is in my power and i'm turning to your side now for help. The script im using for the contracts is the same as this
https://github.com/PatrickAlphaC/hardhat-nft-marketplace-fcc/blob/main/contracts/NftMarketplace.sol
The script im using for the mint-and-list.js is the same as here https://github.com/PatrickAlphaC/hardhat-nft-marketplace-fcc/blob/main/scripts/mint-and-list-item.js
The script im using for the addEvents.js is the same as here https://github.com/PatrickAlphaC/nextjs-nft-marketplace-moralis-fcc/blob/main/addEvents.js