This repository contains IAC code to setup chainlink nodes and relevant resources in GCP
See the github-module for the source terraform repository from where the module is inherited.
Check Terraform registry chainlinknode for Provision Instructions.
Clone this git repo Add service_account.json file in your root folder with your cloud provider and project details. For help check this
Install terraform
- Select what node_type ( FM / OCR / Keeper ), you want to add
- Duplicate any of the given folders inside it. ( e.g.bsc / eth )
- Edit main.tf file.
- Make sure you have the latest version of the registry.
- Go to state.tf file. Edit prefix = "cl/<node_name>-<node_type>.tfstate". This will store the state in GCP
- Again in terraform.tfvars file , edit these two values ( you can configure other values as wqell if required )
node_name = <node_name>
node_type = <node-type>
Create a bash file in this format "<node_name>-<node_type>-startup.sh". Add your application code here. For reference check files here. Upload the file in the above bucket.Check the gsutil URI. It will read something like this : gs://myc-node/cl/cl-metadata-script/xdai-fm-startup.sh
- Keep outputs.tf , provider.tf , variables.tf files as is.
- Thats it!
Initialise your terraform in the respective folder.
terraform init
Run to check the execution flow.
terraform plan
Once satisfied , apply to start the execution
terraform apply --auto-approve
- Run to check what all resources will be destroyed.
terraform destroy
- Once happy you can enter yes and the node with its associated resources will be deleted
Name | Description | Type | Default | Required |
---|---|---|---|---|
region | Region where the instances should be created. | string |
`` | no |
zone | Zone where the instances should be created. If not specified, instances will be spread across available zones in the region. | string |
`` | no |
machine_type | Machine configuration for CPU and Memory. | string |
`` | yes |
node_name | Name of CL node. | string |
`` | yes |
node_type | Type of CL node. | string |
`` | yes |
project_id | Project ID in GCP for the code to be deployed. | string |
`` | yes |
Name | Description |
---|---|
disk_names | The boot disk name of the node |
instance_name | The name of the VM instance holding the node |
disk_size | The disk size allocated to the node |
gcs_startup_script | The private bucket location for the startup script of the node |
external_ip_addresses | The public IP address of the node |
external_ip_names | The public static IP names of the node |
internal_ip_addresses | The internal static IP address of the node |
internal_ip_names | The internal static IP names of the node |