Home

Awesome

EOS Block Producer

This is a Terraform module to create an EOS Block Producer (BP) node on Google Cloud Platform (GCP).

The instructions for use assume an understanding of how a BP node works, full documnetation can be found on the EOS.io website https://developers.eos.io/manuals/eos/latest/index placeholder values have been used where possible and will need to be replaced as per the instructions.

Instructions

  1. gcloud SDK installed
  2. Terraform 0.13 installed
  3. A GCP project (create with the command gcloud projects create <PROJECT_NAME>)
  4. Set project as active (use the command gcloud config set project <PROJECT_NAME>)
<!-- 4. Enable the following APIs in the GCP project -->
  1. Update EOS configuration files. Sample "config.ini" files are given which need to be updated according to the requirements. Agent name, Block producer key etc.
  2. A GCS Storage bucket (create with the command `gsutil mb gs://<BUCKET_NAME>')
    • Copy the required files to this bucket with the command gsutil cp configs/*_config.ini.tpl gs://<BUCKET_NAME>/config_ini/
  3. Update example.terraform.tfvars and rename to terraform.tfvars variables are detailed in table below
  4. Update backend.tf to store terraform state file in a GCS bucket
  5. Run terraform init
  6. Run terraform plan and review the output
  7. Run terraform apply

Terrform Variables

  1. Update backend.tf Replacing bucket = "my-new-bucket" with the bucket name to save terraform state.

  2. Update terraform.tfvars

variablevalue
org_idOrganization ID
project_idProject ID
regionRegion where resources will be created.
subnetnamename of the subnet to be created
networkname of the network to be created
subnetThe subnet in CIDR notation for the network
disk_typeDisk type, either pd-standard, pd-balanced, or pd-ssd
disk_sizeDisk size in MB

Resources created by the script

This terraform script will set-up Block Produer environment. It includes following list of Components.

ComponentDescriptionDetails
sign MIGManaged instance group for Singing API nodes.Maximum 2 instances, Auto-heal
peer MIGManaged instance group for peering API nodes.Maximum 2 instances, Auto-heal
web MIGManaged instance group for Chain API nodes.Maximum 2 instances, Auto-heal
sign instance templateInstance Template for Singing noden2-Standard-16
web instance templateInstance Template for Web node (Chain API)n2-Standard-4
peer instance templateInstance Template for Peering noden2-Standard-8
Service Accounts3 service accouts are created for each type of instances.peer service account, web service account, sign service account
TCP LBTCP Load Balancers for Peer and Chain API Nodes2 LB
HTTP LBHTTP Load Balancers for Peer and Chain API Noes2 LB
VPC and SubnetSingle non-default VPC with 1 subnet is created.
TCP health checkTCP health check on port 8888 and 9876''
HTTP health checkHTTP health check on port 8888''
CloudNATAll instances only have internal IP address. Internet is accessed via CloudNAT''