diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-09-11 14:56:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-11 14:56:47 +0800 |
commit | 292ad73ec08621fa9beef5f028860131fcbf9bd9 (patch) | |
tree | 47644eaad7757cd2e8798ae7fe361fa5d6e99060 /cmd/dexcon-simulation-peer-server | |
parent | 582a491aa0bcb784ac7b65ebbfb42139945ea703 (diff) | |
download | tangerine-consensus-292ad73ec08621fa9beef5f028860131fcbf9bd9.tar tangerine-consensus-292ad73ec08621fa9beef5f028860131fcbf9bd9.tar.gz tangerine-consensus-292ad73ec08621fa9beef5f028860131fcbf9bd9.tar.bz2 tangerine-consensus-292ad73ec08621fa9beef5f028860131fcbf9bd9.tar.lz tangerine-consensus-292ad73ec08621fa9beef5f028860131fcbf9bd9.tar.xz tangerine-consensus-292ad73ec08621fa9beef5f028860131fcbf9bd9.tar.zst tangerine-consensus-292ad73ec08621fa9beef5f028860131fcbf9bd9.zip |
simulation: integrate test.Transport (#99)
- Add marshaller for simulation by encoding/json
- Implement peer server based on test.TranportServer
- Remove network models, they are replaced with test.LatencyModel
Diffstat (limited to 'cmd/dexcon-simulation-peer-server')
-rw-r--r-- | cmd/dexcon-simulation-peer-server/main.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cmd/dexcon-simulation-peer-server/main.go b/cmd/dexcon-simulation-peer-server/main.go index 3e13262..89d535c 100644 --- a/cmd/dexcon-simulation-peer-server/main.go +++ b/cmd/dexcon-simulation-peer-server/main.go @@ -23,6 +23,7 @@ import ( "os" "github.com/dexon-foundation/dexon-consensus-core/simulation" + "github.com/dexon-foundation/dexon-consensus-core/simulation/config" ) var configFile = flag.String("config", "", "path to simulation config file") @@ -35,6 +36,13 @@ func main() { os.Exit(1) } + cfg, err := config.Read(*configFile) + if err != nil { + panic(err) + } server := simulation.NewPeerServer() - server.Run(*configFile) + if _, err := server.Setup(cfg); err != nil { + panic(err) + } + server.Run() } |