aboutsummaryrefslogtreecommitdiffstats
path: root/simulation/config
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-07-20 09:52:52 +0800
committermissionliao <38416648+missionliao@users.noreply.github.com>2018-07-20 09:52:52 +0800
commitdfa19fc2b4e38097334f4a30e159f9bcd92909c0 (patch)
tree718524746a0871a07a4a68dea43481e6ac841b39 /simulation/config
parent46a84bff9ac419853550f7c17b13fb8633e507c9 (diff)
downloadtangerine-consensus-dfa19fc2b4e38097334f4a30e159f9bcd92909c0.tar
tangerine-consensus-dfa19fc2b4e38097334f4a30e159f9bcd92909c0.tar.gz
tangerine-consensus-dfa19fc2b4e38097334f4a30e159f9bcd92909c0.tar.bz2
tangerine-consensus-dfa19fc2b4e38097334f4a30e159f9bcd92909c0.tar.lz
tangerine-consensus-dfa19fc2b4e38097334f4a30e159f9bcd92909c0.tar.xz
tangerine-consensus-dfa19fc2b4e38097334f4a30e159f9bcd92909c0.tar.zst
tangerine-consensus-dfa19fc2b4e38097334f4a30e159f9bcd92909c0.zip
Implement simulation on a real network (#5)
simulation: implement simulation on a real network
Diffstat (limited to 'simulation/config')
-rw-r--r--simulation/config/config.go19
1 files changed, 17 insertions, 2 deletions
diff --git a/simulation/config/config.go b/simulation/config/config.go
index 228d69b..30d1562 100644
--- a/simulation/config/config.go
+++ b/simulation/config/config.go
@@ -23,6 +23,16 @@ import (
"github.com/naoina/toml"
)
+// NetworkType is the simulation network type.
+type NetworkType string
+
+// NetworkType enums.
+const (
+ NetworkTypeFake NetworkType = "fake"
+ NetworkTypeTCP NetworkType = "tcp"
+ NetworkTypeTCPLocal NetworkType = "tcp-local"
+)
+
// Validator config for the simulation.
type Validator struct {
Num int
@@ -32,6 +42,9 @@ type Validator struct {
// Networking config.
type Networking struct {
+ Type NetworkType
+ PeerServer string
+
Mean float64
Sigma float64
LossRateValue float64
@@ -55,13 +68,15 @@ func GenerateDefault(path string) error {
config := Config{
Title: "DEXON Consensus Simulation Config",
Validator: Validator{
- Num: 4,
+ Num: 7,
ProposeIntervalMean: 500,
ProposeIntervalSigma: 30,
},
Networking: Networking{
+ Type: NetworkTypeFake,
+ PeerServer: "peer.server",
Mean: 100,
- Sigma: 30,
+ Sigma: 10,
LossRateValue: 0,
},
}