This terraform repository is used to bootstrap multiple types of Solana nodes: RPC full, RPC lite, Validator. One important aspect to remember is that Solana nodes require public access because they are part of the blockchain network and need peer-to-peer connections. For this reason, the CVM will be using a public IP instead of a NAT to allow incoming peer connections. Note that all the network rules and the instance security groups only allow for ports used by Solana.
There are several things that the module can perform as follows:
- Build the underlying network setup if required - you can use the repo to also build the network setup that is later needed to provision Solana RPC nodes. If you want to deploy the node in an existing VPC then this feature is also supported and all details can be provided by using the module variables.
- Bootstrap the RPC node - within the VPC one or more CVMs will be provisioned which can be customized by using the module flags.
The following sections describe how can you bootstrap RPC nodes by using this module
Make sure to add/remove/change any values within the vpcvariables.tf file based on what is required in your setup. If using the default values several things will be deployed and configured:
- one VPC
- one route table
- one or more subnets as indicated
- one ore more network routes for the subnets
- network acls
Make sure to add/remove/change any values within the variables.tf file based on what is required in your setup. The most important variables within this file are those related to the Solana network which are needed based on what network you are trying to connect to e.g. testnet/mainnet. The setup assumes a public image from the Tencent cloud will be used for the machine, a custom image id can also be provided. The following cloud resources will be deployed:
- one or more instances
- one security group
- one or more security group resources
- several Tencent Cloud Automation Tools (TAT) commands
It is important to verify the providers.tf file and set the proper credentials and region where the setup will be deployed. Now simply execute the following commands to create the above mentioned resources
terraform init
terraform plan
terraform apply
Enter the Tencent cloud console, navigate to Cloud Virtual Machine section, expand Tencent Automation Tools and click on My Commands. Now execute each command in a sequential order as follows:
- 1-solana-setup-node
- 2-solana-system-configuration
- 3-solana-configure-process
At the end of the third step, the RPC node should be up and running, all systems configurations set, disks formatted and mounted and the Solana validator process started.
Name | Version |
---|---|
terraform | >=1.5 |
external | >=2.3.1 |
tencentcloud | >= 1.81.32 |
Name | Version |
---|---|
tencentcloud | 1.81.103 |
Name | Source | Version |
---|---|---|
acls | ./modules/vpc_acl | n/a |
Name | Type |
---|---|
tencentcloud_instance.rpc_node | resource |
tencentcloud_route_table.route_table | resource |
tencentcloud_route_table_entry.route_entry | resource |
tencentcloud_security_group.rpc_sg | resource |
tencentcloud_security_group_rule_set.rpc_sg_rule | resource |
tencentcloud_subnet.subnet | resource |
tencentcloud_tat_command.solana-configure-process | resource |
tencentcloud_tat_command.solana-setup-node | resource |
tencentcloud_tat_command.solana-system-configuration | resource |
tencentcloud_vpc.vpc | resource |
tencentcloud_images.rpc_image | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
accounts_disk_encrypt | Enable accounts disk encryption | bool |
false |
no |
accounts_disk_size | The instance accounts disk size | number |
50 |
no |
accounts_disk_type | The instance accounts disk type | string |
"CLOUD_PREMIUM" |
no |
availability_zone | n/a | string |
"The instance availability zone" |
no |
create_route_table | Enable the creation of the route table | bool |
true |
no |
create_vpc | Enable the creation of the VPC | bool |
true |
no |
enable_nat_gateway | Enable the creation of the NAT gateway | bool |
false |
no |
force_delete | Indicate whether to force delete the instance | bool |
false |
no |
image_id | The RPC node image id, if this is provided then it will override other image parameters below | string |
"img-eb30mz89" |
no |
image_name_regex | The RPC node image id, if this is provided then it will override other image parameters below | string |
"Solana" |
no |
image_type | The RPC node image type, this parameter and image_name_regex are used only if image_id is set to empty value | list(string) |
[ |
no |
instance_charge_type | The charge type of instance | string |
"POSTPAID_BY_HOUR" |
no |
instance_charge_type_prepaid_period | The tenancy (time unit is month) of the prepaid instance | number |
1 |
no |
instance_charge_type_prepaid_renew_flag | Auto renewal flag | string |
"NOTIFY_AND_MANUAL_RENEW" |
no |
instance_count | The number of RPC nodes to bootstrap | number |
1 |
no |
instance_name | The instance name prefix | string |
"solana" |
no |
instance_project | The project the instance belongs to | number |
0 |
no |
instance_tags | Specify one or more tags for the instance | map(string) |
{ |
no |
instance_type | The instance type | string |
"SA2.MEDIUM8" |
no |
ledger_disk_encrypt | Enable ledger disk encryption | bool |
false |
no |
ledger_disk_size | The instance ledger disk size | number |
50 |
no |
ledger_disk_type | The instance ledger disk type | string |
"CLOUD_PREMIUM" |
no |
nat_gateway_bandwidth | bandwidth of NAT Gateway | number |
100 |
no |
nat_gateway_concurrent | bandwidth of NAT Gateway | number |
1000000 |
no |
nat_gateway_public_ips | The list of public IPs associated with the NAT gateway | list(string) |
[] |
no |
nat_gateway_tags | Specify one or more tags for the NAT gateway | map(string) |
{ |
no |
route_entries | n/a | list(object({ |
[ |
no |
route_table_id | Specify a route table id if you want to reuse an existing route table | string |
"" |
no |
route_table_tags | Specify one or more tags for the route table | map(string) |
{ |
no |
solana_accounts_mount_point | Accounts disk mount point | string |
"/mnt/accounts" |
no |
solana_cli_directory | The location of the Solana cli | string |
"/home/sol/solana" |
no |
solana_cli_version | Solana CLI version | string |
"v1.18.14" |
no |
solana_entrypoint1 | Solana network entrypoint1 | string |
"entrypoint.testnet.solana.com:8001" |
no |
solana_entrypoint2 | Solana network entrypoint2 | string |
"entrypoint2.testnet.solana.com:8001" |
no |
solana_entrypoint3 | Solana network entrypoint3 | string |
"entrypoint3.testnet.solana.com:8001" |
no |
solana_full_rpc_api | Enable full RPC API on the node | string |
"true" |
no |
solana_genesis_hash | The expected Solana genesis hash | string |
"4uhcVJyU9pJkvQyS88uRDiswHXSCkY3zQawwpjk2NsNY" |
no |
solana_identity | The Solana node identity | string |
"/home/sol/solana/keys/validator-keypair.json" |
no |
solana_keys_directory | The location of the Solana keys | string |
"/home/sol/solana/keys" |
no |
solana_known_validator1 | Solana known validator id | string |
"5D1fNXzvv5NjV1ysLjirC4WY92RNsVH18vjmcszZd8on" |
no |
solana_known_validator2 | Solana known validator id | string |
"dDzy5SR3AXdYWVqbDEkVFdvSPCtS9ihF5kJkHCtXoFs" |
no |
solana_known_validator3 | Solana known validator id | string |
"eoKpUABi59aT4rR9HGS3LcMecfut9x7zJyodWWP43YQ" |
no |
solana_known_validator4 | Solana known validator id | string |
"7XSY3MrYnK8vq693Rju17bbPkCN3Z7KvvfvJx4kdrsSY" |
no |
solana_known_validator5 | Solana known validator id | string |
"Ft5fbkqNa76vnsjYNwjDZUXoTWpP7VYm3mtsaQckQADN" |
no |
solana_known_validator6 | Solana known validator id | string |
"9QxCLckBiJc783jnMvXZubK4wH86Eqqvashtrwvcsgkv" |
no |
solana_ledger_mount_point | Ledger disk mount point | string |
"/mnt/ledger" |
no |
solana_log_location | The location of the Solana log | string |
"/home/sol/solana-rpc.log" |
no |
solana_network | The Solana network to use for the node | string |
"https://api.testnet.solana.com" |
no |
solana_no_voting | Enable no voting flag on the node | string |
"true" |
no |
solana_node_type | Solana node type | string |
"validator" |
no |
solana_private_rpc | Enable private rpc flag on the node | string |
"true" |
no |
solana_system_user | The Solana system user | string |
"sol" |
no |
stack | Specify a stack name that would be prefixed to each resource created with this module | string |
"tencent-" |
no |
subnet_cidrs | Specify one or more subnets to create within the VPC, either use this parameter or subnet_ids but not both | list(object({ |
[ |
no |
subnet_id | The subnet id for the instance | string |
"" |
no |
subnet_ids | Specify existing subnet ids without creating them using this module, if this is specified then subnet_cidrs must NOT be configured | list(string) |
[] |
no |
subnets_tags | Specify one or more tags for the subnets | map(string) |
{ |
no |
system_disk_size | The instance system disk size | number |
50 |
no |
system_disk_type | The instance system disk type | string |
"CLOUD_PREMIUM" |
no |
vpc_acl_tags | Specify one or more tags for the VPC ACLs | map(string) |
{ |
no |
vpc_acls | Specify one or more ACLs to attach to the subnets | list(object({ |
[ |
no |
vpc_cidr | The CIDR block that will be used by the VPC | string |
"172.16.0.0/16" |
no |
vpc_dns_servers | Specify one or more DNS servers to be used within the VPC | set(string) |
[] |
no |
vpc_id | Specify a VPC id if you want to deploy the RPC nodes within a existing VPC | string |
"" |
no |
vpc_is_multicast | Enable or disable VPC multicast | bool |
true |
no |
vpc_name | Tencent VPC name | string |
"tencent_rpc_node" |
no |
vpc_tags | Specify one or more tags for the VPC | map(string) |
{ |
no |
Name | Description |
---|---|
subnet_ids | n/a |
vpc_id | n/a |