Skip to content

Commit a06961d

Browse files
authored
Merge pull request #30 from uqbar-dao/dr/denectar-where-possible
sys:nectar -> distro:sys, removal of 'Nectar' from comments
2 parents 64d2856 + ae99aa3 commit a06961d

23 files changed

+122
-136
lines changed

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[submodule "nectar-wit"]
2-
path = nectar-wit
3-
url = https://github.com/uqbar-dao/nectar-wit.git
1+
[submodule "kinode-wit"]
2+
path = kinode-wit
3+
url = https://github.com/uqbar-dao/kinode-wit.git
44
branch = master

Cargo.lock

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "nectar_process_lib"
2+
name = "kinode_process_lib"
33
version = "0.5.0"
44
edition = "2021"
55

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# process_lib
22

3-
Library of functions for more ergonomic Nectar process development.
3+
Library of functions for more ergonomic kinode process development.
44

55
To develop/build:
66
```
7-
git submodule add https://github.com/uqbar-dao/nectar-wit.git
7+
git submodule add https://github.com/uqbar-dao/kinode-wit.git
88
```
99

1010
Docs: (TODO link)

src/address.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use serde::{Deserialize, Serialize};
33
use std::hash::{Hash, Hasher};
44

55
/// Address is defined in the wit bindings, but constructors and methods here.
6-
/// An `Address` is a combination of an Nectar node ID and a [`ProcessId`]. It is
6+
/// An `Address` is a combination of a node ID (string) and a [`ProcessId`]. It is
77
/// used in the Request/Response pattern to indicate which process on a given node
8-
/// in the Nectar Network to direct the message to. The formatting structure for
8+
/// in the network to direct the message to. The formatting structure for
99
/// an Address is `node@process_name:package_name:publisher_node`
1010
impl Address {
1111
/// Create a new `Address`. Takes a node ID and a process ID.
@@ -33,8 +33,8 @@ impl Address {
3333
}
3434
/// Read the publisher node ID from an `Address`. Note that `Address`
3535
/// segments are not parsed for validity, and a node ID stored here is
36-
/// not guaranteed to be a valid ID in the Nectar name system, or be connected
37-
/// to an Nectar identity at all.
36+
/// not guaranteed to be a valid ID in the name system, or be connected
37+
/// to an identity at all.
3838
pub fn publisher(&self) -> &str {
3939
&self.process.publisher_node
4040
}

src/capability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
33
use std::hash::{Hash, Hasher};
44

55
/// Capability is defined in the wit bindings, but constructors and methods here.
6-
/// A `Capability` is a combination of an Nectar Address and a set of Params (a serialized
6+
/// A `Capability` is a combination of an Address and a set of Params (a serialized
77
/// json string). Capabilities are attached to messages to either share that capability
88
/// with the receiving process, or to prove that a process has authority to perform a
99
/// certain action.

src/eth.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub use ethers_core::types::{
66
};
77
use serde::{Deserialize, Serialize};
88

9-
/// The Request type that can be made to eth:sys:nectar. Currently primitive, this
9+
/// The Request type that can be made to eth:distro:sys. Currently primitive, this
1010
/// enum will expand to support more actions in the future.
1111
///
1212
/// Will be serialized and deserialized using `serde_json::to_vec` and `serde_json::from_slice`.
@@ -54,7 +54,7 @@ impl SubscribeLogsRequest {
5454
pub fn new(id: u64) -> Self {
5555
let request = uqRequest::new().target(uqAddress::new(
5656
"our",
57-
ProcessId::new(Some("eth"), "sys", "nectar"),
57+
ProcessId::new(Some("eth"), "distro", "sys"),
5858
));
5959

6060
SubscribeLogsRequest {

src/http.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use thiserror::Error;
1515
//
1616

1717
/// HTTP Request type that can be shared over WASM boundary to apps.
18-
/// This is the one you receive from the `http_server:sys:nectar` service.
18+
/// This is the one you receive from the `http_server:distro:sys` service.
1919
#[derive(Debug, Serialize, Deserialize)]
2020
pub enum HttpServerRequest {
2121
Http(IncomingHttpRequest),
@@ -57,7 +57,7 @@ pub struct HttpResponse {
5757
// BODY is stored in the lazy_load_blob, as bytes
5858
}
5959

60-
/// Request type sent to `http_server:sys:nectar` in order to configure it.
60+
/// Request type sent to `http_server:distro:sys` in order to configure it.
6161
/// You can also send [`type@HttpServerAction::WebSocketPush`], which
6262
/// allows you to push messages across an existing open WebSocket connection.
6363
///
@@ -210,7 +210,7 @@ impl IncomingHttpRequest {
210210
}
211211

212212
/// Request type that can be shared over WASM boundary to apps.
213-
/// This is the one you send to the `http_client:sys:nectar` service.
213+
/// This is the one you send to the `http_client:distro:sys` service.
214214
#[derive(Debug, Serialize, Deserialize)]
215215
pub enum HttpClientAction {
216216
Http(OutgoingHttpRequest),
@@ -229,7 +229,7 @@ pub enum HttpClientAction {
229229
}
230230

231231
/// HTTP Request type that can be shared over WASM boundary to apps.
232-
/// This is the one you send to the `http_client:sys:nectar` service.
232+
/// This is the one you send to the `http_client:distro:sys` service.
233233
#[derive(Debug, Serialize, Deserialize)]
234234
pub struct OutgoingHttpRequest {
235235
pub method: String, // must parse to http::Method
@@ -241,7 +241,7 @@ pub struct OutgoingHttpRequest {
241241
}
242242

243243
/// WebSocket Client Request type that can be shared over WASM boundary to apps.
244-
/// This comes from an open websocket client connection in the `http_client:sys:nectar` service.
244+
/// This comes from an open websocket client connection in the `http_client:distro:sys` service.
245245
#[derive(Debug, Serialize, Deserialize)]
246246
pub enum HttpClientRequest {
247247
WebSocketPush {
@@ -254,7 +254,7 @@ pub enum HttpClientRequest {
254254
}
255255

256256
/// HTTP Client Response type that can be shared over WASM boundary to apps.
257-
/// This is the one you receive from the `http_client:sys:nectar` service.
257+
/// This is the one you receive from the `http_client:distro:sys` service.
258258
#[derive(Debug, Serialize, Deserialize)]
259259
pub enum HttpClientResponse {
260260
Http(HttpResponse),
@@ -292,7 +292,7 @@ where
292292
T: Into<String>,
293293
{
294294
let res = uqRequest::new()
295-
.target(("our", "http_server", "sys", "nectar"))
295+
.target(("our", "http_server", "distro", "sys"))
296296
.body(serde_json::to_vec(&HttpServerAction::Bind {
297297
path: path.into(),
298298
authenticated,
@@ -322,14 +322,14 @@ where
322322
T: Into<String>,
323323
{
324324
let res = uqRequest::new()
325-
.target(("our", "http_server", "sys", "nectar"))
325+
.target(("our", "http_server", "distro", "sys"))
326326
.body(serde_json::to_vec(&HttpServerAction::Bind {
327327
path: path.into(),
328328
authenticated,
329329
local_only,
330330
cache: true,
331331
})?)
332-
.blob(crate::nectar::process::standard::LazyLoadBlob {
332+
.blob(crate::kinode::process::standard::LazyLoadBlob {
333333
mime: content_type,
334334
bytes: content,
335335
})
@@ -350,7 +350,7 @@ where
350350
T: Into<String>,
351351
{
352352
let res = uqRequest::new()
353-
.target(("our", "http_server", "sys", "nectar"))
353+
.target(("our", "http_server", "distro", "sys"))
354354
.body(serde_json::to_vec(&HttpServerAction::WebSocketBind {
355355
path: path.into(),
356356
authenticated,
@@ -391,7 +391,7 @@ pub fn send_request(
391391
body: Vec<u8>,
392392
) -> anyhow::Result<()> {
393393
let req = uqRequest::new()
394-
.target(("our", "http_client", "sys", "nectar"))
394+
.target(("our", "http_client", "distro", "sys"))
395395
.body(serde_json::to_vec(&HttpClientAction::Http(
396396
OutgoingHttpRequest {
397397
method: method.to_string(),
@@ -417,7 +417,7 @@ pub fn send_request_await_response(
417417
body: Vec<u8>,
418418
) -> std::result::Result<HttpClientResponse, HttpClientError> {
419419
let res = uqRequest::new()
420-
.target(("our", "http_client", "sys", "nectar"))
420+
.target(("our", "http_client", "distro", "sys"))
421421
.body(
422422
serde_json::to_vec(&HttpClientAction::Http(OutgoingHttpRequest {
423423
method: method.to_string(),
@@ -463,7 +463,7 @@ pub fn get_mime_type(filename: &str) -> String {
463463
// Serve index.html
464464
pub fn serve_index_html(our: &Address, directory: &str) -> anyhow::Result<(), anyhow::Error> {
465465
let _ = uqRequest::new()
466-
.target("our@vfs:sys:nectar".parse::<Address>()?)
466+
.target("our@vfs:distro:sys".parse::<Address>()?)
467467
.body(serde_json::to_vec(&VfsRequest {
468468
path: format!("/{}/pkg/{}/index.html", our.package_id(), directory),
469469
action: VfsAction::Read,
@@ -499,7 +499,7 @@ pub fn serve_ui(our: &Address, directory: &str) -> anyhow::Result<(), anyhow::Er
499499

500500
while let Some(path) = queue.pop_front() {
501501
let directory_response = uqRequest::new()
502-
.target("our@vfs:sys:nectar".parse::<Address>()?)
502+
.target("our@vfs:distro:sys".parse::<Address>()?)
503503
.body(serde_json::to_vec(&VfsRequest {
504504
path,
505505
action: VfsAction::ReadDir,
@@ -526,7 +526,7 @@ pub fn serve_ui(our: &Address, directory: &str) -> anyhow::Result<(), anyhow::Er
526526
}
527527

528528
let _ = uqRequest::new()
529-
.target("our@vfs:sys:nectar".parse::<Address>()?)
529+
.target("our@vfs:distro:sys".parse::<Address>()?)
530530
.body(serde_json::to_vec(&VfsRequest {
531531
path: entry.path.clone(),
532532
action: VfsAction::Read,
@@ -581,7 +581,7 @@ pub fn handle_ui_asset_request(
581581
let target_path = format!("{}/{}", directory, after_process.trim_start_matches('/'));
582582

583583
let _ = uqRequest::new()
584-
.target("our@vfs:sys:nectar".parse::<Address>()?)
584+
.target("our@vfs:distro:sys".parse::<Address>()?)
585585
.body(serde_json::to_vec(&VfsRequest {
586586
path: format!("{}/pkg/{}", our.package_id(), target_path),
587587
action: VfsAction::Read,
@@ -617,7 +617,7 @@ pub fn send_ws_push(
617617
uqRequest::new()
618618
.target(Address::new(
619619
node,
620-
"http_server:sys:nectar".parse::<ProcessId>().unwrap(),
620+
"http_server:distro:sys".parse::<ProcessId>().unwrap(),
621621
))
622622
.body(
623623
serde_json::json!(HttpServerRequest::WebSocketPush {
@@ -643,7 +643,7 @@ pub fn open_ws_connection(
643643
uqRequest::new()
644644
.target(Address::new(
645645
node,
646-
ProcessId::from_str("http_client:sys:nectar").unwrap(),
646+
ProcessId::from_str("http_client:distro:sys").unwrap(),
647647
))
648648
.body(
649649
serde_json::json!(HttpClientAction::WebSocketOpen {
@@ -669,7 +669,7 @@ pub fn open_ws_connection_and_await(
669669
uqRequest::new()
670670
.target(Address::new(
671671
node,
672-
ProcessId::from_str("http_client:sys:nectar").unwrap(),
672+
ProcessId::from_str("http_client:distro:sys").unwrap(),
673673
))
674674
.body(
675675
serde_json::json!(HttpClientAction::WebSocketOpen {
@@ -693,7 +693,7 @@ pub fn send_ws_client_push(
693693
uqRequest::new()
694694
.target(Address::new(
695695
node,
696-
ProcessId::from_str("http_client:sys:nectar").unwrap(),
696+
ProcessId::from_str("http_client:distro:sys").unwrap(),
697697
))
698698
.body(
699699
serde_json::json!(HttpClientAction::WebSocketPush {
@@ -712,7 +712,7 @@ pub fn close_ws_connection(node: String, channel_id: u32) -> anyhow::Result<()>
712712
uqRequest::new()
713713
.target(Address::new(
714714
node,
715-
ProcessId::from_str("http_client:sys:nectar").unwrap(),
715+
ProcessId::from_str("http_client:distro:sys").unwrap(),
716716
))
717717
.body(
718718
serde_json::json!(HttpClientAction::WebSocketClose { channel_id })
@@ -732,7 +732,7 @@ pub fn close_ws_connection_and_await(
732732
uqRequest::new()
733733
.target(Address::new(
734734
node,
735-
ProcessId::from_str("http_client:sys:nectar").unwrap(),
735+
ProcessId::from_str("http_client:distro:sys").unwrap(),
736736
))
737737
.body(
738738
serde_json::json!(HttpClientAction::WebSocketClose { channel_id })

src/kernel_types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
use crate::nectar::process::standard as wit;
1+
use crate::kinode::process::standard as wit;
22
use crate::{Address, ProcessId};
33
use serde::{Deserialize, Serialize};
44
use std::collections::HashSet;
55

66
//
77
// process-facing kernel types, used for process
88
// management and message-passing
9-
// matches types in nectar.wit
9+
// matches types in kinode.wit
1010
//
1111

1212
pub type Context = Vec<u8>;

0 commit comments

Comments
 (0)