LogoLogo
  • Gather Fundamentals
    • INTRODUCTION TO GATHER
    • GTH
    • TOKEN STANDARDS
      • CREATE YOUR FIRST GRC-20 TOKEN
      • CREATE YOUR FIRST GRC-721 TOKEN
    • NETWORKS
    • CONSENSUS
      • PROOF-OF-WORK (POW) & GTHASH
    • BLOCK EXPLORER
    • BRIDGE
    • MULTI-SEND
  • GATHER DEVELOPEMENT STACK
    • WALLET SETUPS
      • GATHER WEB WALLET
      • METAMASK MAINNET CONFIGURATION
      • METAMASK TESTNET CONFIGURATION
    • SMART CONTRACTS & DAPPs
      • DEPLOYING YOUR FIRST SMART CONTRACT
      • HARDHAT CONFIGURATION AND DEPLOYMENT
      • TRUFFLE CONFIGURATION AND DEPLOYMENT
      • BUILDING AN ESCROW SMART CONTRACT
      • BUILDING AN E-COMMERCE SHOPPING SMART CONTRACT
      • DEPLOYING NFT MARKETPLACE DAPP
      • DEPLOYING DE-FI BANK DAPP
      • DEPLOYING DECENTRALIZED TWITTER
    • TESTNET FAUCET
    • COVALENT
    • THIRDWEB
    • VERIFY SMART CONTRACTS
      • VERIFY CONTRACTS ON SOURCIFY VIA REMIX IDE
      • VERIFY CONTRACTS USING HARDHAT
Powered by GitBook
On this page
  1. GATHER DEVELOPEMENT STACK
  2. SMART CONTRACTS & DAPPs

TRUFFLE CONFIGURATION AND DEPLOYMENT

PreviousHARDHAT CONFIGURATION AND DEPLOYMENTNextBUILDING AN ESCROW SMART CONTRACT

Last updated 3 years ago

This document is a guide to help you configure your Truffle and deploy your dapp smart contracts for Gather Network.

Follow these steps in sequential order:

  1. In your Truffle dapp project open the file named truffle-config.js and add the details of a Gather Network (testnet and mainnet) in the networks object:

    const mnemonic = "Enter_your_account_mnemonic_here";
    gather-testnet: {
          provider: () => new HDWalletProvider(mnemonic, `https://testnet.gather.network`),
          port: 80,
          network_id: 356256156,
      },
          
    gather-mainnet: {
          provider: () => new HDWalletProvider(mnemonic, `https://mainnet.gather.network`),
          port: 80,
          network_id: 192837465,
      }
  2. Compile your dapp smart contract and migrate on the Gather network configured in the previous step.

    • For testnet:

      truffle migrate --compile-all --reset --network gather-testnet
    • For mainnet:

      truffle migrate --compile-all --reset --network gather-mainnet
  3. You have now deployed the smart contracts of your dapp on the Gather blockchain. You can now easily interact with your smart contract deployed on the Gather Network blockchain using your dapp frontend or Truffle commands:

    Follow this link for the truffle documentation:

Truffle | Overview | Documentation | Truffle Suite