Widespread Augmented Reality

Widespread Augmented Reality
Click on the image to get the Android Augmented Reality Heads up Display

Sunday, March 6, 2022

Successfully minted NFT to Ethereum Ropsten Network

Using only my linux laptop, I wanted to send an NFT to the Ethereum block chain in order to better understand the process. After checking out several on-line tutorials and failing, I went straight to the source and followed the steps in the following web pages:

    1. https://ethereum.org/en/developers/tutorials/how-to-write-and-deploy-an-nft/
    2. https://ethereum.org/en/developers/tutorials/how-to-mint-an-nft/
    3. https://ethereum.org/en/developers/tutorials/how-to-view-nft-in-metamask/

My previous attempts may have failed because there were too many steps including creating a web app on my laptop, starting localhost http://localhost:3000/, putting the NFT MetaData file at http://localhost:3000/api/erc721/, and then making that file available to the internet using ngrok. Somewhere in there, I am sure there was a typo or a piece missing.

The Ethereum tutorials uploaded the actual NFT image and the NFT meta data to Pinata so there was no need to open up my laptop to the internet. Moreover since I am not creating a production ready NFT, I used my own website at http://spideronfire.com to store the actual image and the meta data

Essentially this is what happens:

  • Create a smart contract
  • Make it Ethereum compliant with OpenZeppelin, Hardat and ethers
  • Connect to Ethereum through the Alchemy Node
  • Send the smart contract to the Alchemy node through your MetaMask wallet
  • Wait for Alchemy to validate the transaction
  • Get the contract address from Alchemy or https://ropsten.etherscan.io/
  • Mint the NFT using the contract address and a meta data file
  • The meta data file has a url to the actual image file

  • The following is a dump of the steps that I took so I can refer back to them after I forget what I did 5 minutes from now.
    1. Sign into Alchemy with google
    https://dashboard.alchemyapi.io/apps/d8wedo96vjsesxnw
    2. MetaMask Chrome extension connected to Ropsten Network
    Wallet funded with fake wei
    3. mkdir nft-project2
    4. cd nft-project2 and open terminal
    5. mya55@mya55:~/nft-project2$ npm init
    6. mya55@mya55:~/nft-project2$ npm install --save-dev hardhat
    7. mya55@mya55:~/nft-project2$ npx hardhat
    8. Select “create an empty hardhat.config.js”:
    9. mya55@mya55:~/nft-project2$ mkdir contracts
    10. mya55@mya55:~/nft-project2$ mkdir scripts
    11. Create contracts/MyNFT.sol and paste code
    12. remove the word Ownable on line 10 and onlyOwner on line 17 ?
    13. constructor() ERC721("SpiFiGen", "SFG")
    14. mya55@mya55:~/nft-project2/contracts$ npm install @openzeppelin/contracts
    15. mya55@mya55:~/nft-project2$ npm install dotenv --save
    16. create .env file in /nft-project2/
    17. Populate with Alchemy and MetaMask keys
    18. /nft-project2$ npm install --save-dev @nomiclabs/hardhat-ethers ethers@^5.0.0
    19. UPDATE HARDHAT.CONFIG.JS
    20. mya55@mya55:~/nft-project2$ npx hardhat compile
    21. Create /scripts/deploy.js
    22. mya55@mya55:~/nft-project2$ npx hardhat --network ropsten run scripts/deploy.js
    23. Compiled 1 Solidity file successfully
    Contract deployed to address: 0x157FCaD0869E00E1412C3af5C6AC21f7D22c8783
    24. https://ropsten.etherscan.io/
    25. END: https://ethereum.org/en/developers/tutorials/how-to-write-and-deploy-an-nft/
    26. Start: https://ethereum.org/en/developers/tutorials/how-to-mint-an-nft/
    27. mya55@mya55:~/nft-project2$ npm install @alch/alchemy-web3
    28. /scripts/ CREATE A MINT-NFT.JS FILE
    29. Code with ABI file location and contract address from etherscan.io
    30. contract: 0x157fcad0869e00e1412c3af5c6ac21f7d22c8783
    31. mintNFT("https://spideronfire.com/SpiFiGen/metadata.js")
    instead of IPFS Pinata upload
    32. node scripts/mint-nft.js
    33. The hash of your transaction is:
    0x86c7937597433eb4f9de36902081baf6849e2bbd6f0952730d8423a34ac360a2
    Check Alchemy's Mempool to view the status of your transaction!
    34. https://dashboard.alchemyapi.io/mempool
    35. Start https://ethereum.org/en/developers/tutorials/how-to-view-nft-in-metamask/
    36. Open MetaMask Android. Ropsten Network. Import NFT from contract address
    37. It WORKED!

    2 comments:

    1. This comment has been removed by the author.

      ReplyDelete
    2. Definitely, this actually happens. If you are thinking about hiring app developers near me, then there are many benefits associated with this move.
      Eiliana.com is a global freelancing platform that offers you the benefit to hire a freelancer according to your preferred location.

      ReplyDelete