-
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.
- Loading branch information
1 parent
f1981ba
commit a8fc9dc
Showing
42 changed files
with
1,817 additions
and
1,969 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
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 |
---|---|---|
|
@@ -47,3 +47,6 @@ _CodeSignature | |
|
||
# Build | ||
**/_version.py | ||
|
||
# Third party | ||
src/rpcserver/protobuf-c/ |
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 |
---|---|---|
|
@@ -80,22 +80,36 @@ Install the latest client from PyPi: | |
python3 -m pip install -U rpcclient | ||
``` | ||
|
||
## Building | ||
## Construction | ||
|
||
macOS & Linux: | ||
**Note:** Cross-platform support is currently not available. | ||
|
||
```shell | ||
### macOS | ||
|
||
For macOS/iOS (Ensure that Xcode is installed): | ||
|
||
```bash | ||
brew install protobuf protobuf-c | ||
git clone [email protected]:doronz88/rpc-project.git | ||
cd src/rpcserver | ||
mkdir build | ||
cd build | ||
cmake .. -DTARGET=OSX # Build for macOS | ||
# OR | ||
cmake .. -DTARGET=IOS # Build for 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 | ||
git clone [email protected]:doronz88/rpc-project.git | ||
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 Python clean | ||
|
||
all: C Python | ||
|
||
C: $(PROTO_FILES) | ||
# Compile Protocol Buffers for C | ||
mkdir -p $(C_OUT_DIR) | ||
protoc --c_out=$(C_OUT_DIR) --proto_path=. $(PROTO_FILES) | ||
|
||
Python: $(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) |
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,17 @@ | ||
#!/bin/bash | ||
# Define variables for input and output directories | ||
PYTHON_OUT_DIR="../rpcclient/rpcclient/protos/" | ||
C_OUT_DIR="../rpcserver/protos/" | ||
|
||
# Get the directory of the current script | ||
proto_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
||
# Change the working directory to the script directory | ||
cd "$proto_dir" | ||
|
||
# Create the output directories if they don't exist | ||
mkdir -p "$PYTHON_OUT_DIR" | ||
mkdir -p "$C_OUT_DIR" | ||
|
||
# Run protoc with specified output directories | ||
protoc rpc.proto --python_out="$PYTHON_OUT_DIR" --mypy_out="$PYTHON_OUT_DIR" --c_out="$C_OUT_DIR" |
Oops, something went wrong.