Let’s dive into the world of blockchain with our step-by-step guide. Whether you're a newbie or an aspiring developer, this guide will help you set up a crypto wallet, get testnet faucets, and deploy your very own NFT smart contract on Arbitrum testnet.
- Visit MetaMask's official website.
- Choose the option to install MetaMask for your browser by clicking "Install MetaMask for Chrome."
- This will redirect you to the Chrome Web Store. Ensure you are downloading from a trusted source.
- Click "Add to Chrome," and then "Add Extension" to install the MetaMask browser extension.
- Once installed, MetaMask will open automatically.
- Click on the MetaMask icon in your browser and select "Create a Wallet."
- Create a secure password. This password will be used to unlock the MetaMask extension on your computer.
- Watch the informational video provided by MetaMask to understand how it works.
- You will then be presented with your Secret Backup Phrase (also known as a recovery phrase or wallet seed phrase).
- Important: This 12-word phrase is your super secret password. Back it up securely. Losing this phrase means losing access to your tokens, and anyone who has this phrase can access your wallet.
- After backing up your phrase, MetaMask will test your backup by asking you to confirm it.
- Follow the security tips provided by MetaMask to enhance the safety of your wallet.
- Once backed up, you have successfully created and secured your wallet!
- Click the MetaMask fox icon in the top right corner of your browser to open your wallet.
- Your Ethereum address is a string of letters and numbers starting with "0x....". Click on it to copy it to your clipboard.
- For more options, click the three dots to view "Account Details" or "View on Etherscan."
Congratulations! You now have a functional MetaMask wallet to interact with the Ethereum blockchain.
For more details on how to setup a MetaMask wallet, visit this link.
- Go to this link to access the faucet.💸
- Click on "Connect Wallet" and select your wallet (e.g., MetaMask).🔗
- Click on "Generate Tweet for Me" and share the tweet as directed.🐦
- Copy the tweet link and paste it in the provided field, then click "Next."🔗
- Join the required Discord server by clicking on the provided link, then click "Next."💬
- Fill out the captcha to verify you're not a robot.✅
- Click on the "Claim 0.03 ETH" button to receive your testnet ETH.💸
Whooaa! 🎉 You now have the faucet ETH in your address.
Let's deploy your very own NFT smart contract on the Arbitrum testnet. Follow these steps, and you'll have your unique NFT in no time.
NFTs, or Non-Fungible Tokens, are unique digital assets that represent ownership of a specific item or piece of content on the blockchain. Unlike cryptocurrencies such as Bitcoin or Ethereum, NFTs are indivisible and unique, making them perfect for representing ownership of digital art, collectibles, and more. 🎨
First, let's clone the repository that contains our NFT smart contract.
git clone https://github.com/Bhumi18/Blockchain-Basics.git
cd Blockchain-BasicsNavigate to the cloned repository and install the necessary dependencies.
npm installYou'll need to set three environment variables: ARBITRUM_PRIVATE_KEY, ARBITRUM_RPC_URL, and ARBITRUM_API_KEY. Follow the steps below to obtain the necessary values and set them up:
To export your private key from MetaMask:
- Open MetaMask.
- Go to Account Details.
- Select Export Private Key.
- Important: NEVER put real Ether into testing accounts.
To get the RPC URL:
- Sign up for Alchemy.
- Create a new app in Alchemy.
- Go to the Networks section of the app.
- Select Arbitrum Sepolia.
- Copy the link that starts with https://....
To get your API key:
- Log in to Arbiscan.
- Go to My Account and get your API key.
Run the following commands and add the values when prompted:
npx hardhat vars set ARBITRUM_PRIVATE_KEYnpx hardhat vars set ARBITRUM_RPC_URLnpx hardhat vars set ARBITRUM_API_KEYBy following these steps, you'll have your environment variables set up and ready for use with Arbitrum.
Next, let's compile our smart contract to ensure everything is set up correctly.
npx hardhat compileFinally, let's test our contract to ensure it's functioning as expected. 🧪
npx hardhat testWith our contract compiled, we can now deploy it to the Arbitrum testnet. Make sure you have the Arbitrum Sepolia faucet in your account, and that you have added the private key correctly.
npx hardhat ignition deploy ignition/modules/Collectible.ts --network arbitrumSepoliaBoom!🚀 You have just deployed your NFT contract. Use the contract address to see your deployed contract on the explorer.
After deployment, we can verify our contract on Arbitrum Sepolia Scan.
npx hardhat verify YOUR_CONTRACT_ADDRESS --network arbitrumSepoliaYou can see my deployed contract on this link.