πRemix FHE Demo Local Deployment Tutorial- Preparation
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 Node.js official website.
β’ Docker: Download and install from Docker official website.
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
β’ 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:
β’ 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:
Last updated