github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/go/apps/mixnet/scripts/run_simple.sh (about)

     1  #!/bin/bash
     2  source ./define.sh
     3  
     4  # These should be run as root.
     5  $GOPATH/bin/tao host init -tao_domain $DOMAIN -hosting process -root -pass $PASSWORD
     6  sudo -E $GOPATH/bin/tao host start -tao_domain $DOMAIN -host linux_tao_host -pass $PASSWORD &
     7  sleep 5
     8  
     9  #
    10  # Starting the programs should be done as the unprivileged user it runs for
    11  # to provide isolation.
    12  # We run as root for conveniencea to avoid script clutter.
    13  #
    14  dir_addr="127.0.0.1:8000"
    15  start_port=8001
    16  echo "Starting directory..."
    17  $GOPATH/bin/tao run -tao_domain $DOMAIN $DOMAINROOT/mixnet_directory --addr $dir_addr --config $DOMAIN/tao.config &
    18  sleep 0.5
    19  
    20  directory_file=/tmp/directories
    21  echo $dir_addr > $directory_file
    22  
    23  $GOPATH/bin/tao run -tao_domain $DOMAIN $DOMAINROOT/mixnet_router --addr 127.0.0.1:$start_port --dirs $directory_file --config $DOMAIN/tao.config --batch 1 &
    24  sleep 0.3
    25  
    26  echo -e "127.0.0.1:8001" > $DOMAIN/mixnet_proxy/1.circuit
    27  
    28  # Start mixnet proxies; proxies will pick one of 4 paths
    29  proxy_start_port=9000
    30  echo "Starting proxies..."
    31  $GOPATH/bin/tao run -tao_domain $DOMAIN $DOMAINROOT/mixnet_proxy --addr :$proxy_start_port --dirs $directory_file --config $DOMAIN/tao.config --circuit $DOMAIN/mixnet_proxy/1.circuit --hops 1 &
    32  sleep 0.3
    33  
    34  # Start echo TLS server
    35  dest_port=10000
    36  echo "Starting echo TLS server..."
    37  $DOMAINROOT/mixnet_simpleserver --addr :$dest_port --cert $DOMAIN/mixnet_simpleserver/cert.pem --key $DOMAIN/mixnet_simpleserver/key.pem&
    38  sleep 0.3
    39  
    40  # Start all the clients
    41  echo "Starting simpleclients..."
    42  $DOMAINROOT/mixnet_simpleclient --proxy_addr 127.0.0.1:$proxy_start_port --dest_addr 127.0.0.1:$dest_port --id 0
    43  sleep 0.3
    44  
    45  sudo pkill -f "$DOMAIN"