gateway-contracts/docs/getting-started/deployment/local_deploy.md
Here is an example of how to deploy contracts on a local network using hardhat.
First, git clone FHEVM-gateway repo and install dependencies with
npm install
All needed environment variables are defined in the Environment variables documentation.
For deploying the FHEVM gateway contracts, these variables need to be set in an .env file. However, the following make commands automatically copy the .env.example file to .env and update it with the correct values:
Important: By default, the accounts used are already funded. If other addresses are used, make sure they are funded as well.
Launch a hardhat node:
make start-local-node
This runs a local Ethereum network on port 8757.
Deploy the contracts using the localGateway network:
make deploy-contracts-local
This:
deployAllGatewayContracts task found in deploy.tsGatewayConfig contract through the addHostChainsToGatewayConfig task found in addHostChains.tsRun all tests on the local network:
make test-local
A --skip-setup flag is used to avoid re-deploying the contracts before running the tests.