Environment Setup
Last updated
Last updated
In this section, we list items needs to be complete before start building.
First, clone the pre-prepared example code repository to your local machine.
In these commands, we will clone the Sight Oracle example code locally, install the necessary dependencies using npm
, and finally use the cp
command to copy the contents of .env.example
to a new .env
file.
Next, letβs run this command to start Sight environment. It may take 3-5 minutes to complete.
Note: If you are using Docker Desktop, please make sure you have logged in and opened the Docker application in advance.
It will launch a complete Sight environment locally with a single command, including an EVM chain, an FHEVM chain, a backend service, and a database. Once everything is set up, you should see information from the backend service monitoring events on the chain being printed, similar to the output shown in the image below.
To deploy the contract on the Sepolia test network, you first need to obtain some Sepolia test tokens and the Sepolia RPC URL.
Note: You can get the
private key
through MetaMask by going to Account Details => Export Private Key (Please use a test wallet, as leaking the private key poses a risk of account theft!).
Add these environment variables to the .env
file. SEPOLIA_ORACLE_CONTRACT_ADDRESS
is the Oracle address we have deployed on the Sepolia test network.
Add the Sepolia network configuration information to the hardhat.config.ts
file
Create a account
Check the box for "Include Testnets," then click "Add to MetaMask."
Request ETH token from faucet below:
Enter your account address in the input box below, then click Receive 0.05 Sepolia ETH button. After waiting for a while, you can check your balance in Metamask.
You now have completed Prerequisite items, choose one of the development framework to get started:
Remix
If you donβt have a Sepolia RPC yet, you can click to require one.
Install
Add Ethereum-Sepolia Testnet to your MetaMask wallet (Click )
Main (Sepolia): (0.05ETH)
Note: For any questions or suggestions related to the tutorial, please submit issues to github issue page