Lesson 14: Cannot Upload to Pinata #5535
-
|
I have been following the tutorial and even pulled the code from the repo but not able to get past the step when I run: Nothing to compile
No need to generate any newer typings.
Local network detected! Deploying mocks...
deploying "VRFCoordinatorV2Mock" (tx: 0xf50670372fe601f04f6469a19634012866cc208bc3ed8f1c902ef2b2fb6bb71f)...: deployed at 0x5FbDB2315678afecb367f032d93F642f64180aa3 with 2540078 gas
deploying "MockV3Aggregator" (tx: 0xf7a56d0a30f57e8493ee871bacdb0bf77667df78002e5bad0483766b01b0076f)...: deployed at 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 with 569795 gas
Mocks Deployed!
----------------------------------
You are deploying to a local network, you'll need a local network running to interact
Please run `yarn hardhat console --network localhost` to interact with the deployed smart contracts!
----------------------------------
Error: filename was not provide, make sure to provide options.pinataMetadata.name
at webpack://pinata-sdk/./src/commands/pinning/pinFileToIPFS.ts:96:19
at new Promise (<anonymous>)
at pinFileToIPFS (webpack://pinata-sdk/./src/commands/pinning/pinFileToIPFS.ts:86:12)
at PinataClient.pinFileToIPFS (webpack://pinata-sdk/./src/index.ts:86:16)
at storeImages (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/utils/uploadToPinata.ts:17:43)
at handleTokenUris (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/deploy/02-deploy-randomIPFSNFT.ts:81:73)
at Object.deployRandomIpfsNft [as func] (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/deploy/02-deploy-randomIPFSNFT.ts:35:27)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runNextTicks (node:internal/process/task_queues:64:3)
at listOnTimeout (node:internal/timers:538:9)
Error: filename was not provide, make sure to provide options.pinataMetadata.name
at webpack://pinata-sdk/./src/commands/pinning/pinFileToIPFS.ts:96:19
at new Promise (<anonymous>)
at pinFileToIPFS (webpack://pinata-sdk/./src/commands/pinning/pinFileToIPFS.ts:86:12)
at PinataClient.pinFileToIPFS (webpack://pinata-sdk/./src/index.ts:86:16)
at storeImages (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/utils/uploadToPinata.ts:17:43)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runNextTicks (node:internal/process/task_queues:64:3)
at listOnTimeout (node:internal/timers:538:9)
at processTimers (node:internal/timers:512:7)
at async handleTokenUris (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/deploy/02-deploy-randomIPFSNFT.ts:81:56)
Error: filename was not provide, make sure to provide options.pinataMetadata.name
at webpack://pinata-sdk/./src/commands/pinning/pinFileToIPFS.ts:96:19
at new Promise (<anonymous>)
at pinFileToIPFS (webpack://pinata-sdk/./src/commands/pinning/pinFileToIPFS.ts:86:12)
at PinataClient.pinFileToIPFS (webpack://pinata-sdk/./src/index.ts:86:16)
at storeImages (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/utils/uploadToPinata.ts:17:43)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runNextTicks (node:internal/process/task_queues:64:3)
at listOnTimeout (node:internal/timers:538:9)
at processTimers (node:internal/timers:512:7)
at async handleTokenUris (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/deploy/02-deploy-randomIPFSNFT.ts:81:56)
Token URIs uploaded! They are:
[]
An unexpected error occurred:
Error: ERROR processing /Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/deploy/02-deploy-randomIPFSNFT.ts:
TypeError: Cannot read properties of undefined (reading 'args')
at Object.deployRandomIpfsNft [as func] (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/deploy/02-deploy-randomIPFSNFT.ts:44:55)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runNextTicks (node:internal/process/task_queues:64:3)
at listOnTimeout (node:internal/timers:538:9)
at processTimers (node:internal/timers:512:7)
at async DeploymentsManager.executeDeployScripts (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1222:22)
at async DeploymentsManager.runDeploy (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1055:5)
at async SimpleTaskDefinition.action (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat-deploy/src/index.ts:438:5)
at async Environment._runTaskDefinition (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat/src/internal/core/runtime-environment.ts:330:14)
at async Environment.run (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat/src/internal/core/runtime-environment.ts:163:14)
at DeploymentsManager.executeDeployScripts (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1225:19)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runNextTicks (node:internal/process/task_queues:64:3)
at listOnTimeout (node:internal/timers:538:9)
at processTimers (node:internal/timers:512:7)
at async DeploymentsManager.runDeploy (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1055:5)
at async SimpleTaskDefinition.action (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat-deploy/src/index.ts:438:5)
at async Environment._runTaskDefinition (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat/src/internal/core/runtime-environment.ts:330:14)
at async Environment.run (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat/src/internal/core/runtime-environment.ts:163:14)
at async SimpleTaskDefinition.action (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat-deploy/src/index.ts:584:32) ✘ ~/L/P/s/f/s/hardhat-nft main ± hh deploy --tags randomIPFS,mocks
Nothing to compile
No need to generate any newer typings.
Local network detected! Deploying mocks...
deploying "VRFCoordinatorV2Mock" (tx: 0xf50670372fe601f04f6469a19634012866cc208bc3ed8f1c902ef2b2fb6bb71f)...: deployed at 0x5FbDB2315678afecb367f032d93F642f64180aa3 with 2540078 gas
deploying "MockV3Aggregator" (tx: 0xf7a56d0a30f57e8493ee871bacdb0bf77667df78002e5bad0483766b01b0076f)...: deployed at 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 with 569795 gas
Mocks Deployed!
----------------------------------
You are deploying to a local network, you'll need a local network running to interact
Please run `yarn hardhat console --network localhost` to interact with the deployed smart contracts!
----------------------------------
Error: filename was not provide, make sure to provide options.pinataMetadata.name
at webpack://pinata-sdk/./src/commands/pinning/pinFileToIPFS.ts:96:19
at new Promise (<anonymous>)
at pinFileToIPFS (webpack://pinata-sdk/./src/commands/pinning/pinFileToIPFS.ts:86:12)
at PinataClient.pinFileToIPFS (webpack://pinata-sdk/./src/index.ts:86:16)
at storeImages (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/utils/uploadToPinata.ts:17:43)
at handleTokenUris (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/deploy/02-deploy-randomIPFSNFT.ts:81:73)
at Object.deployRandomIpfsNft [as func] (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/deploy/02-deploy-randomIPFSNFT.ts:35:27)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runNextTicks (node:internal/process/task_queues:64:3)
at listOnTimeout (node:internal/timers:538:9)
Error: filename was not provide, make sure to provide options.pinataMetadata.name
at webpack://pinata-sdk/./src/commands/pinning/pinFileToIPFS.ts:96:19
at new Promise (<anonymous>)
at pinFileToIPFS (webpack://pinata-sdk/./src/commands/pinning/pinFileToIPFS.ts:86:12)
at PinataClient.pinFileToIPFS (webpack://pinata-sdk/./src/index.ts:86:16)
at storeImages (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/utils/uploadToPinata.ts:17:43)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runNextTicks (node:internal/process/task_queues:64:3)
at listOnTimeout (node:internal/timers:538:9)
at processTimers (node:internal/timers:512:7)
at async handleTokenUris (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/deploy/02-deploy-randomIPFSNFT.ts:81:56)
Error: filename was not provide, make sure to provide options.pinataMetadata.name
at webpack://pinata-sdk/./src/commands/pinning/pinFileToIPFS.ts:96:19
at new Promise (<anonymous>)
at pinFileToIPFS (webpack://pinata-sdk/./src/commands/pinning/pinFileToIPFS.ts:86:12)
at PinataClient.pinFileToIPFS (webpack://pinata-sdk/./src/index.ts:86:16)
at storeImages (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/utils/uploadToPinata.ts:17:43)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runNextTicks (node:internal/process/task_queues:64:3)
at listOnTimeout (node:internal/timers:538:9)
at processTimers (node:internal/timers:512:7)
at async handleTokenUris (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/deploy/02-deploy-randomIPFSNFT.ts:81:56)
Token URIs have been uploaded! They are:
[]
An unexpected error occurred:
Error: ERROR processing /Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/deploy/02-deploy-randomIPFSNFT.ts:
TypeError: Cannot read properties of undefined (reading 'args')
at Object.deployRandomIpfsNft [as func] (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/deploy/02-deploy-randomIPFSNFT.ts:44:55)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runNextTicks (node:internal/process/task_queues:64:3)
at listOnTimeout (node:internal/timers:538:9)
at processTimers (node:internal/timers:512:7)
at async DeploymentsManager.executeDeployScripts (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1222:22)
at async DeploymentsManager.runDeploy (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1055:5)
at async SimpleTaskDefinition.action (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat-deploy/src/index.ts:438:5)
at async Environment._runTaskDefinition (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat/src/internal/core/runtime-environment.ts:330:14)
at async Environment.run (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat/src/internal/core/runtime-environment.ts:163:14)
at DeploymentsManager.executeDeployScripts (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1225:19)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runNextTicks (node:internal/process/task_queues:64:3)
at listOnTimeout (node:internal/timers:538:9)
at processTimers (node:internal/timers:512:7)
at async DeploymentsManager.runDeploy (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1055:5)
at async SimpleTaskDefinition.action (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat-deploy/src/index.ts:438:5)
at async Environment._runTaskDefinition (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat/src/internal/core/runtime-environment.ts:330:14)
at async Environment.run (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat/src/internal/core/runtime-environment.ts:163:14)
at async SimpleTaskDefinition.action (/Users/johnny/Library/Projects/studies/free-codecamp/solidity/hardhat-nft/node_modules/hardhat-deploy/src/index.ts:584:32)My repo is located here: Any assistance on this would be awesome. I have tried a few things with the Pinata docs but I am not able to get around the issue. I have tried matching the docs: export async function storeTokenUriMetadata(metadata) {
const options = {
pinataMetadata: {
name: 'TEST',
},
}
try {
const response = await pinata.pinJSONToIPFS(metadata, options)
return response
} catch (error) {
console.log(error)
}
return null
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
@masterfung Hey!, The structure is updated. You can see this here link. You need to provide |
Beta Was this translation helpful? Give feedback.
-
|
@alymurtazamemon Thanks for the support. I did not know that the upload function needed the same option fields. Things are now working! |
Beta Was this translation helpful? Give feedback.
@masterfung Hey!, The structure is updated. You can see this here link. You need to provide
pinataMetadataobject as well. Check it if you feel any difficulty then let me know.