From 5185e0aff1716e0cf8abba12846ed90ec2835784 Mon Sep 17 00:00:00 2001 From: alok Date: Mon, 18 Jun 2018 23:47:17 -0700 Subject: [PATCH] typos/bad code removed --- aws-code/transaction_generator.go | 2 +- aws-scripts/preprocess_peerlist.py | 5 +++-- deploy_one_instance.sh | 6 ++---- global_nodes.txt | 3 +++ 4 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 global_nodes.txt diff --git a/aws-code/transaction_generator.go b/aws-code/transaction_generator.go index 748c29989..172d3fb56 100644 --- a/aws-code/transaction_generator.go +++ b/aws-code/transaction_generator.go @@ -66,9 +66,9 @@ func main() { configFile := flag.String("config_file", "global_nodes.txt", "file containing all ip addresses and config") flag.Parse() config := readConfigFile(*configFile) + totalTime := 60.0 time.Sleep(totalTime) //Sleep Time to let all instances come up start := time.Now() - totalTime := 60.0 txs := make([]blockchain.Transaction, 10) leaders := getLeaders(&config) for true { diff --git a/aws-scripts/preprocess_peerlist.py b/aws-scripts/preprocess_peerlist.py index 3c2db0d3f..9dd8ed70b 100644 --- a/aws-scripts/preprocess_peerlist.py +++ b/aws-scripts/preprocess_peerlist.py @@ -3,11 +3,12 @@ amazon_ipv4_url = "http://169.254.169.254/latest/meta-data/public-ipv4" if __name__ == "__main__": current_ip = requests.get(amazon_ipv4_url).text f = open("global_nodes.txt",r) + peerList = [] for myline in f: mylist = myline.split(" ") ip = mylist[0] node = mylist[2] - if ip != current_ip or node != "transaction": + if node != "transaction": peerList.append(myline) else: h = open("isTransaction.txt",w) @@ -15,7 +16,7 @@ if __name__ == "__main__": h.close() f.close() g = open("global_peerlist.txt",w) - for myline peerList: + for myline in peerList: g.write(myline) g.close() \ No newline at end of file diff --git a/deploy_one_instance.sh b/deploy_one_instance.sh index d05205bea..fd5131045 100755 --- a/deploy_one_instance.sh +++ b/deploy_one_instance.sh @@ -15,8 +15,6 @@ FILE='isTransaction.txt' config=$1 if [ -f $FILE ]; then go run ./aws-code/transaction_generator.go -config_file $config -else: +else go run ./benchmark_main.go -config_file $config& - - - +fi \ No newline at end of file diff --git a/global_nodes.txt b/global_nodes.txt new file mode 100644 index 000000000..9826ae250 --- /dev/null +++ b/global_nodes.txt @@ -0,0 +1,3 @@ +35.160.197.62 9000 validator 0 +54.68.213.133 9000 leader 0 +34.216.209.90 9000 transaction 0 \ No newline at end of file