@ -60,27 +60,23 @@ You can run the script `./scripts/go_executable_build.sh` to build all the exec
### Build individual executables
Initialize BLS
```
source scripts/setup_bls_build_flags.sh
```
Harmony server / main node:
```
go build -o bin/harmony cmd/harmony/main.go
```bash
./scripts/go_executable_build.sh harmony
```
Wallet:
```
go build -o bin/wallet cmd/client/wallet/main.go
```bash
./scripts/go_executable_build.sh wallet
```
Tx Generator:
```
go build -o bin/txgen cmd/client/txgen/main.go
```bash
./scripts/go_executable_build.sh txgen
```
## Usage
@ -89,12 +85,24 @@ You may build the src/harmony.go locally and run local test.
### Running local test
The deploy.sh script creates a local environment of Harmony blockchain devnet based on the configuration file.
The debug.sh script calls test/deploy.sh script to create a local environment of Harmony blockchain devnet based on the configuration file.
The configuration file configures number of nodes and their IP/Port.
The script starts one local beacon chain node, the blockchain nodes, and run a transactional generator program which generates and sends simulated transactions to the local blockchain.
The script starts 2 shards and 7 nodes in each shard.
UpdateBlocksfunc([]*types.Block)// Closure function used to sync new block with the leader. Once the leader finishes the consensus on a new block, it will send it to the clients. Clients use this method to update their blockchain
utils.GetLogInstance().Warn("[SYNC] GetConsensusHashes: receive more blockHahses than request!","requestSize",size,"respondSize",len(response.Payload))
utils.Logger().Warn().
Uint32("requestSize",size).
Int("respondSize",len(response.Payload)).
Msg("[SYNC] GetConsensusHashes: receive more blockHahses than request!")
utils.GetLogInstance().Info("[SYNC] new block added to blockchain","blockHeight",bc.CurrentBlock().NumberU64(),"blockHex",bc.CurrentBlock().Hash().Hex())
// isExplorer indicates this node is a node to serve explorer
isExplorer=flag.Bool("is_explorer",false,"true means this node is a node to serve explorer")
// networkType indicates the type of the network
networkType=flag.String("network_type","mainnet","type of the network: mainnet, testnet, devnet...")
networkType=flag.String("network_type","mainnet","type of the network: mainnet, testnet, devnet, localnet")
// blockPeriod indicates the how long the leader waits to propose a new block.
blockPeriod=flag.Int("block_period",8,"how long in second the leader waits to propose a new block.")
// isNewNode indicates this node is a new node
@ -100,21 +100,17 @@ var (
blsPass=flag.String("blspass","","The file containing passphrase to decrypt the encrypted bls file.")
blsPassphrasestring
// Sharding configuration parameters for devnet
devnetNumShards=flag.Uint("dn_num_shards",2,"number of shards for -network_type=devnet (default: 2)")
devnetShardSize=flag.Int("dn_shard_size",10,"number of nodes per shard for -network_type=devnet (default 10)")
devnetHarmonySize=flag.Int("dn_hmy_size",-1,"number of Harmony-operated nodes per shard for -network_type=devnet; negative (default) means equal to -dn_shard_size")
consensus.getLogger().Debug("[onViewChange] Already Received M3(ViewID) message from the validator","senderKey.SerializeToHexStr()",senderKey.SerializeToHexStr())
consensus.getLogger().Debug("[onViewChange] New Leader Start Consensus Timer and Stop View Change Timer","viewChangingID",consensus.mode.ViewID())
consensus.getLogger().Debug("[onViewChange] I am the New Leader","myKey",consensus.PubKey.SerializeToHexStr(),"viewID",consensus.viewID,"block",consensus.blockNum)
consensus.getLogger().Debug().
Uint64("viewChangingID",consensus.mode.ViewID()).
Msg("[onViewChange] New Leader Start Consensus Timer and Stop View Change Timer")
consensus.getLogger().Warn("[onNewView] Unable to Verify Aggregated Signature of M3 (ViewID) payload","m3Sig",m3Sig.SerializeToHexStr(),"m3Mask",m3Mask.Bitmap,"MsgViewID",recvMsg.ViewID)
consensus.getLogger().Warn().
Str("m3Sig",m3Sig.SerializeToHexStr()).
Bytes("m3Mask",m3Mask.Bitmap).
Uint64("MsgViewID",recvMsg.ViewID).
Msg("[onNewView] Unable to Verify Aggregated Signature of M3 (ViewID) payload")
return
}
m2Mask:=recvMsg.M2Bitmap
ifrecvMsg.M2AggSig!=nil{
consensus.getLogger().Debug("[onNewView] M2AggSig (NIL) is Not Empty")
consensus.getLogger().Debug().Msg("[onNewView] M2AggSig (NIL) is Not Empty")
m2Sig:=recvMsg.M2AggSig
if!m2Sig.VerifyHash(m2Mask.AggregatePublic,NIL){
consensus.getLogger().Warn("[onNewView] Unable to Verify Aggregated Signature of M2 (NIL) payload")
consensus.getLogger().Warn().Msg("[onNewView] Unable to Verify Aggregated Signature of M2 (NIL) payload")
utils.GetLogger().Info("Loaded most recent local header","number",currentHeader.Number,"hash",currentHeader.Hash(),"td",headerTd,"age",common.PrettyAge(time.Unix(currentHeader.Time.Int64(),0)))
utils.GetLogger().Info("Loaded most recent local full block","number",currentBlock.Number(),"hash",currentBlock.Hash(),"td",blockTd,"age",common.PrettyAge(time.Unix(currentBlock.Time().Int64(),0)))
utils.GetLogger().Info("Loaded most recent local fast block","number",currentFastBlock.Number(),"hash",currentFastBlock.Hash(),"td",fastTd,"age",common.PrettyAge(time.Unix(currentFastBlock.Time().Int64(),0)))
utils.GetLogger().Info("State in memory for too long, committing","time",bc.gcproc,"allowance",bc.cacheConfig.TrieTimeLimit,"optimum",float64(chosen-lastWrite)/triesInMemory)