Merge pull request #51 from getamis/feature/docker_sync_mode

container: use full sync mode
This commit is contained in:
Alan Chen 2017-08-31 17:28:17 +08:00 committed by GitHub
commit 5e00f9837c
3 changed files with 11 additions and 2 deletions

View File

@ -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

View File

@ -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[:])

View File

@ -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)
}
}