Skip to content

Commit

Permalink
docs(core): add gRPC docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DefectingCat committed Dec 26, 2024
1 parent 1ad5c03 commit cc6e892
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions venus-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,15 @@ thread::spawn(move || {
}
});
```

## Communicate with v2ray core

Venus core use gRPC to communicate with v2ray core. First, we need compile the proto files that from v2ray core: https://github.com/v2fly/v2ray-core.

Copy all the proto files to `venus-core/proto` folder and run `make` to generate the rust code.

macOS:

```bash
rsync -R **/*/*.proto ../venus/venus-core/proto/
```
4 changes: 4 additions & 0 deletions venus-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ pub mod consts;
pub mod error;
pub mod message;

pub mod v2ray_core {
tonic::include_proto!("v2ray.core.app.stats.command");
}

#[derive(Debug)]
pub struct Venus {
/// v2ray and venus's self config
Expand Down

0 comments on commit cc6e892

Please sign in to comment.