Environment Setup
Prerequisite
In this section, we list items needs to be complete before start building.
Start the Sight environment locally.
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.
Deployment Config
To deploy the contract on the Sepolia test network, you first need to obtain some Sepolia test tokens and the Sepolia RPC URL.
If you donât have a Sepolia RPC yet, you can click here to require one.
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
Wallet Installation
Install Metamask
Create a account
Add Ethereum-Sepolia Testnet to your MetaMask wallet (Click here)
Check the box for "Include Testnets," then click "Add to MetaMask."
Get testnet token
Request ETH token from faucet below:
Main (Sepolia): Sepolia Faucet (0.05ETH)
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.
Next Steps
You now have completed Prerequisite items, choose one of the development framework to get started:
Remix
Note: For any questions or suggestions related to the tutorial, please submit issues to github issue page here
Last updated