-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* P2P layer for rusty-kaspa 1. Server + Client side 2. Basic flow example * Use ctrlc which supports windows os for termination signal and ignore non-working long test * Fix new clippy uninlined-format-args lint Co-authored-by: msutton <[email protected]>
- Loading branch information
1 parent
4b842e5
commit 8cdfff9
Showing
14 changed files
with
2,646 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -16,6 +16,7 @@ members = [ | |
"rpc/core", | ||
"rpc/grpc", | ||
"mining", | ||
"p2p", | ||
] | ||
|
||
[workspace.package] | ||
|
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,37 @@ | ||
[package] | ||
name = "kaspa-p2p" | ||
version.workspace = true | ||
edition.workspace = true | ||
authors.workspace = true | ||
include.workspace = true | ||
license.workspace = true | ||
|
||
[lib] | ||
name = "kaspa_p2p_lib" | ||
path = "./src/lib.rs" | ||
|
||
[[bin]] | ||
name = "kaspa_p2p_client" | ||
path = "./src/bin/p2p_client.rs" | ||
|
||
[[bin]] | ||
name = "kaspa_p2p_server" | ||
path = "./src/bin/p2p_server.rs" | ||
|
||
[dependencies] | ||
# project internal deps | ||
kaspa-core.workspace = true | ||
log.workspace = true | ||
# project external deps | ||
futures = { version = "0.3", default-features = false, features = ["alloc"] } | ||
prost = "0.11" | ||
ctrlc = "3.2" | ||
tokio = { version = "1.21.2", features = [ "rt-multi-thread", "macros", "signal" ]} | ||
tokio-stream = { version = "0.1.11", features = ["net"] } | ||
tonic = { version = "0.8.2", features = ["tls", "gzip"] } | ||
h2 = "0.3" | ||
lockfree = "0.5.1" | ||
uuid = { version = "1.2.2", features = ["v4","fast-rng"] } | ||
|
||
[build-dependencies] | ||
tonic-build = { version = "0.8.2", features = ["prost"] } |
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,14 @@ | ||
fn main() { | ||
let iface_files = &["messages.proto", "p2p.proto", "rpc.proto"]; | ||
let dirs = &["./proto"]; | ||
|
||
tonic_build::configure() | ||
.build_server(true) | ||
.build_client(true) | ||
.compile(iface_files, dirs) | ||
.unwrap_or_else(|e| panic!("protobuf compilation failed, error: {e}")); | ||
// recompile protobufs only if any of the proto files changes. | ||
for file in iface_files { | ||
println!("cargo:rerun-if-changed={file}"); | ||
} | ||
} |
Oops, something went wrong.