Skip to content

insight-nervos/terraform-btcpool-aws-node

Repository files navigation

terraform-btcpool-aws-node

open-issues open-pr

Features

This module sets up a stratum v1 btcpool mining pool on AWS for the Nervos Blockchain. It uses an Ansible role to configure a node with docker and run a btcpool docker-compose setup.

For Alibaba Cloud, check github organization.

Dependencies

Usage

Install terraform v0.13+, get AWS credentials, clone this directory and cd into it.

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

Example module

variable "private_key_path" {}
variable "public_key_path" {}

module "defaults" {
  source = "github.com/insight-nervos/terraform-btcpool-aws-node"
  private_key_path = var.private_key_path
  public_key_path  = var.public_key_path
}

Examples

Providers

Name Version
aws n/a

Inputs

Name Description Type Default Required
additional_policy_arns List of additional policy arns list(string) [] no
additional_security_group_ids List of security groups list(string) [] no
ami AMI to use as base image - blank for ubuntu string "" no
bastion_ip Optional IP for bastion - blank for no bastion string "" no
bastion_user Optional bastion user - blank for no bastion string "" no
btcpool_env_file_path Path to .env file for deployment string "" no
create Boolean to create resources or not bool true no
create_dns Bool to create ssl cert and nginx proxy bool true no
create_iam Bool to create iam role bool false no
create_sg Bool for create security group bool true 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_type Instance type string "t3.medium" no
key_name The key pair to import - leave blank to generate new keypair from pub/priv ssh key path string "" no
monitoring Boolean for cloudwatch bool false no
name The name for the label string "btcpool" no
playbook_vars Additional playbook vars map(string) {} no
private_key_path The path to the private ssh key string n/a yes
private_port_cidrs List of CIDR blocks for private ports. This can be for private networks or stable IPs. list(string)
[
"172.31.0.0/16"
]
no
private_ports List of private ports list(number) [] no
public_key_path The path to the public ssh key string n/a yes
public_ports List of publicly open ports list(number)
[
22,
1800,
8114,
8115,
9021,
9090,
3000
]
no
root_iops n/a string n/a yes
root_volume_size Root volume size number 40 no
root_volume_type n/a string "gp2" no
stack_type The type of stack to deploy - string "prometheus" no
subnet_id The id of the subnet string "" no
suffix Suffix to attach to name string "" no
tags Map of tags map(string) {} no
vpc_id Custom vpc id - leave blank for deault string "" no

Outputs

Name Description
instance_id n/a
instance_type n/a
key_name n/a
public_ip n/a

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 insight-infrastructure

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