tron

22 次浏览
2024年08月26日创建

修改点:

protobuf编译:

protoc --proto_path=. --proto_path=./google/googleapis --java_out=./ ./core/*.proto ./api/*.proto ./core/contract/*.proto

protobuf版本:

def protobufVersion = '4.27.3'

编译后的protobuf结构:

build.gradle

 implementation 'javax.annotation:javax.annotation-api:1.3.2'

有文件路径:https://github.com/tronprotocol/protocol

libp2p也有:https://github.com/tronprotocol/libp2p

切记,不能放在有空格的目录。

安装对应protobuf的版本文档:

https://blog.csdn.net/weixin_38261823/article/details/125683137

安装googleapis报错,修改脚本

#!/bin/sh

set -e

# Install the necessary tools using go install

go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest

go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest

go install google.golang.org/protobuf/cmd/protoc-gen-go@latest

# Ensure the installed binaries are in your PATH

export PATH=$PATH:$(go env GOPATH)/bin

# Download and extract googleapis-common-protos

wget https://repo1.maven.org/maven2/com/google/api/grpc/googleapis-common-protos/0.0.3/googleapis-common-protos-0.0.3.jar

jar xvf googleapis-common-protos-0.0.3.jar

mkdir -p $HOME/protobuf/include

cp -r google/ $HOME/protobuf/include/

ls -l