From 3232239c22eab618e405b63923c854557588bacb Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Sun, 9 Sep 2018 05:29:50 +0000 Subject: [PATCH 1/2] enable WHOAMI env as folder name Signed-off-by: Leo Chen --- go_executable_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go_executable_build.sh b/go_executable_build.sh index 44efb6146..ac425020a 100755 --- a/go_executable_build.sh +++ b/go_executable_build.sh @@ -10,7 +10,7 @@ BINDIR=bin BUCKET=unique-bucket-bin GOOS=linux GOARCH=amd64 -FOLDER=/$(whoami) +FOLDER=/${WHOAMI:-$USER} function usage { From c9a54e1784108ad62a515c2e48fc651a804b2aeb Mon Sep 17 00:00:00 2001 From: Rongjian Lan Date: Sat, 8 Sep 2018 22:38:08 -0700 Subject: [PATCH 2/2] Add more logs for aws debugging --- client/client.go | 1 + client/txgen/main.go | 3 +-- consensus/consensus_validator.go | 3 +++ node/node_handler.go | 15 +++++---------- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/client/client.go b/client/client.go index 07c60083b..7ec150183 100644 --- a/client/client.go +++ b/client/client.go @@ -61,6 +61,7 @@ func (client *Client) handleProofOfLockMessage(proofs *[]blockchain.CrossShardTx //fmt.Printf("PENDING CLIENT TX - %d\n", len(client.PendingCrossTxs)) // Loop through the newly received list of proofs client.PendingCrossTxsMutex.Lock() + log.Info("CLIENT PENDING TX", "num", len(client.PendingCrossTxs)) for _, proof := range *proofs { // Find the corresponding pending cross tx txAndProofs, ok := client.PendingCrossTxs[proof.TxID] diff --git a/client/txgen/main.go b/client/txgen/main.go index e77567a91..becc2aef5 100644 --- a/client/txgen/main.go +++ b/client/txgen/main.go @@ -128,8 +128,7 @@ UTXOLOOP: } } } - //fmt.Printf("UTXO CLIENT - %d\n", shardId) - //fmt.Println(dataNodes[shardId].UtxoPool.CountNumOfUtxos()) + log.Info("UTXO CLIENT", "numUtxo", dataNodes[shardId].UtxoPool.CountNumOfUtxos(), "shardId", shardId) utxoPoolMutex.Unlock() log.Debug("[Generator] generated transations", "single-shard", len(txInfo.txs), "cross-shard", len(txInfo.crossTxs)) return txInfo.txs, txInfo.crossTxs diff --git a/consensus/consensus_validator.go b/consensus/consensus_validator.go index 8b2e2ee58..57bd4b399 100644 --- a/consensus/consensus_validator.go +++ b/consensus/consensus_validator.go @@ -47,6 +47,7 @@ func (consensus *Consensus) ProcessMessageValidator(message []byte, blockSyncing // Processes the announce message sent from the leader func (consensus *Consensus) processAnnounceMessage(payload []byte) { + consensus.Log.Info("Received Announce Message") //#### Read payload data offset := 0 // 4 byte consensus id @@ -71,6 +72,8 @@ func (consensus *Consensus) processAnnounceMessage(payload []byte) { offset += 64 //#### END: Read payload data + consensus.Log.Info("Received Announce Message", "LeaderId", leaderId) + copy(consensus.blockHash[:], blockHash[:]) // Verify block data diff --git a/node/node_handler.go b/node/node_handler.go index d26428631..5aa4549fc 100644 --- a/node/node_handler.go +++ b/node/node_handler.go @@ -367,14 +367,9 @@ func (node *Node) UpdateUtxoAndState(newBlock *blockchain.Block) { } // Clear transaction-in-Consensus list node.transactionInConsensus = []*blockchain.Transaction{} - //if node.Consensus.IsLeader { - // fmt.Printf("TX in New BLOCK - %d %s\n", node.UtxoPool.ShardID, newBlock.IsStateBlock()) - // //fmt.Println(newBlock.Transactions) - // fmt.Printf("LEADER CURRENT UTXO - %d\n", node.UtxoPool.ShardID) - // fmt.Println(node.UtxoPool.CountNumOfUtxos()) - // fmt.Println(node.UtxoPool) - // fmt.Printf("LEADER LOCKED UTXO - %d\n", node.UtxoPool.ShardID) - // fmt.Println(node.UtxoPool.CountNumOfLockedUtxos()) - // fmt.Println(node.UtxoPool.StringOfLockedUtxos()) - //} + if node.Consensus.IsLeader { + node.log.Info("TX in New BLOCK", "num", len(newBlock.Transactions), "ShardId", node.UtxoPool.ShardID, "IsStateBlock", newBlock.IsStateBlock()) + node.log.Info("LEADER CURRENT UTXO", "num", node.UtxoPool.CountNumOfUtxos(), "ShardId", node.UtxoPool.ShardID) + node.log.Info("LEADER LOCKED UTXO", "num", node.UtxoPool.CountNumOfLockedUtxos(), "ShardId", node.UtxoPool.ShardID) + } }