This repository has been archived by the owner on Feb 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(waku-relay): generate waku relay rpc types from waku-proto repo …
…definitions (#70)
- Loading branch information
Showing
5 changed files
with
42 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: v1 | ||
plugins: | ||
- remote: buf.build/prost/plugins/prost:v0.2.1-1 | ||
out: proto/ | ||
opt: | ||
- bytes=. | ||
- compile_well_known_types | ||
- name: prost-crate | ||
out: . | ||
opt: | ||
- include_file=proto/mod.rs | ||
- no_features | ||
strategy: all |
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,24 @@ | ||
use std::env; | ||
use std::error::Error; | ||
use std::process::{exit, Command}; | ||
|
||
fn main() -> Result<(), Box<dyn Error>> { | ||
let out_dir = env::var_os("OUT_DIR").unwrap(); | ||
|
||
let status = Command::new("buf") | ||
.arg("generate") | ||
.arg("https://github.com/LNSD/waku-proto.git#branch=rust-waku") | ||
.arg("--path") | ||
.arg("waku/relay") | ||
.arg("--output") | ||
.arg(out_dir) | ||
.current_dir(env!("CARGO_MANIFEST_DIR")) | ||
.status() | ||
.unwrap(); | ||
|
||
if !status.success() { | ||
exit(status.code().unwrap_or(-1)) | ||
} | ||
|
||
Ok(()) | ||
} |
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 |
---|---|---|
|
@@ -6,3 +6,4 @@ pub mod error; | |
mod event; | ||
mod message_id; | ||
pub mod proto; | ||
pub mod rpc; |
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,3 @@ | ||
mod proto; | ||
|
||
pub use proto::*; |
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 @@ | ||
include!(concat!(env!("OUT_DIR"), "/proto/mod.rs")); |