merging conflicts

pull/6/head
alok 7 years ago
commit d29b5899f3
  1. 19
      aws-code/transaction_generator.go
  2. 24
      aws-scripts/preprocess_peerlist.py
  3. 2
      aws-scripts/run_instances.sh
  4. 20
      deploy_one_instance.sh
  5. 3
      global_nodes.txt

@ -110,6 +110,7 @@ func readConfigFile(configFile string) [][]string {
} }
func main() { func main() {
<<<<<<< HEAD
// Setup a stdout logger // Setup a stdout logger
h := log.CallerFileHandler(log.StdoutHandler) h := log.CallerFileHandler(log.StdoutHandler)
log.Root().SetHandler(h) log.Root().SetHandler(h)
@ -130,23 +131,25 @@ func main() {
start := time.Now() start := time.Now()
totalTime := 60.0 totalTime := 60.0
time.Sleep(3 * time.Second) // wait for nodes to be ready time.Sleep(3 * time.Second) // wait for nodes to be ready
=======
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()
txs := make([]blockchain.Transaction, 10)
leaders := getLeaders(&config)
>>>>>>> aadf3f9b34b9b4b84841dce554814f05f120aed1
for true { for true {
t := time.Now() t := time.Now()
if t.Sub(start).Seconds() >= totalTime { if t.Sub(start).Seconds() >= totalTime {
fmt.Println(int(t.Sub(start)), start, totalTime) fmt.Println(int(t.Sub(start)), start, totalTime)
break break
} }
<<<<<<< HEAD
for i := range txs {
txs[i] = newRandTransaction()
}
msg := node.ConstructTransactionListMessage(txs)
log.Printf("[Generator] Sending txs to %d leader[s]\n", len(leaders))
=======
txsToSend := getNewFakeTransactions(&dataNode, *numTxsPerBatch) txsToSend := getNewFakeTransactions(&dataNode, *numTxsPerBatch)
msg := node.ConstructTransactionListMessage(txsToSend) msg := node.ConstructTransactionListMessage(txsToSend)
log.Debug("[Generator] Sending txs...", "numTxs", len(txsToSend)) log.Debug("[Generator] Sending txs...", "numTxs", len(txsToSend))
>>>>>>> 31f111ed5d49c01a9c3a20e92e053016c05ebafc
p2p.BroadcastMessage(leaders, msg) p2p.BroadcastMessage(leaders, msg)
// Update local utxo pool to mirror the utxo pool of a real node // Update local utxo pool to mirror the utxo pool of a real node

@ -1,19 +1,21 @@
from collections import namedtuple
import requests import requests
amazon_ipv4_url = "http://169.254.169.254/latest/meta-data/public-ipv4" amazon_ipv4_url = "http://169.254.169.254/latest/meta-data/public-ipv4"
if __name__ == "__main__": if __name__ == "__main__":
current_ip = requests.get(amazon_ipv4_url).text current_ip = requests.get(amazon_ipv4_url).text
f = open("all_peerlist.txt",r) f = open("global_nodes.txt","r")
peerList = []
for myline in f: for myline in f:
mylist = myline.strip().split(" ") mylist = myline.split(" ")
ip = mylist[0] ip = mylist[0]
if ip != current_ip: node = mylist[2]
if node != "transaction":
peerList.append(myline) peerList.append(myline)
else:
h = open("isTransaction.txt","w")
h.write("I am just a transaction generator node")
h.close()
f.close() f.close()
g = open("global_peerlist.txt") g = open("global_peerlist.txt","w")
for myline peerList: for myline in peerList:
g.write(myline + "\n") g.write(myline)
g.close() g.close()

@ -1,3 +1,3 @@
#!/bin/bash -x #!/bin/bash -x
cd /home/ec2-user/projects/src/harmony-benchmark cd /home/ec2-user/projects/src/harmony-benchmark
./deploy_linux.sh local_config2.txt ./deploy_one_instance.sh global_peerlist.txt

@ -0,0 +1,20 @@
#!/bin/bash -x
##The commented suffix is for linux
##Reference: https://github.com/Zilliqa/Zilliqa/blob/master/tests/Node/test_node_simple.sh
sudo sysctl net.core.somaxconn=1024
sudo sysctl net.core.netdev_max_backlog=65536;
sudo sysctl net.ipv4.tcp_tw_reuse=1;
sudo sysctl -w net.ipv4.tcp_rmem='65536 873800 1534217728';
sudo sysctl -w net.ipv4.tcp_wmem='65536 873800 1534217728';
sudo sysctl -w net.ipv4.tcp_mem='65536 873800 1534217728';
./kill_node.sh
source ~/.bash_profile
python aws-scripts/preprocess_peerlist.py
FILE='isTransaction.txt'
config=$1
if [ -f $FILE ]; then
go run ./aws-code/transaction_generator.go -config_file $config
else
go run ./benchmark_main.go -config_file $config&
fi

@ -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
Loading…
Cancel
Save