From dc69f95394ffaea0c22795635e0a86db33e0c8db Mon Sep 17 00:00:00 2001 From: "mark.lin" Date: Thu, 31 Aug 2017 09:45:14 +0800 Subject: [PATCH 1/2] container: add full fync mode --- container/blockchain.go | 2 ++ container/options.go | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/container/blockchain.go b/container/blockchain.go index 11142f33..52e643c3 100644 --- a/container/blockchain.go +++ b/container/blockchain.go @@ -68,6 +68,7 @@ func NewDefaultBlockchain(numOfValidators int) (bc *blockchain) { NoDiscover(), Etherbase("1a9afb711302c5f83b5902843d1c007a1a137632"), Mine(), + SyncMode("full"), Logging(false), ) } @@ -83,6 +84,7 @@ func NewDefaultBlockchainWithFaulty(numOfNormal int, numOfFaulty int) (bc *block NoDiscover(), Etherbase("1a9afb711302c5f83b5902843d1c007a1a137632"), Mine(), + SyncMode("full"), Logging(false)} normalOpts := make([]Option, len(commonOpts), len(commonOpts)+2) copy(normalOpts, commonOpts[:]) diff --git a/container/options.go b/container/options.go index 01d689fa..51f50639 100644 --- a/container/options.go +++ b/container/options.go @@ -245,3 +245,10 @@ func FaultyMode(mode int) Option { eth.flags = append(eth.flags, fmt.Sprintf("%d", mode)) } } + +func SyncMode(mode string) Option { + return func(eth *ethereum) { + eth.flags = append(eth.flags, "--"+utils.SyncModeFlag.Name) + eth.flags = append(eth.flags, mode) + } +} From 12933bebc0c6ea066591d83e4e428f96f9609a73 Mon Sep 17 00:00:00 2001 From: "mark.lin" Date: Thu, 31 Aug 2017 10:47:36 +0800 Subject: [PATCH 2/2] remove ginkgo -p flag --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4113f944..e3c138c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ matrix: sudo: required go: 1.7.6 script: - - go test -parallel 4 $(glide novendor | grep -v "\.\/tests\/\.\.\.") && cd tests && ginkgo -p + - go test -parallel 4 $(glide novendor | grep -v "\.\/tests\/\.\.\.") && cd tests && ginkgo # These are the latest Go versions. - os: linux @@ -16,7 +16,7 @@ matrix: sudo: required go: 1.8.3 script: - - go test -parallel 4 $(glide novendor | grep -v "\.\/tests\/\.\.\.") && cd tests && ginkgo -p + - go test -parallel 4 $(glide novendor | grep -v "\.\/tests\/\.\.\.") && cd tests && ginkgo services: - docker