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 maintaining 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.
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
You can use the generate
command to generate configs for your network:
dash-network generate <network_name> <masternodes_amd_count> <masternodes_arm_count> <hp_masternodes_amd_count> <hp_masternodes_arm_count>
Terraform configuration is defined in the *.tfvars
files.
See variables.tf for all available options.
Ansible configuration is stored in the *.yml
file. The
group_vars/all
file contains the majority of playbook options.
The rest are defined in ansible roles.
Configure your credentials in the .env
file.
Please don't forget to include the following in your .gitignore
:
.env
*.inventory
*.ovpn
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 target either infrastructure or software provisioning workflows.
To destroy an available Dash Network, use the destroy
command:
dash-network destroy -t=<target> <network_name>
You can use the -t
flag to choose which logical network components you want to destroy. It takes one of three values:
Destroying only the network with -t=network
allows you to redeploy the network in almost the same state by passing the -p
option to the deploy
command to skip infrastructure provisioning.
Destroying only the L2 platform components with -t=platform
means you must comment out everything except roles which target masternodes and seed nodes in the deploy.yml
playbook, and run the deployment again with the -p
option.
dash-network list <network_name>
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 a comma delimiter.
There are two commands that can be useful for debugging:
dash-network logs <network_name> <host> [docker logs options] <service_name>
dash-network logs devnet-example node-1 --since 3h dashd
dash-network dash-cli <network_name> <hostname> <rpc_command>
In order to deploy platform services, use the ansible variable:
```yaml
evo_services: true
```
You can use the OpenVPN config generated during deployment (<network_name>.ovpn
) to connect to private services.
Clone git repository:
git clone https://github.com/dashpay/dash-network-deploy.git
Install Ansible (v2.11.4+) and Terraform (v1.4.4+) per instructions provided on the official websites:
Ensure Python dependencies are installed locally
pip install -U netaddr jmespath ansible-lint boto3 botocore
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
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.
aws s3 mb s3://bucket-name-here
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
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.