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 GitHub Repository

  1. Open Remix IDE. The File explorer tab will open.

  2. Go to the Git tab.

    The “Git” tab
  3. On the Git tab, expand the GITHUB SETUP block.

    The “GITHUB SETUP” block in the “GitHub” tab
  4. In the GITHUB SETUP block:

    1. Click Login with GitHub. The instructions on how to connect your GitHub account will appear.

      The “Login with GitHub” button
    2. Follow the given instructions.

  5. On the Git tab, expand the CLONE block.

    The “CLONE” block
  6. In the CLONE block:

    1. Click Load from GitHub. The field with your GitHub account's repositories will open.

      The “Load from GitHub” button
    2. From the field with your account's repositories, select the relevant repository.

    3. From the field with the repository's branches, select the relevant branch.

    4. Click clone USERNAME_REPOSITORY:BRANCH. The dApp script will be available on the File explorer tab.

      The specified repository parameters

Create New Script

  1. Open Remix IDE. The File explorer tab will open.

  2. On the File explorer tab, click Create new file. The field to enter the filename will open.

    The “Create new file” button
  3. In the field, enter the filename. The FILENAME.sol window will open.

    The entered dApp filename
  4. 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

  1. In Remix IDE, go to the Solidity compiler tab.

    The “Solidity compiler” tab
  2. On the Solidity compiler tab, click Compile FILENAME.sol.

    The “Compile FILENAME.sol” button

Step 4: Deploy dApp

  1. In Remix IDE, go to the Deploy & run transactions tab.

    The “Deploy & run transactions” tab
  2. On the Deploy & run transactions tab:

    1. From the Environment drop-down list, select the Injected Provider - MetaMask. The MetaMask extension will open.

      The “Injected Provider - MetaMask” option
  3. In the MetaMask extension, click Connect.

    The “Connect” button in the MetaMask extension
  4. On the Deploy & run transactions tab, click Deploy. The MetaMask extension will open.

    The “Deploy” button
  5. 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
  6. Optional. In the Deployed Contracts block, click Copy Address.

    The “Copy Address” button

Last updated