Lumia - The RWA Chain
  • What is Lumia Chain?
  • Polygon
    • CDK
    • AggLayer
    • Miden
    • Passport
  • ⛓️Lumia
    • Architecture
    • Roadmap
    • LUMIA Token
      • Token Swap Guide (UI)
      • Token Swap Guide (SmartContract)
    • 普通话 - LUMIA 代币
    • rwaUSD
    • HyperNodes
    • zkProvers
      • zkProver Network (zkN) via Gevolut
    • Sequencer
      • Decentralised Sequencer Network (DCN)
    • Data Availability
      • Validium
      • Volition (Enhanced Validium)
      • What is Avail DA?
        • How does AvailDA Scale?
        • Benefits of AvailDA
      • Lumia DA - Lightclient Nodes
    • Lumia Stream
      • Node Owned Liquidity
      • Liquidity Restaking
    • Interoperability
      • Polygon AggLayer
      • HyperLane
    • KYC
    • Chain & Account Abstraction with Intents
      • Particle Connect on Lumia
    • Real World Assets (RWA) on Lumia
  • 🛠️Build
    • Introduction
      • Accounts and Wallets
      • Setup Metamask with Lumia Chain
      • Bridge to/ from Lumia L2
      • Setup FoxWallet with Lumia Chain
    • Explorers
    • Build Environment
      • RPC
        • RPC Guide
      • Add Lumia Network to MetaMask
      • Testnet Tokens
    • SmartContracts
      • Deployment
        • Hardhat
        • Truffle
      • Verify
        • Hardhat
        • Truffle
      • Interact
      • Relay
      • Web3 Functions
    • On-Chain KYC
    • Oracles
      • API3
      • Supra
      • Commodity Prices
    • Indexers
      • Indexing with TheGraph
      • Indexing with Goldsky
    • zkNode
      • Run Local Validium Node
      • Run an RPC
        • JSON RPC Endpoints
      • Gas Fees
    • DA Lightclient
    • CDK Repos
    • rwaUSD
      • rwaUSD: Overcollateralizing
      • rwaUSD: Bridging
    • FAQs
Powered by GitBook
On this page
  • Initialize Your Project
  • Setting up Your Account​

Was this helpful?

  1. Build
  2. SmartContracts
  3. Deployment

Hardhat

Initialize Your Project

If you're starting your Hardhat project from scratch, we recommend you read the Hardhat Quick Start page.

Setting up Your Account​

The quickest way to get Hardhat to deploy contracts to a non-local TestNet, is to export and use an existing MetaMask account.

To get an account's private key from MetaMask:

  1. Open MetaMask.

  2. Select the account you want to export.

  3. Click the three dots on the right side.

  4. Select "Account Details".

  5. Select "Export Private Key".

  6. Enter your password and select "Confirm".

You should see a 64-character hex string similar to the following:

60ed0dd24087f00faea4e2b556c74ebfa2f0e705f8169733b01530ce4c619883

Create a new file in your root folder called private.json with your private key in it:

{
  "privateKey": "60ed0dd24087f00faea4e2b556c74ebfa2f0e705f8169733b01530ce4c619883"
}

Modify your hardhat.config.js file to include:

// hardhat.config.js

// ...

const { privateKey } = require("./private.json");

// ...

module.exports = {
  // ...

  networks: {
    // Lumia faucet: https://testnet-faucet.lumia.org
    lumia-testnet: {
      url: "https://testnet-rpc.lumia.org",
      chainId: 1952959480,
      accounts: [privateKey],
    },

    // ...
  },
};

Once your accounts are funded, you can deploy the sample contract to Lumia Testnet with npx hardhat run --network lumia-testnet scripts/deploy.js.

PreviousDeploymentNextTruffle

Last updated 11 months ago

Was this helpful?

🛠️