Polygon node connection is an advantage for any dApp: from on-chain games to trading bots. Polygon (MATIC) API endpoint by GetBlock is an instrument of choice for many early-stage teams. This is an easy step-by-step tutorial on how to create and deploy a smart contract on the Polygon test network using a virtual wallet (Metamask), Risk, and GetBlock.
What you will learn
To create a smart contract in this tutorial, you will learn how to use GetBlock to:
Create a smart contract on Polygon (Mumbai) using GetBlock endpoints.
What you will do
Following the tutorial, you will:
- Get started on GetBlock and access GetBlock test nodes
- Create a wallet address with Metamask
- Add balance to the wallet (using test tokens)
- Use Remix to compile and deploy a Smart Contract
- Check contract status
- So the first step is to sign up with Getblock via wallet or email
2. Create an endpoint for Polygon Tesnet (Mumbai)
3. Then enter Metamask and choose to connect a network manually, connect your Metamask to the Polygon Testnet Network adding your GetBlock endpoint to the “RPC URL” line
If you have a no balance in your account, you can request tokens on Mumbai faucet here: https://mumbaifaucet.com/
Smart Contract Development
- Go to Remix (Remix is a web-base Integrated Development Environment (IDE) for Ethereum smart contract development in Solidity).
- Let’s take “Storage.sol” from Remix as an example of a contract
3. Proceed by deploying
4. Choose the Injected provider “Metamask”
Testing the Smart Contract
There were 12 in the storage. To check, change the value to 14.
In the “Store” field, enter the number 14 and save it on the network after confirming the operation in Metamask
Waiting for the transaction to be added to the network block.
Then we make sure that the saved value has changed from 12 to 14
All done! Congratulations on deploying your smart contract.
This is how you deploy an easy Smart Contract on Polygon using Remix and GetBlock.
If you have any additional questions or would like to share your experience, feel free to join our community of Web3 developers who are always ready to chat.