Skip to content

Commit

Permalink
feat: 初步搭建好grpc通信
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoutianlei-shadow committed Jul 1, 2020
0 parents commit 082793c
Show file tree
Hide file tree
Showing 26 changed files with 26,207 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"files.associations": {
"*.vue": "vue",
"__nullptr": "cpp",
"cstddef": "cpp",
"exception": "cpp",
"initializer_list": "cpp",
"stdexcept": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"algorithm": "cpp",
"*.inc": "cpp",
"iosfwd": "cpp",
"vector": "cpp",
"new": "cpp",
"optional": "cpp",
"__bit_reference": "cpp",
"iostream": "cpp",
"istream": "cpp"
}
}
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
proto:
./build-proto.sh

apis:
bazel build //apis:all

build:
bazel build --cxxopt='-std=c++17'

all: proto apis build

clean:
rm -rf ./apis/cpp/*
rm -f *.log
bazel clean
Empty file added README.md
Empty file.
41 changes: 41 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# protobuf version 3.11.1
http_archive(
name = "rules_proto",
strip_prefix = "rules_proto-218ffa7dfa5408492dc86c01ee637614f8695c45",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/218ffa7dfa5408492dc86c01ee637614f8695c45.tar.gz",
"https://github.com/bazelbuild/rules_proto/archive/218ffa7dfa5408492dc86c01ee637614f8695c45.tar.gz",
],
)
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
rules_proto_dependencies()
rules_proto_toolchains()


# grpc tag 1.27.3
http_archive(
name = "com_github_grpc_grpc",
urls = [
"https://github.com/grpc/grpc/archive/e73882dc0fcedab1ffe789e44ed6254819639ce3.tar.gz",
],
strip_prefix = "grpc-e73882dc0fcedab1ffe789e44ed6254819639ce3",
)



load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")

grpc_deps()

# resove issue: Unable to find package for @build_bazel_rules_swift//swift:swift.bzl: The repository '@build_bazel_rules_swift' could not be resolved.
# https://github.com/grpc/grpc/issues/20042
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()

# new_local_repository(
# name = "usr_local",
# path = "/usr/local",
# build_file = "mysql.BUILD"
# )
17 changes: 17 additions & 0 deletions apis/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

cc_library(
name = "feepb",
srcs = [
'cpp/protocol/v1/fee.grpc.pb.cc',
'cpp/protocol/v1/fee.pb.cc',
],
hdrs = [
'cpp/protocol/v1/fee.grpc.pb.h',
'cpp/protocol/v1/fee.pb.h',
],
deps = [
'@com_google_protobuf//:protobuf',
'@com_github_grpc_grpc//:grpc++',
],
visibility = ["//visibility:public"],
)
142 changes: 142 additions & 0 deletions apis/cpp/protocol/v1/fee.grpc.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 082793c

Please sign in to comment.