Skip to content

Commit

Permalink
chore(rust): rename ockam hub -> ockam orchestrator
Browse files Browse the repository at this point in the history
  • Loading branch information
PsychoPunkSage authored and SanjoDeundiak committed Jul 10, 2024
1 parent b81f3fe commit c627a67
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 18 deletions.
6 changes: 4 additions & 2 deletions examples/rust/file_transfer/examples/receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ async fn main(ctx: Context) -> Result<()> {
//
// All messages that arrive at that forwarding address will be sent to this program
// using the TCP connection we created as a client.
let node_in_hub = tcp.connect("1.node.ockam.network:4000", tcp_options).await?;
let relay = node.create_relay(node_in_hub, RemoteRelayOptions::new()).await?;
let node_in_orchestrator = tcp.connect("1.node.ockam.network:4000", tcp_options).await?;
let relay = node
.create_relay(node_in_orchestrator, RemoteRelayOptions::new())
.await?;
println!("\n[✓] RemoteRelay was created on the node at: 1.node.ockam.network:4000");
println!("Forwarding address for Receiver is:");
println!("{}", relay.remote_address());
Expand Down
4 changes: 2 additions & 2 deletions examples/rust/file_transfer/examples/sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ async fn main(ctx: Context) -> Result<()> {
let forwarding_address = opt.address.trim();

// Connect to the cloud node over TCP
let node_in_hub = tcp
let node_in_orchestrator = tcp
.connect("1.node.ockam.network:4000", TcpConnectionOptions::new())
.await?;

// Combine the tcp address of the cloud node and the forwarding_address to get a route
// to Receiver's secure channel listener.
let route_to_receiver_listener = route![node_in_hub, forwarding_address, "listener"];
let route_to_receiver_listener = route![node_in_orchestrator, forwarding_address, "listener"];

// As Sender, connect to the Receiver's secure channel listener, and perform an
// Authenticated Key Exchange to establish an encrypted secure channel with Receiver.
Expand Down
4 changes: 2 additions & 2 deletions examples/rust/get_started/examples/alice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ async fn main(ctx: Context) -> Result<()> {

// Combine the tcp address of the node and the forwarding_address to get a route
// to Bob's secure channel listener.
let node_in_hub = tcp
let node_in_orchestrator = tcp
.connect("1.node.ockam.network:4000", TcpConnectionOptions::new())
.await?;
let route_to_bob_listener = route![node_in_hub, forwarding_address, "listener"];
let route_to_bob_listener = route![node_in_orchestrator, forwarding_address, "listener"];

// As Alice, connect to Bob's secure channel listener, and perform an
// Authenticated Key Exchange to establish an encrypted secure channel with Bob.
Expand Down
6 changes: 4 additions & 2 deletions examples/rust/get_started/examples/bob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ async fn main(ctx: Context) -> Result<()> {
//
// All messages that arrive at that forwarding address will be sent to this program
// using the TCP connection we created as a client.
let node_in_hub = tcp
let node_in_orchestrator = tcp
.connect("1.node.ockam.network:4000", TcpConnectionOptions::new())
.await?;
let relay = node.create_relay(node_in_hub, RemoteRelayOptions::new()).await?;
let relay = node
.create_relay(node_in_orchestrator, RemoteRelayOptions::new())
.await?;
println!("\n[✓] RemoteRelay was created on the node at: 1.node.ockam.network:4000");
println!("Forwarding address for Bob is:");
println!("{}", relay.remote_address());
Expand Down
4 changes: 2 additions & 2 deletions examples/rust/tcp_inlet_and_outlet/examples/04-inlet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ async fn main(ctx: Context) -> Result<()> {

// Expect second command line argument to be the Outlet node forwarder address
let forwarding_address = std::env::args().nth(2).expect("no outlet forwarding address given");
let node_in_hub = tcp
let node_in_orchestrator = tcp
.connect("1.node.ockam.network:4000", TcpConnectionOptions::new())
.await?;
let r = route![node_in_hub, forwarding_address, "secure_channel_listener"];
let r = route![node_in_orchestrator, forwarding_address, "secure_channel_listener"];
let channel = node.create_secure_channel(&e, r, SecureChannelOptions::new()).await?;

// We know Secure Channel address that tunnels messages to the node with an Outlet,
Expand Down
6 changes: 4 additions & 2 deletions examples/rust/tcp_inlet_and_outlet/examples/04-outlet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ async fn main(ctx: Context) -> Result<()> {
//
// All messages that arrive at that forwarding address will be sent to this program
// using the TCP connection we created as a client.
let node_in_hub = tcp.connect("1.node.ockam.network:4000", tcp_options).await?;
let relay = node.create_relay(node_in_hub, RemoteRelayOptions::new()).await?;
let node_in_orchestrator = tcp.connect("1.node.ockam.network:4000", tcp_options).await?;
let relay = node
.create_relay(node_in_orchestrator, RemoteRelayOptions::new())
.await?;
println!("\n[✓] RemoteRelay was created on the node at: 1.node.ockam.network:4000");
println!("Forwarding address in Hub is:");
println!("{}", relay.remote_address());
Expand Down
2 changes: 1 addition & 1 deletion examples/rust/tcp_inlet_and_outlet/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn run_03_inlet_outlet_separate_processes_secure_channel() -> Result<(), Error>

#[test]
#[ignore]
fn run_04_inlet_outlet_seperate_processes_secure_channel_via_ockam_hub() -> Result<(), Error> {
fn run_04_inlet_outlet_seperate_processes_secure_channel_via_ockam_orchestrator() -> Result<(), Error> {
let port = rand::thread_rng().gen_range(10000..65535);
// Spawn outlet, wait for it to start up, grab dynamic forwarding address
let outlet = CmdBuilder::new("cargo run --example 04-outlet ockam.io:80").spawn()?;
Expand Down
10 changes: 5 additions & 5 deletions implementations/rust/ockam/ockam/src/remote/lifecycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl RemoteRelay {
/// Create and start static RemoteRelay at predefined address with given Ockam Orchestrator route
pub async fn create_static(
ctx: &Context,
hub_route: impl Into<Route>,
orchestrator_route: impl Into<Route>,
alias: impl Into<String>,
options: RemoteRelayOptions,
) -> Result<RemoteRelayInfo> {
Expand All @@ -79,7 +79,7 @@ impl RemoteRelay {
))
.await?;

let registration_route = route![hub_route.into(), "static_forwarding_service"];
let registration_route = route![orchestrator_route.into(), "static_forwarding_service"];

let flow_control_id =
options.setup_flow_control(ctx.flow_controls(), &addresses, registration_route.next()?);
Expand Down Expand Up @@ -108,10 +108,10 @@ impl RemoteRelay {
Ok(resp)
}

/// Create and start new ephemeral RemoteRelay at random address with given Ockam Hub route
/// Create and start new ephemeral RemoteRelay at random address with given Ockam Orchestrator route
pub async fn create(
ctx: &Context,
hub_route: impl Into<Route>,
orchestrator_route: impl Into<Route>,
options: RemoteRelayOptions,
) -> Result<RemoteRelayInfo> {
let addresses = Addresses::generate(RelayType::Ephemeral);
Expand All @@ -124,7 +124,7 @@ impl RemoteRelay {
))
.await?;

let registration_route = route![hub_route, "forwarding_service"];
let registration_route = route![orchestrator_route, "forwarding_service"];

let flow_control_id =
options.setup_flow_control(ctx.flow_controls(), &addresses, registration_route.next()?);
Expand Down

0 comments on commit c627a67

Please sign in to comment.