mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-27 03:31:42 +00:00
[tm-bench] refactor code
- set ID in RPCRequest - rename get_deps to get_vendor_deps
This commit is contained in:
@ -14,8 +14,6 @@ import (
|
||||
tmtypes "github.com/tendermint/tendermint/types"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
"github.com/tendermint/tools/tm-monitor/monitor"
|
||||
"math/rand"
|
||||
"crypto/md5"
|
||||
)
|
||||
|
||||
var version = "0.1.0"
|
||||
@ -76,8 +74,6 @@ Examples:
|
||||
blockCh := make(chan tmtypes.Header, 100)
|
||||
blockLatencyCh := make(chan float64, 100)
|
||||
|
||||
rand.Seed(time.Now().Unix())
|
||||
|
||||
nodes := startNodes(endpoints, blockCh, blockLatencyCh)
|
||||
|
||||
transacters := startTransacters(endpoints, connections, txsRate)
|
||||
@ -142,18 +138,10 @@ func startNodes(endpoints []string, blockCh chan<- tmtypes.Header, blockLatencyC
|
||||
}
|
||||
|
||||
func startTransacters(endpoints []string, connections int, txsRate int) []*transacter {
|
||||
|
||||
var hostHash [16]byte
|
||||
if hostName , err := os.Hostname(); err != nil {
|
||||
hostHash = md5.Sum([]byte("127.0.0.1"))
|
||||
} else {
|
||||
hostHash = md5.Sum([]byte(hostName))
|
||||
}
|
||||
|
||||
transacters := make([]*transacter, len(endpoints))
|
||||
|
||||
for i, e := range endpoints {
|
||||
t := newTransacter(e, connections, txsRate, hostHash)
|
||||
t := newTransacter(e, connections, txsRate)
|
||||
t.SetLogger(logger)
|
||||
if err := t.Start(); err != nil {
|
||||
fmt.Println(err)
|
||||
|
Reference in New Issue
Block a user