# 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](https://nodejs.org/).

• Docker: Download and install from [Docker official website](https://www.docker.com/).

**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

```bash
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:

```bash
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:
