Skip to content

Commit

Permalink
Merge pull request #15 from TheDhejavu/refactor/modular-workspace
Browse files Browse the repository at this point in the history
(mods): use modular approach with workspace structure
  • Loading branch information
TheDhejavu authored Sep 27, 2024
2 parents 309421d + 5a6bb6f commit efca451
Show file tree
Hide file tree
Showing 25 changed files with 326 additions and 44 deletions.
129 changes: 100 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 42 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,61 @@
[package]
name = "gossipod"
[workspace.package]
version = "0.1.0"
edition = "2021"
rust-version = "1.81"
license = "MIT"
homepage = "https://github.com/TheDhejavu/gossipod"
repository = "https://github.com/TheDhejavu/gossipod"
authors = ["Ayodeji Akinola <akinayodeji4all@gmail.com>"]

[workspace]
members = [
"gossipod",
"examples/*"
# "runtime",
]
resolver = "2"

[profile.release]
debug = true

[dependencies]
[workspace.dependencies]
# Gossipod
gossipod = { path = "./gossipod" }
# gossipod-runtime = { path = "./gossipod-runtime" }

# Serialize and Deserialize
serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1.0.79"
bincode = "1.3"

# Error Handling
anyhow = { version = "1.0.56", features = ["backtrace"] }

# Async
tokio = { version = "1.0", features = ["full"] }
futures = "0.3"
tokio-util = { version = "0.7.1", features = ["codec"] }
uuid = { version = "1.2.1", features = ["serde", "v4"] }
env_logger = "0.11.3"
async-trait = "0.1.81"
gethostname = "0.5.0"
bincode = "1.3"
sysinfo = "0.31.2"
clap = { version = "4.3", features = ["derive"] }

# Data Structures
uuid = { version = "1.2.1", features = ["serde", "v4"] }
dashmap = "6.0.1"
parking_lot = "0.12.3"
bytes = "1.7.1"
rand = "0.8.5"
pin-project = "1.1.5"
crossbeam = "0.8.4"

# Logging and Tracing
env_logger = "0.11.3"
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.10", features = ["env-filter"] }
crossbeam = "0.8.4"

# System Information
gethostname = "0.5.0"
sysinfo = "0.31.2"

# Command Line Interface
clap = { version = "4.3", features = ["derive"] }

# Misc
rand = "0.8.5"
pin-project = "1.1.5"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ includes a number of demos. Below you can run two different instances of gossipo

#### Node_1 as a standalone
```sh
> cargo run --example ping_node -- --name=NODE_1 --port=7948
> cargo run -p ping_node -- --name=NODE_1 --port=7948
```

#### Node_2 with initial join to node_1
```sh
> cargo run --example pong_node -- --name=NODE_2 --port=7947 --join-addr=127.0.0.1:7948
> cargo run -p pong_node -- --name=NODE_2 --port=7947 --join-addr=127.0.0.1:7948
```

# Gossipod API
Expand Down
46 changes: 46 additions & 0 deletions examples/gossipod_with_custom_definitions/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[package]
name = "gossipod_with_custom_definitions"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
authors.workspace = true

[dependencies]
# gossipod
gossipod.workspace = true

# serialize and deserialize
serde.workspace = true
serde_json.workspace = true
bincode.workspace = true

# error Handling
anyhow.workspace = true

# async
tokio.workspace = true
futures.workspace = true
tokio-util.workspace = true
async-trait.workspace = true

# data Structures
uuid.workspace = true
dashmap.workspace = true
parking_lot.workspace = true
bytes.workspace = true
crossbeam.workspace = true

# logging & tracing
env_logger.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true

# cli
clap.workspace = true

[[bin]]
name = "gossipod_with_custom_definitions"
path = "src/gossipod_with_custom_definitions.rs"
Loading

0 comments on commit efca451

Please sign in to comment.