This is from Nader's tutorial, but with Meteor. You can check the original tutorial here: https://dev.to/edge-and-node/building-scalable-full-stack-apps-on-ethereum-with-polygon-2cfb
To run it locally, you will need to open two terminals.
But first, you need to clone the project and run a meteor npm install
to install all the dependencies.
In terminal #1, you will run the following command:
npx hardhat node
The command above will give you 20 accounts with 10000 ETH each, that you can add to your Metamask and test the application locally.
In terminal #2, you will then run the following commands:
npx hardhat run scripts/deploy.js --network localhost
meteor
The command above will deploy the contract and run the Meteor application.
The npx hardhat node
command will give you 20 accounts for you to test locally. To add one of these accounts to your Metamask, you will need to copy one of the private keys hardhat gave you.
Then you will make sure you are in the localhost network, like in the screenshot below:
After that, you will click in the top right icon to open a menu, where you will click on Import Account, like in the image below:
Then you will paste your private key and click Import.
If you're getting errors like "Nonce too high" when trying to add an NFT or doing any kind of transaction in the app, you can do the following steps:
- Access the top right menu like you did in the last section
- Go to Settings and then Advanced
- Click on Reset Accounts
You can check our deployed version using this link: https://meteor-nft-marketplace.meteorapp.com
To use this version you will need to add the Mumbai Testnet to your Metamask. You can do it by following the screenshots from Nader's tutorial. You will go to Metamask settings:
Then Networks and then Add Network.
After that, you will add the following info from Polygon docs:
Network Name: Mumbai TestNet
New RPC URL: https://rpc-mumbai.maticvigil.com
Chain ID: 80001
Currency Symbol: Matic
Click save and then you should be able to switch to this new network and use it. You will need some testnet Matic tokens, but you can get them here