构建 sawtooth-seth-tp 时出现 protobuf 错误

protobuf error when building sawtooth-seth-tp

我开始学习锯齿波。最初我计划在锯齿网络上安装以太坊智能合约。为了做到这一点,我遵循 this tutorial 执行此命令后,docker-compose up --build 我收到以下错误,

../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

[新答案]

此错误现已修复。 PR https://github.com/hyperledger/sawtooth-seth/pull/116 已合并。

__

[旧答案]

您看到的错误是因为最近 sawtooth-sdk-go 更新了 protobuf 文件的处理方式。此 PR https://github.com/hyperledger/sawtooth-sdk-go/pull/38 .

中的详细信息

提供更多信息 - SDK 的 src/protobuf 应在 GOPATH 中设置。此外,应更新代码以开始使用打包的 protobuf 文件,而不是每次构建时都重新生成它们。

PR https://github.com/hyperledger/sawtooth-seth/pull/116 修复了这个问题。请在代码合并到主线之前使用它。

您也可以关注 RocketChat 频道#sawtooth-seth 和#sawtooth-sdk-dev 了解更多信息。