How to deploy the entire off-chain oracle relayer infrastructure from scratch.
- The Terraform State for this project lives in our shared Terraform Seed Project with the ID
mento-terraform-seed-ffac - Deploying the project for the first time should automatically create a subfolder in the google storage bucket used for terraform state management in the seed project
The project is preconfigured to impersonate our shared terraform service account (see ./infra/versions.tf).
The only permission you will need on your own gcloud user account is roles/iam.serviceAccountTokenCreator to allow you to impersonate our shared terraform service account.
If for whatever reason service account impersonation doesn't work, you'll need at least the following permissions on your personal gcloud account to deploy this project with terraform:
roles/resourcemanager.folderVieweron the folder that you want to create the project inroles/resourcemanager.organizationVieweron the organizationroles/resourcemanager.projectCreatoron the organizationroles/billing.useron the organizationroles/storage.adminto allow creation of new storage buckets
-
Run
./bin/set-up-terraform.shto check required permissions and provision all required terraform providers, modules, and workspaces -
Deploy the celo-sepolia project via
npm run deploy:celo-sepolia(which usesterraform apply)-
You will see an overview of all resources to be created. Review them if you like and then type "Yes" to confirm.
-
This command can take up to 10 minutes because it does a lot of work creating and configuring all defined Google Cloud Resources
-
❌ Given the complexity of setting up an entire Google Cloud Project incl. service accounts, permissions, etc., you might run into deployment errors with some components.
Often a simple retry of
terraform applyhelps. Sometimes a dependency of a resource has simply not finished creating when terraform already tried to deploy the next one, so waiting a few minutes for things to settle can help.
-
-
Set your local
gcloudcontext to the correct project, region etc.# This script will also cache some gcloud values into a local file which speeds up tasks like `npm run logs` npm run cache:clear -
Check that everything worked as expected
# Check that the function is up and receiving events by checking the logs npm run logs # If you prefer the cloud console: npm run logs:url
-
Now deploy the celo project via
npm run deploy:celo(which usesterraform apply) -
Update your local
gcloudcontext to celo via./bin/get-project-vars.shagain -
And check this also worked via
npm run celo && npm run logs
For most problems, you'll likely want to check the cloud function logs first.
npm run logswill print the latest 50 log entries into your local terminal for quick and easy accessnpm run logs:urlwill print the URL to the function logs in the Google Cloud Console for full access
Note: You might run into permission issues here, especially around deleting the associated billing account resources. I didn't have time to figure out the minimum set of permissions required to delete this project so the easiest would be to let an organization owner (i.e. Bogdan) run this with full permissions if you face any issues.
- Run
npm run destroy:celo-sepoliato delete the entire celo-sepolia environment from google cloud - Run
npm run destroy:celoto delete the entire celo environment from google cloud