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.
- Terraform v0.12.0+
- Ansible - v2.9+ -
pip install ansible
- Python
- Submodules (nothing to install)
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
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
}
Name | Version |
---|---|
aws | n/a |
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) |
[ |
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) |
[ |
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 |
Name | Description |
---|---|
instance_id | n/a |
instance_type | n/a |
key_name | n/a |
public_ip | n/a |
This module has been packaged with terratest tests
To run them:
- Install Go
- Run
make test-init
from the root of this repo - Run
make test
again from root
Module managed by insight-infrastructure
Apache 2 Licensed. See LICENSE for full details.