Skip to content

Commit b339572

Browse files
committed
sys:nectar -> distro:sys, removal of 'Nectar' from comments
1 parent 64d2856 commit b339572

File tree

14 files changed

+68
-82
lines changed

14 files changed

+68
-82
lines changed

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: 21 additions & 21 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,7 +322,7 @@ 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,
@@ -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/kv.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl Kv {
6262
/// Get a value.
6363
pub fn get(&self, key: Vec<u8>) -> anyhow::Result<Vec<u8>> {
6464
let res = Request::new()
65-
.target(("our", "kv", "sys", "nectar"))
65+
.target(("our", "kv", "distro", "sys"))
6666
.body(serde_json::to_vec(&KvRequest {
6767
package_id: self.package_id.clone(),
6868
db: self.db.clone(),
@@ -93,7 +93,7 @@ impl Kv {
9393
/// Set a value, optionally in a transaction.
9494
pub fn set(&self, key: Vec<u8>, value: Vec<u8>, tx_id: Option<u64>) -> anyhow::Result<()> {
9595
let res = Request::new()
96-
.target(("our", "kv", "sys", "nectar"))
96+
.target(("our", "kv", "distro", "sys"))
9797
.body(serde_json::to_vec(&KvRequest {
9898
package_id: self.package_id.clone(),
9999
db: self.db.clone(),
@@ -119,7 +119,7 @@ impl Kv {
119119
/// Delete a value, optionally in a transaction.
120120
pub fn delete(&self, key: Vec<u8>, tx_id: Option<u64>) -> anyhow::Result<()> {
121121
let res = Request::new()
122-
.target(("our", "kv", "sys", "nectar"))
122+
.target(("our", "kv", "distro", "sys"))
123123
.body(serde_json::to_vec(&KvRequest {
124124
package_id: self.package_id.clone(),
125125
db: self.db.clone(),
@@ -144,7 +144,7 @@ impl Kv {
144144
/// Begin a transaction.
145145
pub fn begin_tx(&self) -> anyhow::Result<u64> {
146146
let res = Request::new()
147-
.target(("our", "kv", "sys", "nectar"))
147+
.target(("our", "kv", "distro", "sys"))
148148
.body(serde_json::to_vec(&KvRequest {
149149
package_id: self.package_id.clone(),
150150
db: self.db.clone(),
@@ -169,7 +169,7 @@ impl Kv {
169169
/// Commit a transaction.
170170
pub fn commit_tx(&self, tx_id: u64) -> anyhow::Result<()> {
171171
let res = Request::new()
172-
.target(("our", "kv", "sys", "nectar"))
172+
.target(("our", "kv", "distro", "sys"))
173173
.body(serde_json::to_vec(&KvRequest {
174174
package_id: self.package_id.clone(),
175175
db: self.db.clone(),
@@ -195,7 +195,7 @@ impl Kv {
195195
/// Opens or creates a kv db.
196196
pub fn open(package_id: PackageId, db: &str) -> anyhow::Result<Kv> {
197197
let res = Request::new()
198-
.target(("our", "kv", "sys", "nectar"))
198+
.target(("our", "kv", "distro", "sys"))
199199
.body(serde_json::to_vec(&KvRequest {
200200
package_id: package_id.clone(),
201201
db: db.to_string(),
@@ -223,7 +223,7 @@ pub fn open(package_id: PackageId, db: &str) -> anyhow::Result<Kv> {
223223
/// Removes and deletes a kv db.
224224
pub fn remove_db(package_id: PackageId, db: &str) -> anyhow::Result<()> {
225225
let res = Request::new()
226-
.target(("our", "kv", "sys", "nectar"))
226+
.target(("our", "kv", "distro", "sys"))
227227
.body(serde_json::to_vec(&KvRequest {
228228
package_id: package_id.clone(),
229229
db: db.to_string(),

src/lib.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,7 @@ pub fn await_message() -> Result<Message, SendError> {
105105
crate::nectar::process::standard::SendErrorKind::Timeout => SendErrorKind::Timeout,
106106
},
107107
message: wit_message_to_message(
108-
Address {
109-
node: "our".to_string(),
110-
process: ProcessId {
111-
process_name: "net".to_string(),
112-
package_name: "sys".to_string(),
113-
publisher_node: "nectar".to_string(),
114-
},
115-
},
108+
Address::new("our", ProcessId::new(Some("net"), "distro", "sys")),
116109
send_err.message,
117110
),
118111
lazy_load_blob: send_err.lazy_load_blob,

src/package_id.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ impl PackageId {
2424
}
2525
/// Read the publisher node ID from a `PackageId`. Note that `PackageId`
2626
/// segments are not parsed for validity, and a node ID stored here is
27-
/// not guaranteed to be a valid ID in the Nectar name system, or be connected
28-
/// to an Nectar identity at all.
27+
/// not guaranteed to be a valid ID in the name system, or be connected
28+
/// to an identity at all.
2929
pub fn publisher(&self) -> &str {
3030
&self.publisher_node
3131
}

src/process_id.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ impl ProcessId {
2727
}
2828
/// Read the publisher node ID from a `ProcessId`. Note that `ProcessId`
2929
/// segments are not parsed for validity, and a node ID stored here is
30-
/// not guaranteed to be a valid ID in the Nectar name system, or be connected
31-
/// to an Nectar identity at all.
30+
/// not guaranteed to be a valid ID in the name system, or be connected
31+
/// to an identity at all.
3232
pub fn publisher(&self) -> &str {
3333
&self.publisher_node
3434
}

src/request.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -285,14 +285,7 @@ impl Request {
285285
}
286286
},
287287
message: wit_message_to_message(
288-
Address {
289-
node: "our".to_string(),
290-
process: ProcessId {
291-
process_name: "net".to_string(),
292-
package_name: "sys".to_string(),
293-
publisher_node: "nectar".to_string(),
294-
},
295-
},
288+
Address::new("our", ProcessId::new(Some("net"), "distro", "sys")),
296289
send_err.message,
297290
),
298291
lazy_load_blob: send_err.lazy_load_blob,

0 commit comments

Comments
 (0)