solana/net
Dan Albert 28b115497f
Update setup-dc-node-1.sh
2020-02-13 14:30:41 -07:00
..
datacenter-node-install Update setup-dc-node-1.sh 2020-02-13 14:30:41 -07:00
remote The getConfirmedBlock RPC API is now disabled by default 2020-02-11 22:24:08 -07:00
scripts Remove asteroids and pacman from QA/dev testnet availability (#8050) 2020-01-31 10:26:25 -08:00
.gitignore Clean up net logs (#6813) 2019-11-08 10:25:17 -05:00
README.md Add partition testing documentation (#7739) 2020-01-10 15:32:43 -08:00
azure.sh Add support for Azure instances in testnet creation (#3905) 2019-04-23 16:41:45 -06:00
colo.sh Add script for managing colo resourse ala gce.sh (#5854) 2019-09-19 14:08:22 -07:00
common.sh Fix ssh connection error due to too many authentication failures (#7229) 2019-12-03 15:53:12 -08:00
ec2.sh
gce.sh Don't exit early if add. validators not found during gce.sh config 2020-01-31 08:34:10 -07:00
init-metrics.sh Add ability to hard fork at any slot (#7801) 2020-01-24 17:27:04 -08:00
net.sh Implement automated partition testing (#7222) 2020-01-22 13:46:50 -05:00
scp.sh
ssh.sh Rename remaining uses of fullnode to validator (#6476) 2019-10-21 20:21:21 -07:00

README.md

Network Management

This directory contains scripts useful for working with a test network. It's intended to be both dev and CD friendly.

User Account Prerequisites

GCP and AWS are supported.

GCP

First authenticate with

$ gcloud auth login

AWS

Obtain your credentials from the AWS IAM Console and configure the AWS CLI with

$ aws configure

More information on AWS CLI configuration can be found here

Metrics configuration (Optional)

Ensure that $(whoami) is the name of an InfluxDB user account with enough access to create a new InfluxDB database. Ask mvines@ for help if needed.

Quick Start

NOTE: This example uses GCE. If you are using AWS EC2, replace ./gce.sh with ./ec2.sh in the commands.

$ cd net/
$ ./gce.sh create -n 5 -c 1     #<-- Create a GCE testnet with 5 additional nodes (beyond the bootstrap node) and 1 client (billing starts here)
$ ./init-metrics.sh $(whoami)   #<-- Configure a metrics database for the testnet
$ ./net.sh start                #<-- Deploy the network from the local workspace and start all clients with bench-tps
$ ./ssh.sh                      #<-- Details on how to ssh into any testnet node to access logs/etc
$ ./gce.sh delete               #<-- Dispose of the network (billing stops here)

Tips

Running the network over public IP addresses

By default private IP addresses are used with all instances in the same availability zone to avoid GCE network engress charges. However to run the network over public IP addresses:

$ ./gce.sh create -P ...

or

$ ./ec2.sh create -P ...

Deploying a tarball-based network

To deploy the latest pre-built edge channel tarball (ie, latest from the master branch), once the testnet has been created run:

$ ./net.sh start -t edge

Enabling CUDA

First ensure the network instances are created with GPU enabled:

$ ./gce.sh create -g ...

or

$ ./ec2.sh create -g ...

If deploying a tarball-based network nothing further is required, as GPU presence is detected at runtime and the CUDA build is auto selected.

How to interact with a CD testnet deployed by ci/testnet-deploy.sh

AWS-Specific Extra Setup: Follow the steps in scripts/solana-user-authorized_keys.sh, then redeploy the testnet before continuing in this section.

Taking master-testnet-solana-com as an example, configure your workspace for the testnet using:

$ ./gce.sh config -p master-testnet-solana-com

or

$ ./ec2.sh config -p master-testnet-solana-com

Then run the following for details on how to ssh into any testnet node to access logs or otherwise inspect the node

$ ./ssh.sh

Partition testing

To induce the partition net.sh netem --config-file <config file path> To remove partition net.sh netem --config-file <config file path> --netem-cmd cleanup The partitioning is also removed if you do net.sh stop or restart.

An example config that produces 3 almost equal partitions:

{
      "partitions":[
         34,
         33,
         33
      ],
      "interconnects":[
         {
            "a":0,
            "b":1,
            "config":"loss 15% delay 25ms"
         },
         {
            "a":1,
            "b":0,
            "config":"loss 15% delay 25ms"
         },
         {
            "a":0,
            "b":2,
            "config":"loss 10% delay 15ms"
         },
         {
            "a":2,
            "b":0,
            "config":"loss 10% delay 15ms"
         },
         {
            "a":2,
            "b":1,
            "config":"loss 5% delay 5ms"
         },
         {
            "a":1,
            "b":2,
            "config":"loss 5% delay 5ms"
         }
      ]
}