-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #327 from doronz88/refactor/protobuf
refactor protocol using protobuf
- Loading branch information
Showing
39 changed files
with
1,700 additions
and
1,926 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,9 +68,9 @@ rpclocal | |
|
||
Download and execute the latest server artifact, according to your platform and arch from here: | ||
|
||
- [rpcserver_iphoneos_arm64.zip](https://nightly.link/doronz88/rpc-project/workflows/server-publish/master/rpcserver_iphoneos_arm64.zip) | ||
- [rpcserver_macosx_x86_64.zip](https://nightly.link/doronz88/rpc-project/workflows/server-publish/master/rpcserver_macosx_x86_64.zip) | ||
- [rpcserver_ubuntu_x86_64.zip](https://nightly.link/doronz88/rpc-project/workflows/server-publish/master/rpcserver_ubuntu_x86_64.zip) | ||
- [rpcserver_ios.zip](https://nightly.link/doronz88/rpc-project/workflows/server-publish/master/rpcserver_ios.zip) | ||
- [rpcserver_macosx.zip](https://nightly.link/doronz88/rpc-project/workflows/server-publish/master/rpcserver_macosx.zip) | ||
- [rpcserver_linux.zip](https://nightly.link/doronz88/rpc-project/workflows/server-publish/master/rpcserver_linux.zip) | ||
|
||
If your specific platform and arch isn't listed, you can also [build it yourself](#building). | ||
|
||
|
@@ -82,20 +82,39 @@ python3 -m pip install -U rpcclient | |
|
||
## Building | ||
|
||
macOS & Linux: | ||
**Note:** Cross-platform support is currently not available. | ||
|
||
```shell | ||
### macOS/iOS | ||
For macOS/iOS (Ensure that Xcode is installed): | ||
|
||
```bash | ||
brew install protobuf protobuf-c | ||
python3 -m pip install mypy-protobuf protobuf grpcio-tools | ||
git clone [email protected]:doronz88/rpc-project.git | ||
cd rpc-project | ||
make -C src/protos/ all | ||
cd src/rpcserver | ||
mkdir build | ||
cd build | ||
cmake .. -DTARGET=OSX | ||
make | ||
cmake .. -DTARGET=IOS | ||
make | ||
``` | ||
|
||
iOS (Make sure to have XCode installed): | ||
### Linux | ||
|
||
```shell | ||
```bash | ||
sudo apt-get install -y protobuf-compiler libprotobuf-dev libprotoc-dev protobuf-c-compiler | ||
python3 -m pip mypy-protobuf protobuf grpcio-tools | ||
git clone [email protected]:doronz88/rpc-project.git | ||
cd rpc-project | ||
make -C src/protos/ all | ||
cd src/rpcserver | ||
./build_darwin.sh | ||
mkdir build | ||
cd build | ||
cmake .. -DTARGET=LINUX | ||
make | ||
``` | ||
|
||
## Quickstart | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
PROTO_FILES = rpc.proto | ||
PYTHON_OUT_DIR=../rpcclient/rpcclient/protos/ | ||
C_OUT_DIR=../rpcserver/protos/ | ||
|
||
.PHONY: all c_protos python_protos clean | ||
|
||
all: c_protos python_protos | ||
|
||
c_protos: $(PROTO_FILES) | ||
# Compile Protocol Buffers for C | ||
mkdir -p $(C_OUT_DIR) | ||
protoc --c_out=$(C_OUT_DIR) --proto_path=. $(PROTO_FILES) | ||
|
||
python_protos: $(PROTO_FILES) | ||
# Compile Protocol Buffers for Python | ||
mkdir -p $(PYTHON_OUT_DIR) | ||
python3 -m grpc_tools.protoc --python_out=$(PYTHON_OUT_DIR) --mypy_out=$(PYTHON_OUT_DIR) --proto_path=. $(PROTO_FILES) | ||
|
||
clean: | ||
# Clean up generated files | ||
rm -rf $(C_OUT_DIR) $(PYTHON_OUT_DIR) |
Oops, something went wrong.