diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-01-08 17:19:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-08 17:19:37 +0800 |
commit | 87140e484160e3bec8ee6c26dde80ca8e99efbd3 (patch) | |
tree | 175b629b8e06ac9701d8ceebf53226fec742aa89 /simulation | |
parent | c2f02dcd02c8bf50321ba8d742ebfaf2ab74f8d2 (diff) | |
download | tangerine-consensus-87140e484160e3bec8ee6c26dde80ca8e99efbd3.tar tangerine-consensus-87140e484160e3bec8ee6c26dde80ca8e99efbd3.tar.gz tangerine-consensus-87140e484160e3bec8ee6c26dde80ca8e99efbd3.tar.bz2 tangerine-consensus-87140e484160e3bec8ee6c26dde80ca8e99efbd3.tar.lz tangerine-consensus-87140e484160e3bec8ee6c26dde80ca8e99efbd3.tar.xz tangerine-consensus-87140e484160e3bec8ee6c26dde80ca8e99efbd3.tar.zst tangerine-consensus-87140e484160e3bec8ee6c26dde80ca8e99efbd3.zip |
simulation: fix k8s simulation stuff (#410)
* simulation: fix k8s simulation stuff
* Default K to 0
Diffstat (limited to 'simulation')
-rw-r--r-- | simulation/config/config.go | 2 | ||||
-rw-r--r-- | simulation/kubernetes/Dockerfile | 2 | ||||
-rw-r--r-- | simulation/kubernetes/config.toml.in | 29 | ||||
-rw-r--r-- | simulation/kubernetes/node.yaml.in | 2 | ||||
-rw-r--r-- | simulation/kubernetes/peer-server.yaml | 2 | ||||
-rwxr-xr-x | simulation/kubernetes/run_simulation.sh | 2 | ||||
-rw-r--r-- | simulation/kubernetes/scheduler.yaml.in | 2 | ||||
-rw-r--r-- | simulation/simulation.go | 2 |
8 files changed, 26 insertions, 17 deletions
diff --git a/simulation/config/config.go b/simulation/config/config.go index d22f4f1..482f9cd 100644 --- a/simulation/config/config.go +++ b/simulation/config/config.go @@ -115,7 +115,7 @@ func GenerateDefault(path string) error { Node: Node{ Consensus: Consensus{ PhiRatio: float32(2) / 3, - K: 1, + K: 0, NumChains: 7, GenesisCRS: "In DEXON we trust.", LambdaBA: 250, diff --git a/simulation/kubernetes/Dockerfile b/simulation/kubernetes/Dockerfile index 3a30ebd..ed2ed87 100644 --- a/simulation/kubernetes/Dockerfile +++ b/simulation/kubernetes/Dockerfile @@ -1,6 +1,8 @@ FROM golang:alpine MAINTAINER Wei-Ning Huang <w@dexon.org> +RUN apk add --no-cache libstdc++ + # Cobinhood vendor base directory. RUN mkdir -p /opt/dexon/ diff --git a/simulation/kubernetes/config.toml.in b/simulation/kubernetes/config.toml.in index 7f02f74..af76097 100644 --- a/simulation/kubernetes/config.toml.in +++ b/simulation/kubernetes/config.toml.in @@ -1,19 +1,21 @@ title = "DEXON Consensus Simulation Config" [node] -num = {{numNode}} +num = {{numNodes}} max_block = 18446744073709551615 +changes = [] [node.consensus] phi_ratio = 6.666666865348816e-01 -k = 1 -chain_num = 7 +k = 0 +num_chains = 7 genesis_crs = "In DEXON we trust." -lambda_ba = 250 -lambda_dkg = 4000 -round_interval = 31536000000 -notary_set_size = 7 -dkg_set_size = 7 +lambda_ba = 400 +lambda_dkg = 15000 +round_interval = 360000 +notary_set_size = 4 +dkg_set_size = 4 +min_block_interval = 900 [node.legacy] propose_interval_mean = 5e+02 @@ -22,9 +24,14 @@ propose_interval_sigma = 5e+01 [networking] type = "tcp" peer_server = "peer-server-svc.default.svc.cluster.local" -mean = 1e+02 -sigma = 1e+01 -loss_rate_value = 0e+00 + +[networking.direct] +mean = 3e+02 +sigma = 5e+01 + +[networking.gossip] +mean = 3e+02 +sigma = 2.5e+01 [scheduler] worker_num = 2 diff --git a/simulation/kubernetes/node.yaml.in b/simulation/kubernetes/node.yaml.in index bc457e6..f0fb512 100644 --- a/simulation/kubernetes/node.yaml.in +++ b/simulation/kubernetes/node.yaml.in @@ -22,7 +22,7 @@ spec: path: /etc/ssl/certs containers: - name: dexcon-simulation - image: asia.gcr.io/cobinhood/dexcon-simulation:latest + image: asia.gcr.io/dexon-dev/dexcon-simulation:latest imagePullPolicy: Always ports: - containerPort: 8080 diff --git a/simulation/kubernetes/peer-server.yaml b/simulation/kubernetes/peer-server.yaml index eb8a70e..1094eca 100644 --- a/simulation/kubernetes/peer-server.yaml +++ b/simulation/kubernetes/peer-server.yaml @@ -35,7 +35,7 @@ spec: path: /etc/ssl/certs containers: - name: dexcon-simulation - image: asia.gcr.io/cobinhood/dexcon-simulation:latest + image: asia.gcr.io/dexon-dev/dexcon-simulation:latest imagePullPolicy: Always ports: - containerPort: 8080 diff --git a/simulation/kubernetes/run_simulation.sh b/simulation/kubernetes/run_simulation.sh index b9e6862..2537eb6 100755 --- a/simulation/kubernetes/run_simulation.sh +++ b/simulation/kubernetes/run_simulation.sh @@ -1,6 +1,6 @@ #!/bin/bash -IMAGE_TAG=asia.gcr.io/cobinhood/dexcon-simulation:latest +IMAGE_TAG=asia.gcr.io/dexon-dev/dexcon-simulation:latest build_binary() { diff --git a/simulation/kubernetes/scheduler.yaml.in b/simulation/kubernetes/scheduler.yaml.in index 0f17a4c..3893383 100644 --- a/simulation/kubernetes/scheduler.yaml.in +++ b/simulation/kubernetes/scheduler.yaml.in @@ -21,7 +21,7 @@ spec: path: /etc/ssh/certs containers: - name: dexcon-simulation-with-scheduler - image: asia.gcr.io/cobinhood/dexcon-simulation:latest + image: asia.gcr.io/dexon-dev/dexcon-simulation:latest imagePullPolicy: Always ports: - containerPort: 8080 diff --git a/simulation/simulation.go b/simulation/simulation.go index 10ccb4c..938b302 100644 --- a/simulation/simulation.go +++ b/simulation/simulation.go @@ -61,7 +61,7 @@ func Run(cfg *config.Config, logPrefix string) { mw = io.MultiWriter(os.Stderr, f) } logger := log.New() - logger.SetHandler(log.StreamHandler(mw, log.LogfmtFormat())) + logger.SetHandler(log.StreamHandler(mw, log.TerminalFormat(false))) return logger } |