ITPeople-Blockchain / auction

ITPeople Blockchain - Art Auction Demo
162 stars 183 forks source link

go build art_app.go errors #77

Closed abhilekhsingh041992 closed 7 years ago

abhilekhsingh041992 commented 7 years ago

I setup fabric on vagrant.

I was able to run this command successfully.

cd $GOPATH/src/github.com/hyperledger/fabric
make peer
peer node start --peer-chaincodedev

But getting error in 2nd command:

Usinggo version go1.7.3 linux/amd64

cd $GOPATH/src/github.com/hyperledger/fabric/auction/art/artchaincode
 go build

Output:

# github.com/hyperledger/fabric/auction/art/artchaincode
./art_app.go:304: cannot use new(SimpleChaincode) (type *SimpleChaincode) as type shim.Chaincode in argument to shim.Start:
    *SimpleChaincode does not implement shim.Chaincode (wrong type for Init method)
        have Init(shim.ChaincodeStubInterface, string, []string) ([]byte, error)
        want Init(shim.ChaincodeStubInterface) peer.Response
./art_app.go:325: stub.DeleteTable undefined (type shim.ChaincodeStubInterface has no field or method DeleteTable)
./art_app.go:1991: undefined: shim.ColumnDefinition
./art_app.go:1994: undefined: shim.ColumnDefinition
./art_app.go:1998: undefined: shim.ColumnDefinition
./art_app.go:2002: stub.CreateTable undefined (type shim.ChaincodeStubInterface has no field or method CreateTable)
./art_app.go:2023: undefined: shim.Column
./art_app.go:2026: undefined: shim.Column
./art_app.go:2030: undefined: shim.Column
./art_app.go:2372: undefined: shim.Row
./art_app.go:2030: too many errors

What I am doing wrong here?

asararatnakar commented 7 years ago

@abhilekhsingh041992 curret branch is having fabricV0.6 based code . From this logs I undertand you are executing this on Fabric master branch which is V1.0 , hence you see these errors

./art_app.go:304: cannot use new(SimpleChaincode) (type *SimpleChaincode) as type shim.Chaincode in argument to shim.Start:
    *SimpleChaincode does not implement shim.Chaincode (wrong type for Init method)
        have Init(shim.ChaincodeStubInterface, string, []string) ([]byte, error)
        want Init(shim.ChaincodeStubInterface) peer.Response

@rameshthoomu would be uploading the latest code by tomorrow along with README instructions. Please stay tuned.

Itpeoplecorp commented 7 years ago

@abhilekhsingh041992 master branch now supports v1.0 changes. Please go through the README for the last working commit number.

ratnakar-asara commented 7 years ago

@abhilekhsingh041992 Master branch is now compatible with V1.0 alpha code. Closing the issue.