chainspace / blockmania

Blockmania provides leaderless consensus and transaction ordering
MIT License
11 stars 9 forks source link

There are some mistakes after running make install #1

Closed chien72 closed 4 years ago

chien72 commented 4 years ago

After I git this repo under chainsapce.io/blockmania I cd into blockmania and type "make install" It gave me the error: broadcast/broadcast.go:991:6: opts.Dir undefined (type func(string) badger.Options has no field or method Dir) broadcast/broadcast.go:992:6: opts.ValueDir undefined (type func(string) badger.Options has no field or method ValueDir) broadcast/broadcast.go:992:22: opts.Dir undefined (type func(string) badger.Options has no field or method Dir) broadcast/broadcast.go:993:24: cannot use opts (type func(string) badger.Options) as type badger.Options in argument to badger.Open broadcast/replay.go:15:6: opts.Dir undefined (type func(string) badger.Options has no field or method Dir) broadcast/replay.go:16:6: opts.ValueDir undefined (type func(string) badger.Options has no field or method ValueDir) broadcast/replay.go:16:22: opts.Dir undefined (type func(string) badger.Options has no field or method Dir) broadcast/replay.go:17:24: cannot use opts (type func(string) badger.Options) as type badger.Options in argument to badger.Open broadcast/store.go:56:12: assignment mismatch: 2 variables but item.Value returns 1 values broadcast/store.go:56:25: not enough arguments in call to item.Value have () want (func([]byte) error) broadcast/store.go:56:12: too many errors make: *** [install] Error 2

Do you have any idea how to fix it?

Sincerely, Andy

jeremyletang commented 4 years ago

Hi @chien72,

It seems that the dependency to badger is not handle properly, it was done with go dep which is not in use anymore. I've just made a PR to use go mod instead of go dep, feel free to try the branch: https://github.com/chainspace/blockmania/pull/2.

This should fixe your issues.

chien72 commented 4 years ago

Hi @jeremyletang , Thanks for your quick response. I still face the same errors after using go mod. I am very new to Golang so maybe I was doing it wrong. This is how I did it:

  1. I cd into blockmania and go mod init it first
  2. Git the repo under blockmania
  3. make install
  4. same errors came up

Could you tell me more specifically about how to fix this issue ?

jeremyletang commented 4 years ago

What version of Go are you using? Maybe make sure your the env variable GO111MODULE is enabled, you can also try to build the sources running thats at the root of the repository, that should create a blockmania binary in a build folder.

GO111MODULE=on go build -o build/blockmania ./cmd/blockmania

The code is not merge on master, so did you check out the branch from the PR to try again?

chien72 commented 4 years ago

Problem solved! That was my fault, I didn't check the branch from PR. Thanks for your detailed and clear explanation.