Skip to content
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

chore(docs): Add tutorial for building channel-based applications #695

Merged
merged 23 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 40 additions & 41 deletions code/Cargo.lock

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

1 change: 0 additions & 1 deletion code/examples/channel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ bytes.workspace = true
color-eyre.workspace = true
derive-where.workspace = true
eyre.workspace = true
libp2p-identity.workspace = true
rand.workspace = true
serde_json.workspace = true
sha3.workspace = true
Expand Down
38 changes: 38 additions & 0 deletions code/examples/channel/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Example channel-based app

This is an example application using the high-level channel-based interface for interacting with consensus.

For more background on this application, [please read the corresponding tutorial](/docs/tutorials/channels.md) which goes over everything needed to write such an application.

## Run a local testnet

### Compile the app

```
$ cargo build
```

### Setup the testnet

Generate configuration and genesis for three nodes using the `testnet` command:

```
$ cargo run -- testnet --nodes 3 --home nodes
```

This will create the configuration for three nodes in the `nodes` folder. Feel free to inspect this folder and look at the generated files.

### Spawn the nodes

```
$ bash spawn.bash --nodes 3 --home nodes
```

If successful, the logs for each node can then be found at `nodes/X/logs/node.log`.

```
$ tail -f nodes/0/logs/node.log
```

Press `Ctrl-C` to stop all the nodes.

Loading
Loading