Sight AI
  • πŸ‘‹Overview
    • πŸ₯FHE
    • 🍍The Problem
  • πŸ‡Sight Oracle
    • πŸ’‘Concepts
      • πŸ‰Architecture
      • πŸ“”Contract
      • 🟠Decentralized Oracle Node Network
      • πŸ“ FHE Compute Execution Virtual Machine
      • πŸ“ƒRequestBuilder
    • ⏩Supported Networks
  • Sight Contracts
    • Getting Started
    • Understanding Request Model
  • SIGHT.JS
    • Getting Started
    • Make an encrypt value - CLI
    • Make an encrypt value - Frontend
  • ℹ️Tutorial
    • Environment Setup
      • Prerequisite
      • Setup Local Development Environment
      • Fund Local Wallet
    • πŸ‘·Create Your First dAPP using Hardhat
    • πŸ› οΈCreate Your First dAPP using Foundry
    • 🎲Create a Crypto Pusher Game
      • Contract
      • Interface
    • πŸ“„Remix FHE Demo Local Deployment Tutorial- Preparation
    • πŸ“„Remix FHE Demo Local Deployment Tutorial- Deploying Contracts Using Remix
    • πŸ“„Remix FHE Demo Local Deployment Tutorial- Contracts Explanation&Interaction
  • πŸ”ŽResearch
    • βœ…Verifiable FHE
    • 🌟SPARC
    • πŸ“…Research Updates
  • πŸ“Innovative Use Cases and dApps
    • πŸ₯₯FHE On-Chain Game
    • A Fairer Prediction Markets with Sight Oracle
  • 🍻Roadmap
  • 🎨Community
    • Website
    • Twitter
    • Telegram
    • Github
  • Sight Incentive Plan - Season 1
  • Sight Incentive Plan - Season 2
Powered by GitBook
On this page
  1. Tutorial

Remix FHE Demo Local Deployment Tutorial- Preparation

PreviousInterfaceNextRemix FHE Demo Local Deployment Tutorial- Deploying Contracts Using Remix

Last updated 6 months ago

This guide will walk you through the steps to locally deploy an FHE (Fully Homomorphic Encryption) demo using Remix. We will be using the popular Hardhat framework for the project. Follow the instructions carefully to set up the environment, deploy contracts, and run the demo successfully.

Step 1: Prerequisites

Before starting, ensure you have the following installed on your system:

β€’ Node.js: Download and install from .

β€’ Docker: Download and install from .

Step 2: Setting Up the Hardhat Environment

We will use Hardhat for contract deployment and testing. Hardhat projects are Node.js projects that include the hardhat package and a hardhat.config.js configuration file.

Start the Sight Environment Locally

git clone https://github.com/sight-ai/sight-oracle-contract-example-hardhat
cd sight-oracle-contract-example-hardhat
npm install
cp -f .env.example .env

β€’ The git clone command clones the Sight Oracle example repository to your local machine.

β€’ npm install installs the necessary project dependencies.

β€’ cp -f .env.example .env copies the example environment configuration to a new .env file.

2. Start the Sight Environment

Use the following command to start the Sight environment locally:

npm run sight:stop ;npm run sight:start

β€’ Note: This process may take 3-5 minutes to complete.

β€’ Docker Requirement: If you are using Docker Desktop, ensure you are logged in and have the Docker application running before executing this command.

This command sets up a complete Sight environment, which includes:

β€’ An EVM (Ethereum Virtual Machine) chain

β€’ An FHEVM chain

β€’ A backend service

β€’ A database

Once everything is set up, you should see logs from the backend service monitoring events on the chain. The output should resemble the example shown below (add an image of the expected output if available).

Step 3: Setting Up Your Local Test Network in MetaMask

To deploy and interact with your contracts on the local test network, you need to configure your MetaMask wallet to connect to this local chain.

1. Open MetaMask:

β€’ Click on the MetaMask extension in your browser and unlock your wallet.

2. Add a New Network:

β€’ Click on the network dropdown (usually defaults to β€œEthereum Mainnet”) and select β€œAdd Network”.

β€’ Enter the following details for the local test network:

β€’ Network Name: Localhost 18545

β€’ New RPC URL: http://localhost:18545

β€’ Chain ID: 31337

β€’ Currency Symbol: ETH (optional)

3. Save the Network Configuration:

ℹ️
πŸ“„
Node.js official website
Docker official website