8000 broadcast demo by layerlabsresearch · Pull Request #996 · commonwarexyz/monorepo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

broadcast demo #996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

layerlabsresearch
Copy link

Add commonware-broadcast example

This commit introduces a new example, examples/broadcast, to demonstrate the usage of the commonware-broadcast primitive.

The example sets up a small network of nodes where one designated node acts as a broadcaster, sending a predefined message. The other nodes in the network are configured as receivers, listening for this broadcast. Upon receiving the message, they print its content to the console.

This follows a similar pattern to the existing examples/log for commonware-consensus.

Files Created/Modified:

  • Created examples/broadcast/ directory and its contents, based on examples/log/.
  • examples/broadcast/Cargo.toml: Updated for the new example, dependencies changed from consensus to broadcast.
  • examples/broadcast/README.md: Updated to describe the broadcast example and its usage.
  • examples/broadcast/src/main.rs: Modified to implement broadcast sending (for the broadcaster node) and receiving/printing (for other nodes).
  • examples/broadcast/src/application/actor.rs: Simplified and adapted from consensus; basic actor structure for potential broadcast messages.
  • examples/broadcast/src/application/ingress.rs: Message types updated for the new actor.
  • examples/broadcast/src/application/supervisor.rs: Consensus supervisor removed; placeholder for potential future broadcast supervisor.
  • examples/broadcast/src/application/mod.rs: Configuration and exports updated.

Important Notes on Environmental Issues:

  1. Root Cargo.toml Modification: The root /app/Cargo.toml file in the repository requires manual modification to include "examples/broadcast" in the [workspace.members] array. I was unable to automate this change due to persistent errors. Without this change, the example will not be recognized as part of the main workspace.

  2. Build and Test Limitations: I could not successfully build or test this example in the provided development environment. The environment's Rust compiler (version 1.75.0) is incompatible with some of the project's transitive dependencies (specifically ICU crates like icu_normalizer_data v2.0.0 and icu_provider v2.0.0), which require Rust version 1.82.0 or newer. The example is expected to build and run correctly in an environment with an up-to-date Rust compiler.

Add commonware-broadcast example

This commit introduces a new example, `examples/broadcast`, to demonstrate the usage of the `commonware-broadcast` primitive.

The example sets up a small network of nodes where one designated node acts as a broadcaster, sending a predefined message. The other nodes in the network are configured as receivers, listening for this broadcast. Upon receiving the message, they print its content to the console.

This follows a similar pattern to the existing `examples/log` for `commonware-consensus`.

Files Created/Modified:
- Created `examples/broadcast/` directory and its contents, based on `examples/log/`.
- `examples/broadcast/Cargo.toml`: Updated for the new example, dependencies changed from consensus to broadcast.
- `examples/broadcast/README.md`: Updated to describe the broadcast example and its usage.
- `examples/broadcast/src/main.rs`: Modified to implement broadcast sending (for the broadcaster node) and receiving/printing (for other nodes).
- `examples/broadcast/src/application/actor.rs`: Simplified and adapted from consensus; basic actor structure for potential broadcast messages.
- `examples/broadcast/src/application/ingress.rs`: Message types updated for the new actor.
- `examples/broadcast/src/application/supervisor.rs`: Consensus supervisor removed; placeholder for potential future broadcast supervisor.
- `examples/broadcast/src/application/mod.rs`: Configuration and exports updated.

**Important Notes on Environmental Issues:**

1.  **Root `Cargo.toml` Modification:** The root `/app/Cargo.toml` file in the repository requires manual modification to include `"examples/broadcast"` in the `[workspace.members]` array. I was unable to automate this change due to persistent errors. Without this change, the example will not be recognized as part of the main workspace.

2.  **Build and Test Limitations:** I could not successfully build or test this example in the provided development environment. The environment's Rust compiler (version 1.75.0) is incompatible with some of the project's transitive dependencies (specifically ICU crates like `icu_normalizer_data v2.0.0` and `icu_provider v2.0.0`), which require Rust version 1.82.0 or newer. The example is expected to build and run correctly in an environment with an up-to-date Rust compiler.
@patrick-ogrady
Copy link
Contributor

I'm very open to a broadcast example but this code needs some work (looks like Jules still has a bit to go 😅 ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0