Skip to content

insight-nervos/terraform-btcpool-alibaba-node

Repository files navigation

terraform-btcpool-alibaba-node

open-issues open-pr

Features

This module sets up a Nervos mining pool on Alibaba Cloud with terraform. It uses an Ansible role to configure a node with docker and run a btcpool docker-compose setup.

For AWS, check github organization.

Dependencies

Usage

Install terraform v0.13+, get Alibaba credentials, clone this repository and cd into it.

# Create ssh keys and take note of path 
ssh-keygen -b 4096 
# Modify the terraform.tfvars and remove comments ('//')
nano terraform.tfvars 
terraform init 
terraform apply 

Example module

provider "alicloud" {
  region = var.alicloud_region
}

module "defaults" {
  source = "github.com/insight-nervos/terraform-btcpool-alibaba-node"
  vpc_name = var.vpc_name
  num_azs = 2
  root_volume_size  = "50"
  create_eip        = true
  public_key        = file(var.public_key_path)
}

For more advanced configurations,

Examples

Known Issues

No issue is creating limit on this module.

Requirements

No requirements.

Providers

Name Version
alicloud n/a

Inputs

Name Description Type Default Required
all_enabled Bool to enable all the security groups bool false no
assign_public_ip Bool to enable assignment of public IP address. Overridden by create_eip. bool true no
azs List of availability zones list(string) [] no
bastion_enabled Boolean to enable a bastion host. All ssh traffic restricted to bastion bool false no
bastion_ip Optional IP for bastion - blank for no bastion string "" no
bastion_sg_name Name for the bastion security group string "bastion-sg" no
bastion_user Optional bastion user - blank for no bastion string "" no
btcpool_env_file_path Path to .env file for deployment string "" no
cidr The cidr range for network string "10.0.0.0/16" no
corporate_ip The corporate IP you want to restrict ssh traffic to string "" no
create Boolean to make module or not bool true no
create_dns Bool to create ssl cert and nginx proxy bool true no
create_eip Bool to create and attach EIP to instance bool true no
create_private_subnets Bool to enable creation of private subnets bool false no
domain_name The domain - example.com. Blank for no ssl / nginx string "" no
enable_btcpool_ssl Bool to enable SSL bool false no
hostname The hostname - ie hostname.example.com - blank for example.com string "" no
instance_cpu_cores Instance CPU cores string "2" no
instance_family Instance family string "ecs.g6" no
instance_memory Instance memory (in GB) string "8" no
key_name The key pair to import - leave blank to generate new keypair from pub/priv ssh key path string "" no
name The name for the label string "btcpool" no
node_name Name of the node string "" no
node_sg_name Name for the node security group string "node-sg" no
num_azs The number of AZs to deploy into number 1 no
playbook_vars Additional playbook vars map(string) {} no
private_key_path Path to private key string "" no
public_key_path The path to the public ssh key string "" no
public_ports List of publicly open ports list(number)
[
1800,
8114,
8115,
9021,
9090,
3000
]
no
root_volume_size Root volume size string "20" no
stack_type The type of stack to deploy - string "prometheus" no
suffix Suffix to attach to name string "" no
tags Map of tags map(string) {} no

Outputs

Name Description
bastion_security_group_id The ID of the Bastion security group
instance_id The Alicloud ID of the instance
key_name The name of the SSH key
node_security_group_id The ID of the instance security group
private_vswitch_ids The IDs of the Vswitches for the private subnets
public_ip The public IP of the instance
public_vswitch_ids The IDs of the Vswitches for the public subnets
vpc_id The ID of the VPC where the instance is deployed

Testing

This module has been packaged with terratest tests

To run them:

  1. Install Go
  2. Run make test-init from the root of this repo
  3. Run make test again from root

Authors

Module managed by Richard Mah

Credits

License

Apache 2 Licensed. See LICENSE for full details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published