diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-09-20 09:09:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-20 09:09:37 +0800 |
commit | 421d72b2d796195178104a0eb1dedf319ba8664c (patch) | |
tree | f32f15c167989905494eca1891c3240b80dac1d6 /cmd/dexcon-simulation-with-scheduler | |
parent | 37f117d35c6617e1944d45e001e03813a6a278ed (diff) | |
download | dexon-consensus-421d72b2d796195178104a0eb1dedf319ba8664c.tar dexon-consensus-421d72b2d796195178104a0eb1dedf319ba8664c.tar.gz dexon-consensus-421d72b2d796195178104a0eb1dedf319ba8664c.tar.bz2 dexon-consensus-421d72b2d796195178104a0eb1dedf319ba8664c.tar.lz dexon-consensus-421d72b2d796195178104a0eb1dedf319ba8664c.tar.xz dexon-consensus-421d72b2d796195178104a0eb1dedf319ba8664c.tar.zst dexon-consensus-421d72b2d796195178104a0eb1dedf319ba8664c.zip |
Rename validator* to node* (#120)
Diffstat (limited to 'cmd/dexcon-simulation-with-scheduler')
-rw-r--r-- | cmd/dexcon-simulation-with-scheduler/main.go | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/cmd/dexcon-simulation-with-scheduler/main.go b/cmd/dexcon-simulation-with-scheduler/main.go index 0684a0d..eeee65c 100644 --- a/cmd/dexcon-simulation-with-scheduler/main.go +++ b/cmd/dexcon-simulation-with-scheduler/main.go @@ -43,29 +43,29 @@ func main() { if err != nil { log.Fatal("unable to read config: ", err) } - // Setup latencies, validators. + // Setup latencies, nodes. networkLatency := &test.NormalLatencyModel{ Sigma: cfg.Networking.Sigma, Mean: cfg.Networking.Mean, } proposingLatency := &test.NormalLatencyModel{ - Sigma: cfg.Validator.Legacy.ProposeIntervalSigma, - Mean: cfg.Validator.Legacy.ProposeIntervalMean, + Sigma: cfg.Node.Legacy.ProposeIntervalSigma, + Mean: cfg.Node.Legacy.ProposeIntervalMean, } - // Setup validators and other consensus related stuffs. - apps, dbs, validators, err := integration.PrepareValidators( - cfg.Validator.Num, networkLatency, proposingLatency) + // Setup nodes and other consensus related stuffs. + apps, dbs, nodes, err := integration.PrepareNodes( + cfg.Node.Num, networkLatency, proposingLatency) if err != nil { - log.Fatal("could not setup validators: ", err) + log.Fatal("could not setup nodes: ", err) } - blockPerValidator := int(math.Ceil( - float64(cfg.Validator.MaxBlock) / float64(cfg.Validator.Num))) + blockPerNode := int(math.Ceil( + float64(cfg.Node.MaxBlock) / float64(cfg.Node.Num))) sch := test.NewScheduler( - test.NewStopByConfirmedBlocks(blockPerValidator, apps, dbs)) - for vID, v := range validators { - sch.RegisterEventHandler(vID, v) + test.NewStopByConfirmedBlocks(blockPerNode, apps, dbs)) + for nID, v := range nodes { + sch.RegisterEventHandler(nID, v) if err = sch.Seed(integration.NewProposeBlockEvent( - vID, time.Now().UTC())); err != nil { + nID, time.Now().UTC())); err != nil { log.Fatal("unable to set seed simulation events: ", err) } |