Skip to content

Commit

Permalink
Merge pull request #73 from uqbar-dao/small-edits
Browse files Browse the repository at this point in the history
file transfer edits
  • Loading branch information
edgaruncentered authored Jan 22, 2024
2 parents 6b948bf + 9041b0b commit e5587a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/cookbook/file_transfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,16 +334,14 @@ pub enum WorkerRequest {
```

Some notes:

- Workers will take an `Inititialize` request from their own node, that either tells them they're a receiver or a sender based on if they have a target worker `Option<Address>`.
- Workers will receive an `Inititialize` request from their own node, which tells the worker it is either a receiver or a sender based on if it has a target worker `Option<Address>`.
- Progress reports are sent back to the main process; if adding a frontend, these could be sent to it via WebSocket updates.

The only additional part you need to handle in the transfer app is the Download request you've added.
`TransferRequest::Download` will handle 2 cases:
1. An incoming download request; spawn a worker, which sends chunks to the remote `target_worker` given in the request,
2. An outgoing download request: spawn a worker, which sends its address to the remote node hosting the file.


To enable spawning and other features, change `file_transfer/src/lib.rs`s imports to:
```rust
use kinode_process_lib::{
Expand Down
4 changes: 2 additions & 2 deletions src/process_stdlib/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The [process standard library](https://github.com/uqbar-dao/process_lib) is the
Documentation can be found [here](https://docs.rs/kinode_process_lib), and the crate lives [here](https://crates.io/crates/kinode_process_lib).

Note that the process lib is under heavy ongoing development.
This means that the best way to use it is by selecting a tag or commit hash from the GitHub repo, and using that as the version in your `Cargo.toml` file.
Therefore, the best way to use it is by selecting a tag or commit hash from the GitHub repo and using that as the version in your `Cargo.toml` file.
See [here](https://github.com/uqbar-dao/process_lib/releases) for a list of published versions.

In your `Cargo.toml` file, use a version tag like this:
Expand All @@ -22,7 +22,7 @@ Make sure to use a recent version of the process_lib while the system is in alph
The major version of the process_lib will always match the major version of Kinode OS.
Since the current major version of both is 0, breaking changes can occur at any time.
Once the major version reaches 1, breaking changes will only occur between major versions.
As is, developers may have to update the version of process_lib they use as they update Kinode OS.
As is, developers may have to update their version of process_lib as they update Kinode OS.

Since Kinode apps use the [WebAssembly Component Model](https://component-model.bytecodealliance.org/), they are built on top of a WIT (Wasm Interface Type) package.
This interface contains the core types and functions that are available to all Kinode apps, and these are automatically generated in Rust when building a Wasm app.
Expand Down

0 comments on commit e5587a0

Please sign in to comment.