The gateway acts as a bridge between the execution layer and the Threshold Key Management System (TKMS). Due to its central role, it needs to be properly configured. This document details all the environment variables and gives an example of docker compose to run the gateway.
Zama Gateway: Depends on fhEVM and Gateway KV Store, which is initialized with the Zama KMS Docker Compose command. Therefore, this is the last Docker Compose command that should be run.
Docker 26+ installed on your system.
fhEVM validator running and configured.
TKMS running and configured.
Zama Gateway requires several specific configurations as shown in the provided docker-compose-gateway.yml
file.
GATEWAY__ETHEREUM__CHAIN_ID
Chain ID for fhEVM
9000
GATEWAY__ETHEREUM__LISTENER_TYPE
Listener type for Ethereum gateway
FHEVM_V1_1
GATEWAY__ETHEREUM__WSS_URL
WebSocket URL for fhEVM Ethereum. You need to run fhEVM first and set this data
ws://localhost:9090
GATEWAY__ETHEREUM__FHE_LIB_ADDRESS
FHE library address for Ethereum gateway. This should be obtained from fhEVM once it is running and configured
000000000000000000000000000000000000005d
GATEWAY__ETHEREUM__ORACLE_PREDEPLOY_ADDRESS
Oracle predeploy contract address for fhEVM gateway
c8c9303Cd7F337fab769686B593B87DC3403E0cd
GATEWAY__KMS__ADDRESS
Address for KMS gateway
http://localhost:9090
GATEWAY__KMS__KEY_ID
04a1aa8ba5e95fb4dc42e06add00b0c2ce3ea424
GATEWAY__STORAGE__URL
URL for storage gateway
http://localhost:8088
ASC_CONN__BLOCKCHAIN__ADDRESSES
Blockchain addresses for ASC connection. Same as GATEWAY__KMS__ADDRESS
http://localhost:9090
GATEWAY__ETHEREUM__RELAYER_KEY
Private key of the relayer
7ec931411ad75a7c201469a385d6f18a325d4923f9f213bd882bbea87e160b67
Run the Zama Gateway Docker Compose:
To obtain the Key ID
for the GATEWAY__KMS__KEY_ID
environment variable, run the following command:
Key ID for KMS gateway. Refer to the section
Requirement: At start, the Gateway will try to connect to the websocker URL GATEWAY__ETHEREUM__WSS_URL
. Ensure it is running and the port is opened.