gateway-contracts/docs/getting-started/deployment/docker_deploy.md
Here is an example of how to deploy contracts on a local network using Docker.
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.
Build the Docker image:
make docker-compose-build
Then start the containers:
make docker-compose-up
This should create several containers, in particular:
anvil-node: A local Ethereum network with chain id 54321 on port 8546deploy-gateway-contracts: Deploys the contractsadd-host-chains: Adds the host chains to the GatewayConfig contract, which runs after the contracts are deployedTo check if the deployment is successful, run the following commands:
docker logs deploy-gateway-contracts
If the logs show Contract deployment done!, the contracts were deployed successfully.
Then check:
docker logs add-host-chains
If the logs show Host chains registration done!, the host chains were registered successfully.
Both steps are required and should be run in this particular order before interacting with the contracts. In particular, if host chains are not registered properly, several transactions are expected to be reverted.
When finished, clean up the containers:
make docker-compose-down