Commit 9fee0495 authored by duanjinfei's avatar duanjinfei

change continued send tx

parent 1c343e93
...@@ -22,7 +22,7 @@ func init() { ...@@ -22,7 +22,7 @@ func init() {
startCmd.PersistentFlags().StringVar(&cpuProfile, "cpuProfile", "cpuProfile.prof", "Statistics cpu profile") startCmd.PersistentFlags().StringVar(&cpuProfile, "cpuProfile", "cpuProfile.prof", "Statistics cpu profile")
startCmd.PersistentFlags().IntVar(&startCount, "startCount", 0, "read excel start count") startCmd.PersistentFlags().IntVar(&startCount, "startCount", 0, "read excel start count")
startCmd.PersistentFlags().IntVar(&endCount, "endCount", 100, "read excel end count") startCmd.PersistentFlags().IntVar(&endCount, "endCount", 100, "read excel end count")
startCmd.PersistentFlags().BoolVar(&broadcastTxArr, "broadcastTxArr", true, "test grpc interface -> broadcastTxArr") startCmd.PersistentFlags().BoolVar(&broadcastTxArr, "broadcastTxArr", false, "test grpc interface -> broadcastTxArr")
startCmd.PersistentFlags().IntVar(&txCount, "txCount", 1000, "send tran count") startCmd.PersistentFlags().IntVar(&txCount, "txCount", 1000, "send tran count")
startCmd.PersistentFlags().IntVar(&goRoutineCount, "goRoutineCount", 10, "send tran goRoutine count") startCmd.PersistentFlags().IntVar(&goRoutineCount, "goRoutineCount", 10, "send tran goRoutine count")
startCmd.PersistentFlags().IntVar(&batchCount, "batchCount", 100, "batch send tran count") startCmd.PersistentFlags().IntVar(&batchCount, "batchCount", 100, "batch send tran count")
......
...@@ -21,7 +21,7 @@ func init() { ...@@ -21,7 +21,7 @@ func init() {
return return
} }
cfg.StorageAccFileName += ".xlsx" cfg.StorageAccFileName += ".xlsx"
tranArrChan = make(chan []*types.Transaction, 1000000000) tranArrChan = make(chan []*types.Transaction, 10000)
} }
func startTest() { func startTest() {
...@@ -47,9 +47,12 @@ func startTest() { ...@@ -47,9 +47,12 @@ func startTest() {
} }
}() }()
for { for {
log.Info("----------------------------------start")
arr := transaction.SignedTxArr(syncMap, SendTxAccountArr, cfg) arr := transaction.SignedTxArr(syncMap, SendTxAccountArr, cfg)
log.Info("----------------------------------end")
tranArrChan <- arr tranArrChan <- arr
syncMap = updateNonce(syncMap, cfg) syncMap = updateNonce(syncMap, cfg)
} }
} }
} }
......
...@@ -109,7 +109,7 @@ func InitAccNonce(sendTxAccountArr [][]string, cfg *tool.Config) (error, sync.Ma ...@@ -109,7 +109,7 @@ func InitAccNonce(sendTxAccountArr [][]string, cfg *tool.Config) (error, sync.Ma
nonceReq := &ring.NonceRequest{ nonceReq := &ring.NonceRequest{
Address: (*metatypes.Address)(fromAddr.Bytes()), Address: (*metatypes.Address)(fromAddr.Bytes()),
} }
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) ctx, cancel := context.WithTimeout(context.Background(), time.Second*20)
defer cancel() defer cancel()
response, err := serviceClient.Nonce(ctx, nonceReq) response, err := serviceClient.Nonce(ctx, nonceReq)
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment