Testnet Deployment
NOTE: Ensure you meet the prerequisites before deploying a dApp.
Deploy your dApp by following the steps:
Step 1: Connect Wallet
Follow the steps to connect your Metamask wallet.
Step 2: Create Script
You can:
Import your GitHub repository with your dApp.
Import GitHub Repository
Open Remix IDE. The File explorer tab will open.
Go to the Git tab.
The “Git” tab On the Git tab, expand the GITHUB SETUP block.
The “GITHUB SETUP” block in the “GitHub” tab In the GITHUB SETUP block:
Click Login with GitHub. The instructions on how to connect your GitHub account will appear.
The “Login with GitHub” button Follow the given instructions.
On the Git tab, expand the CLONE block.
The “CLONE” block In the CLONE block:
Click Load from GitHub. The field with your GitHub account's repositories will open.
The “Load from GitHub” button From the field with your account's repositories, select the relevant repository.
From the field with the repository's branches, select the relevant branch.
Click clone USERNAME_REPOSITORY:BRANCH. The dApp script will be available on the File explorer tab.
The specified repository parameters
Create New Script
Open Remix IDE. The File explorer tab will open.
On the File explorer tab, click Create new file. The field to enter the filename will open.
The “Create new file” button In the field, enter the filename. The FILENAME.sol window will open.
The entered dApp filename Copy and paste the script to the FILENAME.sol window:
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract MessageLogger { // Variable that stores the message. string private currentMessage; // Method that updates the message. function updateMessage(string calldata newMessage) external { currentMessage = newMessage; } // Method that retrieves the current message. function fetchMessage() external view returns (string memory) { return currentMessage; } }
The entered dApp script
Step 3: Compile Script
In Remix IDE, go to the Solidity compiler tab.
The “Solidity compiler” tab On the Solidity compiler tab, click Compile FILENAME.sol.
The “Compile FILENAME.sol” button
Step 4: Deploy dApp
In Remix IDE, go to the Deploy & run transactions tab.
The “Deploy & run transactions” tab On the Deploy & run transactions tab:
From the Environment drop-down list, select the Injected Provider - MetaMask. The MetaMask extension will open.
The “Injected Provider - MetaMask” option
In the MetaMask extension, click Connect.
The “Connect” button in the MetaMask extension On the Deploy & run transactions tab, click Deploy. The MetaMask extension will open.
The “Deploy” button In the MetaMask extension, click Confirm. The Deployed Contracts block will display the address of the deployed dApp.
The “Confirm” button in the MetaMask extension Optional. In the Deployed Contracts block, click Copy Address.
The “Copy Address” button
Last updated