Dash Network Deployment Tool
Introduction
This tool assists in deploying and managing Dash networks.
There are two regular available networks: testnet
and mainnet
.
After deployment your DashCore instances will join those networks.
regtest
and devnet-*
networks are for testing purposes.
Devnets are like regular Dash networks (mainnet
and testnet
)
but easier to bootstrap and with unique names. This supports having multiple in
parallel.
This is work in progress and in its initial state only meant to be used by Dash Core developers to assist in Dash Platform development.
Installation
-
Download tool:
Using
wget
:wget -P /usr/local/bin https://raw.github.com/dashpay/dash-network-deploy/master/bin/dash-network && \ chmod +x /usr/local/bin/dash-network
Using
curl
:curl -fsSL -o /usr/local/bin/dash-network https://raw.github.com/dashpay/dash-network-deploy/master/bin/dash-network && \ chmod +x /usr/local/bin/dash-network
Configuration
Networks definition
You can use generate
command in order to create configs for your network:
dash-network generate <network_name> <masternode_count>
Terraform configuration is defined in the *.tfvars
files.
See variables.tf for all available options.
Ansible configuration are in the *.yaml
file.
group_vars/all
file contains the majority of playbook options.
The rest are defined in ansible roles.
Configure your credentials in the .env
file.
Using git
Please don't forget to include the following in your .gitignore
:
.env
*.inventory
*.ovpn
Deployment
To deploy a Dash Network use the deploy
command with a particular network name:
dash-network deploy <network_name>
You may pass the --only-infrastructure
or --only-provisioning
option to avoid to do a particular type of work.
To destroy an available Dash Network use destroy
command:
dash-network destroy <network_name>
You may pass the --keep-infrastructure
option to remove only the software and configuration while keeping the infrastructure.
List network services
dash-network list <network_name>
Testing
To test the network, run the test
command with with particular network name:
dash-network test <network_name>
You may pass the --type
option to run only particular tests (smoke
, e2e
).
It is possible to specify several types using comma delimiter.
Debugging
There are two commands that can be useful for debugging:
- Show service logs:
dash-network logs <network_name> <host> [docker logs options] <service_name>
- See Docker log options for details
- Example:
dash-network logs devnet-example node-1 --since 3h dashd
- Execute Dash Core RPC command:
dash-network dash-cli <network_name> <hostname> <rpc_command>
Deploy Dash Platform
In order to deploy platform services use ansible variable:
```yaml
evo_services: true
```
Connect to private Dash Network services
You can use the OpenVPN config generated during deployment (<network_name>.ovpn
) to connect to private services.
Manual installation
-
Clone git repository:
git clone https://github.com/dashpay/dash-network-deploy.git
-
Install Ansible (v2.11.4+) and Terraform (v1.0.5+) per instructions provided on the official websites:
-
Ensure Python netaddr and jmespath package is installed locally
pip install -U netaddr jmespath
- Note: You may need to run the above command with "pip2" instead of "pip" if your default Python installation is version 3 (e.g. OSX + Homebrew).
-
Install pre-requisite Ansible roles
ansible-galaxy install -r ansible/requirements.yml
-
Install AWS Command Line Interface
-
Install Node.JS and dependencies:
npm install
-
Install OpenVPN:
On Linux:
apt-get install openvpn
On Mac:
brew install openvpn
New AWS account setup
If you are running this tool for the first time in a new AWS account, some initial setup needs to be done one time:
note: Please ensure you have the correct REGION and PROFILE setup in your AWS CLI configuration (aws configure
) or use the --region and --profile flags with the AWS commands below.
- Create Terraform state S3 bucket manually:
aws s3 mb s3://bucket-name-here
- Create Terraform state dynamodb lock table manually
aws dynamodb create-table \
--attribute-definitions AttributeName=LockID,AttributeType=S \
--table-name tf-lock-table-test \
--key-schema AttributeName=LockID,KeyType=HASH \
--billing-mode PROVISIONED \
--provisioned-throughput ReadCapacityUnits=2,WriteCapacityUnits=2 \
--table-class STANDARD
- Route53 domain creation / delegation
aws route53 create-hosted-zone --name networks.domain.tld --caller-reference 1234567
Please note the values of these, as they will be needed in the network config files.