hyperledgerhyperledger-sawtooth

protobuf error when building sawtooth-seth-tp


I started learning sawtooth. Initially I planed to install ethereum smart contracts on sawtooth network. In order to do that I following this tutorial After executing this command, docker-compose up --build I am getting following error,

../github.com/hyperledger/sawtooth-sdk-go/processor/context.go:24:2: cannot find package "protobuf/events_pb2" in any of:
/usr/lib/go-1.11/src/protobuf/events_pb2 (from $GOROOT)
/project/sawtooth-seth/processor/src/protobuf/events_pb2 (from $GOPATH)
/project/sawtooth-seth/burrow/src/protobuf/events_pb2
/project/sawtooth-seth/common/src/protobuf/events_pb2
../github.com/hyperledger/sawtooth-sdk-go/processor/processor.go:28:2: cannot find package "protobuf/network_pb2" in any of:
/usr/lib/go-1.11/src/protobuf/network_pb2 (from $GOROOT)
/project/sawtooth-seth/processor/src/protobuf/network_pb2 (from $GOPATH)
/project/sawtooth-seth/burrow/src/protobuf/network_pb2
/project/sawtooth-seth/common/src/protobuf/network_pb2
../github.com/hyperledger/sawtooth-sdk-go/processor/handler.go:30:2: cannot find package "protobuf/processor_pb2" in any of:
/usr/lib/go-1.11/src/protobuf/processor_pb2 (from $GOROOT)
/project/sawtooth-seth/processor/src/protobuf/processor_pb2 (from $GOPATH)
/project/sawtooth-seth/burrow/src/protobuf/processor_pb2
/project/sawtooth-seth/common/src/protobuf/processor_pb2
../github.com/hyperledger/sawtooth-sdk-go/processor/context.go:25:2: cannot find package "protobuf/state_context_pb2" in any of:
/usr/lib/go-1.11/src/protobuf/state_context_pb2 (from $GOROOT)
/project/sawtooth-seth/processor/src/protobuf/state_context_pb2 (from $GOPATH)
/project/sawtooth-seth/burrow/src/protobuf/state_context_pb2
/project/sawtooth-seth/common/src/protobuf/state_context_pb2
../github.com/hyperledger/sawtooth-sdk-go/processor/worker.go:27:2: cannot find package "protobuf/transaction_pb2" in any of:
/usr/lib/go-1.11/src/protobuf/transaction_pb2 (from $GOROOT)
/project/sawtooth-seth/processor/src/protobuf/transaction_pb2 (from $GOPATH)
/project/sawtooth-seth/burrow/src/protobuf/transaction_pb2
/project/sawtooth-seth/common/src/protobuf/transaction_pb2
../github.com/hyperledger/sawtooth-sdk-go/messaging/connection.go:28:2: cannot find package 
"protobuf/validator_pb2" in any of:
/usr/lib/go-1.11/src/protobuf/validator_pb2 (from $GOROOT)
/project/sawtooth-seth/processor/src/protobuf/validator_pb2 (from $GOPATH)
/project/sawtooth-seth/burrow/src/protobuf/validator_pb2
/project/sawtooth-seth/common/src/protobuf/validator_pb2
ERROR: Service 'seth-tp' failed to build: The command '/bin/sh -c go build -o /project/sawtooth-seth/processor/bin/seth-tp' returned a non-zero code: 1

Solution

  • [New Answer]

    This error is now fixed. The PR https://github.com/hyperledger/sawtooth-seth/pull/116 has been merged.

    __

    [Old Answer]

    The error you're seeing is because of the recent sawtooth-sdk-go updates on the way protobuf files are handled. Details in this PR https://github.com/hyperledger/sawtooth-sdk-go/pull/38 .

    To give more information - The SDK's src/protobuf shall be set in the GOPATH. Also, the code shall be updated to start making use of the packaged protobuf files instead of regenerating them every time upon build.

    The PR https://github.com/hyperledger/sawtooth-seth/pull/116 fixes this issue. Please use it until the code is merged to the mainline.

    You may also follow the RocketChat channels #sawtooth-seth and #sawtooth-sdk-dev for more information.